Branch naming detection method, device and equipment

By matching branch naming specifications through detection methods, the problem of the development team lacking clear branch naming specifications is solved, ensuring the standardization of branch naming and improving project development quality.

CN120012766APending Publication Date: 2025-05-16SHANSHU TECH (BEIJING) CO LTD +5
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510091415.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

Many development teams lack clear branch naming specifications, resulting in irregular branch naming and reducing project development quality.

Method used

Provide a detection method for branch naming. By obtaining the name to be detected, in response to the user's specification selection operation, matching the delimiter to be detected and the target delimiter, matching the subname to be detected and the target sub-specify, and determining the normativeness of branch naming.

Benefits of technology

Ensure the standardization of branch naming, improve the quality of project development, and improve the convenience of user's branch naming detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120012766A_ABST
    Figure CN120012766A_ABST
Patent Text Reader

Abstract

The invention provides a branch naming detection method, device and equipment. The method comprises the following steps: obtaining a to-be-detected name; wherein the to-be-detected name comprises at least one to-be-detected sub-name; adjacent to-be-detected sub-names are connected through to-be-detected separators; in response to a specification selection operation of a user, obtaining a target naming specification from at least one preset candidate naming specification; wherein the target naming specification comprises at least one target sub-specification, and the adjacent target sub-specifications are connected through a target separator; matching the to-be-detected separator with the target separator, and matching the to-be-detected sub-name with the target sub-specification to obtain a matching result; and determining a branch name detection result of the to-be-detected name based on a matching result. According to the method, whether the branch naming of the to-be-detected naming is standard or not can be automatically detected, so that the standardization of the branch naming is ensured, and the project development quality can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a branch naming detection method, device and equipment. Background Art

[0002] Git is a free, open source distributed version control system used to manage code versions during development. Git branches are like an independent development path that branches off from the main line of code development. Each branch can have its own submission history, modification content, etc., which makes it easier for developers to isolate the development of different functions, version iterations, or problem fixes. In Git, reasonable branch naming is crucial for project management and collaboration.

[0003] In related technologies, many development teams do not have clear branch naming specifications; although some development teams have clear branch naming specifications, they usually rely on developers to consciously abide by the conventions, which makes it difficult to avoid misoperations, resulting in non-standard branch naming and reducing the quality of project development. Summary of the invention

[0004] In view of the above problems, the present application aims to provide a branch naming detection method, device and equipment to solve the problem that many development teams in the prior art do not have clear branch naming specifications; although some development teams have clear branch naming specifications, they usually rely on developers to consciously abide by the conventions, which makes it difficult to avoid the occurrence of misoperations, resulting in non-standard branch naming and reduced project development quality.

[0005] In a first aspect, the present application provides a method for detecting branch naming, the method comprising:

[0006] Obtaining a name to be detected; wherein the name to be detected includes at least one sub-name to be detected; adjacent sub-names to be detected are connected by a separator to be detected;

[0007] In response to a specification selection operation by a user, a target naming specification is obtained from at least one preset candidate naming specification; wherein the target naming specification includes at least one target sub-specification, and adjacent target sub-specifications are connected by a target separator;

[0008] Matching the to-be-detected delimiter with the target delimiter, and matching the to-be-detected sub-name with the target sub-specification to obtain a matching result;

[0009] Based on the matching result, a branch naming detection result of the name to be detected is determined.

[0010] In a possible implementation manner, matching the to-be-detected delimiter with the target delimiter and matching the to-be-detected sub-name with the target sub-specification to obtain a matching result includes:

[0011] Counting a first number of the target sub-specifications and a second number of the sub-names to be detected;

[0012] If the first number is equal to the second number, then each of the to-be-detected delimiters is matched with the corresponding target delimiters in order of precedence, and each of the to-be-detected sub-names is matched with the corresponding target sub-specifications to obtain a matching result.

[0013] In a possible implementation, matching each of the to-be-detected delimiters with the corresponding target delimiters in order, and matching each of the to-be-detected sub-names with the corresponding target sub-specifications to obtain a matching result; and determining a branch naming detection result of the to-be-detected name based on the matching result, includes:

[0014] If, in order of precedence, each of the to-be-detected delimiters matches the corresponding target delimiters, and each of the to-be-detected sub-names matches the corresponding target sub-specifications, then the branch naming specification of the to-be-detected names is determined.

[0015] In a possible implementation, matching each of the to-be-detected delimiters with the corresponding target delimiters in order, and matching each of the to-be-detected sub-names with the corresponding target sub-specifications to obtain a matching result; and determining a branch naming detection result of the to-be-detected name based on the matching result, includes:

[0016] If, in order of precedence, at least one of the delimiters to be detected does not match the corresponding target delimiter, or at least one of the sub-names to be detected does not match the corresponding target sub-standard, then it is determined that the branch naming of the name to be detected is not standardized, and a non-standard prompt message is generated.

[0017] In a possible implementation manner, the target separator includes at least one of the following: “ / ”, “-”;

[0019] The target sub-specification includes a specification name and description information; the target sub-specification includes at least one of the following:

[0020] The specification name is the work type, and the corresponding description information includes at least one of the following: new features, fixes, and release versions;

[0021] The specification name is the developer, and the corresponding description information is lowercase letters;

[0022] The standard name is the start time, and the corresponding description information is an 8-digit number;

[0023] The standard name is work item, and the corresponding description information is lowercase words connected by "-".

[0024] In a possible implementation, the target naming specification is: work type / developer / start time-work item;

[0025] Among them, " / " is used to connect adjacent target sub-specifications;

[0026] " / " is also used to generate a new folder corresponding to the adjacent right-hand canonical name under the current folder corresponding to the adjacent left-hand canonical name;

[0027] "-" is used to connect adjacent target subspecifications.

[0028] In a possible implementation manner, before matching the to-be-detected delimiter with the corresponding target delimiter and matching the to-be-detected sub-name with the corresponding target sub-specification to obtain a matching result, the method further includes:

[0029] Extracting the separator to be detected in the name to be detected;

[0030] Based on the separator to be detected, the sub-name to be detected in the name to be detected is extracted.

[0031] In a second aspect, the present application provides a branch naming detection device, the device comprising:

[0032] An acquisition unit, used for acquiring a name to be detected; wherein the name to be detected includes at least one sub-name to be detected; adjacent sub-names to be detected are connected by a separator to be detected;

[0033] A response unit, configured to obtain a target naming specification from at least one preset candidate naming specification in response to a specification selection operation by a user; wherein the target naming specification includes at least one target sub-specification, and adjacent target sub-specifications are connected by a target separator;

[0034] A detection unit, used to match the to-be-detected delimiter with the target delimiter, and to match the to-be-detected sub-name with the target sub-specification to obtain a matching result;

[0035] The detection unit is further configured to determine a branch naming detection result of the name to be detected based on the matching result.

[0036] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0037] The memory stores computer-executable instructions;

[0038] The processor executes the computer-executable instructions stored in the memory to implement the method in any possible implementation of the first aspect above.

[0039] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the method in any possible implementation of the above-mentioned first aspect.

[0040] The present application provides a method, device and equipment for detecting branch naming, the method comprising: obtaining a name to be detected; wherein the name to be detected includes at least one sub-name to be detected; adjacent sub-names to be detected are connected by a separator to be detected; in response to a user's specification selection operation, obtaining a target naming specification from at least one pre-set candidate naming specification; wherein the target naming specification includes at least one target sub-specification, and adjacent target sub-specifications are connected by a target separator; matching the separator to be detected with the target separator, and matching the sub-name to be detected with the target sub-specification to obtain a matching result; based on the matching result, determining the branch naming detection result of the name to be detected. The present application can obtain the target naming specification from at least one pre-set candidate naming specification in response to the user's specification selection operation, and then use the target naming specification to automatically detect whether the branch naming of the name to be detected is standardized, thereby ensuring the standardization of branch naming, and thereby improving the quality of project development. Moreover, the present application can pre-set at least one candidate naming specification, and the user can select the target naming specification as needed, which improves the convenience of the user for branch naming detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0042] Figure 1 A schematic diagram of a flow chart of a branch naming detection method provided in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of a flow chart of another branch naming detection method provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of the structure of a branch naming detection device provided in an embodiment of the present application;

[0045] Figure 4 A hardware structure diagram of an electronic device provided in an embodiment of the present application.

[0046] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments.

[0047] Description of reference numerals:

[0048] 300 - branch named detection device; 301 - acquisition unit; 302 - response unit; 303 - detection unit; 401 - processor; 402 - memory; 403 - communication interface; 404 - communication bus. DETAILED DESCRIPTION

[0049] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0050] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference.

[0051] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described in the present application as "exemplary" or "for example" should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more.

[0052] When software developers write project source code, they usually face Git and Git branches. A commonly agreed Git branch naming convention is conducive to improving the readability, maintainability, and even project development efficiency of project source code, especially in the development process of large-scale projects with multi-person collaboration. For example, by writing a unified branch naming convention and cooperating with other engineering automation tools, the project progress can be automatically maintained while maintaining the source code.

[0053] Incorrect naming Relatively standard naming Standard naming main main main Branch 1 feature-one feat / lisi / edit-user-info Branch 2 feat-two feat / wangwu / update-docs Zhang San's branch feat-zhangsan feat / zhangsan / add-test-case test fix-test fix / zhangsan / can-not-login Bug fixes fix-bug fix / zhangsan / button-have-no-color Fixed issues fix-something fix / lisi / incorrect-brand-logo

[0054] As can be seen from the above table, compared with non-standard branch naming, standardized naming makes it easier to identify project source code developers and their main work items.

[0055] In related technologies, many development teams do not have clear branch naming specifications; although some development teams have clear branch naming specifications, they usually rely on developers to consciously abide by the conventions, which makes it difficult to avoid misoperations, resulting in non-standard branch naming and reducing the quality of project development.

[0056] In order to solve the above technical problems, the embodiments of the present application provide a branch naming detection method, device and equipment, which can obtain a target naming specification from at least one pre-set candidate naming specification in response to the user's specification selection operation, and then use the target naming specification to automatically detect whether the branch naming to be detected is standardized, thereby ensuring the standardization of branch naming, and thus improving the quality of project development. Moreover, the present application can pre-set at least one candidate naming specification, and the user can select the target naming specification as needed, which improves the convenience of the user for branch naming detection.

[0057] Figure 1 A flow chart of a branch naming detection method provided in an embodiment of the present application. This embodiment can be applied to the scenario of detecting whether the branch naming is standardized. The method can be executed by a branch naming detection device, which can be implemented by software and / or hardware and specifically configured in an electronic device. Figure 1 As shown, the method includes:

[0058] Step 101, obtaining a name to be detected; wherein the name to be detected includes at least one sub-name to be detected; adjacent sub-names to be detected are connected by a separator to be detected.

[0059] In implementation, when a software developer submits source code, the branch name corresponding to the source code can be extracted and used as the name to be tested, and then the branch name of the source code can be tested to see if it is standardized. If it is determined to be standardized, the source code can be submitted; if it is not standardized, the software developer is prompted to modify the branch name, and the branch name detection can be continued after the modification until the branch name is standardized. This ensures the standardization of the branch naming of the source code.

[0060] For example, the name of the detection object can be: fix-bug.

[0061] Among them, "fix" and "bug" both indicate the names of the sub-items to be detected. "-" indicates the separator to be detected.

[0062] Step 102, in response to a specification selection operation by a user, obtaining a target naming specification from at least one preset candidate naming specification; wherein the target naming specification includes at least one target sub-specification, and adjacent target sub-specifications are connected by a target separator.

[0063] Considering that different branch naming conventions may be used for different projects, the present solution may pre-set at least one branch naming convention corresponding to different projects as a candidate naming convention for users to select and use.

[0064] Specifically, a display device may be used to display all pre-set candidate naming specifications for the user to select. The user may click on the desired candidate naming specification. The electronic device may respond to the specification selection operation of the user and use the candidate naming specification selected by the user as the target naming specification.

[0065] Among them, the target sub-specification includes the naming standard requirements for the names of the sub-detections.

[0066] Step 103, matching the separator to be detected with the target separator, and matching the sub-name to be detected with the target sub-specification to obtain a matching result; based on the matching result, determining a branch name detection result of the name to be detected.

[0067] In implementation, it can be determined whether the sub-name to be detected in the name to be detected corresponds to the target sub-specification in the target naming specification; whether the delimiter to be detected in the name to be detected corresponds to the target delimiter in the target naming specification. If there is a situation where the sub-name to be detected and the target sub-specification do not correspond one-to-one, or the delimiter to be detected and the target delimiter do not correspond one-to-one, it can be determined that the match fails, the branch naming of the name to be detected is not standardized, and the user can be prompted that the length of the name to be detected is incorrect.

[0068] If the sub-naming to be detected corresponds to the target sub-specification one-to-one, and the delimiter to be detected corresponds to the target delimiter one-to-one, and in order, the delimiter to be detected at the same position is the same as the target delimiter, and the sub-naming to be detected at the same position meets the naming specification requirements for the sub-naming to be detected in the target sub-specification, then it can be determined that the match is successful and the branch naming specification of the name to be detected is met.

[0069] If the sub-name to be detected corresponds to the target sub-specification one-to-one, and the delimiter to be detected corresponds to the target delimiter one-to-one; but in the order of precedence, the delimiter to be detected and the target delimiter at the same position are different, or the sub-name to be detected at the same position does not meet the naming standard requirements of the sub-name to be detected in the target sub-specification, then it can be determined that the match is unsuccessful and the branch name of the sub-name to be detected is not standardized. At the same time, a prompt message can be generated based on the existing mismatch to facilitate user viewing.

[0070] The branch naming detection method provided in the above embodiment can obtain the target naming specification from at least one pre-set candidate naming specification in response to the user's specification selection operation, and then use the target naming specification to automatically detect whether the branch naming to be detected is standardized, thereby ensuring the standardization of branch naming, and thus improving the quality of project development. Moreover, the present application can pre-set at least one candidate naming specification, and the user can select the target naming specification as needed, which improves the convenience of the user for branch naming detection.

[0071] Figure 2 A flow chart of another branch naming detection method provided in an embodiment of the present application. Figure 1 Based on the illustrated embodiment, the branch naming detection method is improved.

[0072] like Figure 2 As shown, a branch naming detection method may include the following steps:

[0073] Step 201, obtaining a name to be detected; wherein the name to be detected includes at least one sub-name to be detected; adjacent sub-names to be detected are connected by a separator to be detected.

[0074] The principle and implementation of step 201 are similar to those of step 101 and will not be described in detail.

[0075] Step 202, in response to a specification selection operation by a user, obtaining a target naming specification from at least one preset candidate naming specification; wherein the target naming specification includes at least one target sub-specification, and adjacent target sub-specifications are connected by a target separator.

[0076] In an achievable manner, the target separator includes at least one of the following: “ / ”, “-”;

[0077] The target sub-specification includes a specification name and description information; the target sub-specification includes at least one of the following: the specification name is the work type, and the corresponding description information includes at least one of the following: new features, fixes, and release versions; the specification name is developers, and the corresponding description information is lowercase letters; the specification name is start time, and the corresponding description information is an 8-digit number; the specification name is work items, and the corresponding description information is lowercase words connected by “-”.

[0078] For example, "feat" can be used to represent a new feature, "bug" can be used to represent a fix, and "release" can be used to represent a released version.

[0079] For example, if the standard name is the start time and the description information is an 8-digit number, the matching sub-name to be detected can be: 20240120.

[0080] In this solution, the target sub-specification includes a specification name and description information. The specification name gives the meaning of the sub-name to be detected, and the description information gives the naming specification requirements for the sub-name to be detected. Therefore, the target sub-specification in this solution is easy for users to understand and facilitates users to perform branch naming detection.

[0081] The target separator provided by this solution is easy to understand and convenient to use.

[0082] In one implementable method, the target naming specification is: work type / developer / start time-work items; wherein, “ / ” is used to connect adjacent target sub-specifications; “ / ” is also used to generate a new folder corresponding to the adjacent right-side specification name under the current folder corresponding to its adjacent left-side specification name; and “-” is used to connect adjacent target sub-specifications.

[0083] For example, the name to be detected that matches the above target naming specification can be: feat / zhangsan / 20220201-edit-user-info.

[0084] In one implementable manner, the target sub-specifications and target separators included in the target naming specification can be described in a computer-recognizable language such as json or yaml, and the description content can be placed under config. The following takes the computer-recognizable yaml language as an example to describe the target naming specification, where pattern represents the content that the current part should include, and message represents how to prompt if the current part does not meet the requirements.

[0085] config

[0086] -pattern:['feat', 'fix', 'release']

[0087] message:'The work type can only be feat, fix or release'

[0088] -pattern:' / '

[0089] message:'The separator can only be / '

[0090] -pattern: / [az]+ /

[0091] message: 'Developer names can only be lowercase letters'

[0092] -pattern:' / '

[0093] message:'The separator can only be / '

[0094] -pattern: / [0-9]{8} /

[0095] message: 'The start date can only be 8 digits'

[0096] -pattern:'-'

[0097] message:'The separator can only be -'

[0098] -pattern: / [az-] /

[0099] message: 'Work items can only be lowercase words separated by -'.

[0100] Using the above target naming conventions, users can more easily identify the work type, developers, start time and main work items of the project source code.

[0101] Step 203, extracting the separator to be detected in the name to be detected; based on the separator to be detected, extracting the sub-name to be detected in the name to be detected.

[0102] During implementation, the recognition method of the delimiter to be detected can be set based on the characteristics of the target delimiter and the target sub-specification in the target naming specification. For example, if the target naming specification is: work type / developer / start time-work items; wherein, " / " is used to connect adjacent target sub-specifications; " / " is also used to generate a new folder corresponding to the adjacent right-hand specification name under the current folder corresponding to its adjacent left-hand specification name; "-" is used to connect adjacent target sub-specifications. The specification name is work type, and the corresponding description information includes at least one of the following: new features, fixes, and release versions; the specification name is developer, and the corresponding description information is lowercase letters; the specification name is start time, and the corresponding description information is 8 digits; the specification name is work items, and the corresponding description information is lowercase words connected by "-". "Feat" can be used to represent new features. "Bug" can be used to represent fixes. "Release" can be used to represent release versions. The identification method of the separator to be detected can be: identifying and taking the " / " in the name to be detected as the separator to be detected; identifying the " / eight-digit-" structure in the name to be detected, and taking the "-" in the structure as the separator to be detected.

[0103] In the name to be detected, the part between two adjacent separators to be detected is a sub-name to be detected; and, in order of precedence, the part before the first separator to be detected is a sub-name to be detected; and the part after the last separator to be detected is a sub-name to be detected.

[0104] Based on the above analysis, it can be understood that the number of separators to be detected in the name to be detected is one less than the number of sub-names to be detected.

[0105] Through the above method, the delimiter to be detected and the sub-name to be detected can be easily obtained.

[0106] Step 204 , counting a first number of target sub-specifications and a second number of sub-names to be detected.

[0107] Specifically, the sum of the number of all target sub-specifications included in the target naming specification may be used as the first number, and the sum of the number of all sub-names to be detected included in the name to be detected may be used as the second number.

[0108] Step 205, if the first number is equal to the second number, then match each to-be-detected delimiter with the corresponding target delimiter in order of precedence, and match each to-be-detected sub-name with the corresponding target sub-specification to obtain a matching result; based on the matching result, determine the branch name detection result of the to-be-detected name.

[0109] Specifically, if the delimiter to be detected is the same as the corresponding target delimiter, it can be determined that the delimiter to be detected matches the corresponding target delimiter; if the delimiter to be detected is different from the corresponding target delimiter, it can be determined that the delimiter to be detected does not match the corresponding target delimiter.

[0110] Specifically, if the naming of the sub-to-be-detected sub-component meets the naming specification requirements for the naming of the sub-to-be-detected sub-component contained in the corresponding target sub-specification, it can be determined that the naming of the sub-to-be-detected sub-component matches the corresponding target sub-specification; if the naming of the sub-to-be-detected sub-component does not meet the naming specification requirements for the naming of the sub-to-be-detected sub-component contained in the corresponding target sub-specification, it can be determined that the naming of the sub-to-be-detected sub-component does not match the corresponding target sub-specification.

[0111] In one achievable manner, if, in order of precedence, each to-be-detected delimiter matches the corresponding target delimiter, and each to-be-detected sub-name matches the corresponding target sub-specification, then the branch naming specification of the to-be-detected name is determined.

[0112] In this way, it is convenient to match the delimiter to be detected with the target delimiter, and to match the sub-name to be detected with the target sub-specification, and determine the branch naming specification of the name to be detected.

[0113] In one implementable method, if, in order of sequence, there is at least one delimiter to be detected that does not match the corresponding target delimiter, or there is at least one sub-name to be detected that does not match the corresponding target sub-standard, then it is determined that the branch name of the name to be detected is not standardized, and a non-standard prompt message is generated.

[0114] In this way, it is convenient to match the delimiter to be detected with the target delimiter, and to match the sub-name to be detected with the target sub-specification, and determine that the branch name to be detected is not standardized.

[0115] Furthermore, if the first number is not equal to the second number, it can be determined that the sub-name to be detected does not correspond to the target sub-name specification, and it can be determined that the delimiter to be detected does not correspond to the target delimiter. It can then be determined that the branch name of the name to be detected is not standardized, and the user can be prompted that the length of the name to be detected is incorrect.

[0116] Specifically, the above method can conveniently match the to-be-detected delimiter with the target delimiter, and match the to-be-detected sub-name with the target sub-specification to obtain a matching result.

[0117] Figure 3 This is a schematic diagram of the structure of a branch naming detection device provided in an embodiment of the present application. The device can be in the form of software and / or hardware. Figure 3As shown, a branch naming detection device 300 includes: an acquisition unit 301, a response unit 302 and a detection unit 303.

[0118] An acquisition unit 301 is used to acquire a name to be detected; wherein the name to be detected includes at least one sub-name to be detected; adjacent sub-names to be detected are connected by a separator to be detected;

[0119] A response unit 302 is used to obtain a target naming specification from at least one preset candidate naming specification in response to a specification selection operation of a user; wherein the target naming specification includes at least one target sub-specification, and adjacent target sub-specifications are connected by a target separator;

[0120] A detection unit 303 is used to match the separator to be detected with the target separator, and match the sub-name to be detected with the target sub-specification to obtain a matching result;

[0121] The detection unit 303 is further configured to determine a detection result of the branch name to be detected based on the matching result.

[0122] A detection unit 303 is specifically used to count a first number of target sub-specifications and a second number of sub-names to be detected;

[0123] If the first number is equal to the second number, then each to-be-detected separator is matched with the corresponding target separator in order, and each to-be-detected sub-name is matched with the corresponding target sub-specification to obtain a matching result.

[0124] The detection unit 303 is specifically configured to determine the branch naming specification of the name to be detected if, in order of precedence, each delimiter to be detected matches the corresponding target delimiter, and each sub-name to be detected matches the corresponding target sub-specification.

[0125] The detection unit 303 is specifically used to determine that the branch naming of the name to be detected is not standardized and generate a non-standard prompt information if, in order of sequence, there is at least one delimiter to be detected that does not match the corresponding target delimiter, or there is at least one sub-name to be detected that does not match the corresponding target sub-standard.

[0126] In an achievable manner, the target separator includes at least one of the following: “ / ”, “-”;

[0127] The target sub-specification includes a specification name and description information; the target sub-specification includes at least one of the following:

[0128] The specification name is the work type, and the corresponding description information includes at least one of the following: new features, fixes, and release versions;

[0129] The specification name is the developer, and the corresponding description information is lowercase letters;

[0130] The standard name is the start time, and the corresponding description information is an 8-digit number;

[0131] The standard name is work item, and the corresponding description information is lowercase words connected by "-".

[0132] In one achievable manner, the target naming convention is: work type / developer / start time-work item;

[0133] Among them, " / " is used to connect adjacent target sub-specifications;

[0134] " / " is also used to generate a new folder corresponding to the adjacent right-hand canonical name under the current folder corresponding to the adjacent left-hand canonical name;

[0135] "-" is used to connect adjacent target subspecifications.

[0136] The detection unit 303 is further used to extract the separator to be detected in the name to be detected;

[0137] Extract the sub-name to be detected in the name to be detected based on the separator to be detected.

[0138] The branch naming detection device provided in the embodiment of the present application has the same implementation principle and technical effects as those of the aforementioned branch naming detection method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding contents in the aforementioned branch naming detection method embodiment.

[0139] Figure 4 A hardware structure diagram of an electronic device provided in an embodiment of the present application. This embodiment provides an electronic device, comprising: at least one processor 401, and a memory 402 in communication with the at least one processor 401; the memory 402 stores computer-executable instructions; the processor 401 executes the computer-executable instructions stored in the memory 402, so as to implement the branch naming detection method described in any of the above embodiments.

[0140] Figure 4 The electronic device shown also includes a communication interface 403 and a communication bus 404, wherein the processor 401, the memory 402 and the communication interface 403 are connected to each other via the communication bus 404. The communication bus 404 can be divided into an address bus, a data bus, a control bus, etc. Figure 4 In the figure, only one thick line is used to represent the communication bus 404, but it does not mean that there is only one communication bus 404 or one type of communication bus 404. The processor 401 may also be called a controller, and there is no limitation on the name.

[0141] In the embodiment of the present application, the memory 402 stores instructions that can be executed by at least one processor 401. The at least one processor 401 can execute the branch naming detection method discussed above by executing the instructions stored in the memory 402. The processor 401 can implement Figure 4 The functions of each module in the device shown.

[0142] Among them, the processor 401 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 402 and calling data stored in the memory 402, the various functions of the device and process data, the device can be monitored as a whole.

[0143] In one possible design, the processor 401 may include one or more processing units, and the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 401. In some embodiments, the processor 401 and the memory 402 may be implemented on the same chip or on separate chips.

[0144] Processor 401 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the branch naming detection method disclosed in the embodiments of the present application can be directly embodied as a hardware processor to be executed, or a combination of hardware and software modules in the processor can be executed.

[0145] The memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 402 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 402 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 402 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0146] By designing and programming the processor 401, the code corresponding to the branch naming detection method described in the above embodiment can be fixed into the chip, so that the chip can execute the branch naming detection method when running. Figure 1 or Figure 2 The steps of the branch naming detection method of the embodiment shown are as follows: How to design and program the processor 401 is a technology well known to those skilled in the art and will not be described in detail here.

[0147] The embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by the processor, they are used to implement the branch naming detection method described in any of the above embodiments, so they will not be described in detail here. In addition, the description of the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the computer storage medium embodiment involved in the present invention, please refer to the description of the method embodiment of the present invention.

[0148] In some possible implementations, various aspects of the branch naming detection method provided in the present application can also be implemented in the form of a program product, which includes program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of the branch naming detection method according to various exemplary implementations of the present application described above in this specification.

[0149] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0150] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0151] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0152] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0153] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A branch naming detection method, characterized in that: The method comprises: Obtaining a name to be detected; wherein the name to be detected includes at least one sub-name to be detected; adjacent sub-names to be detected are connected by a separator to be detected; In response to a specification selection operation by a user, a target naming specification is obtained from at least one preset candidate naming specification; wherein the target naming specification includes at least one target sub-specification, and adjacent target sub-specifications are connected by a target separator; Matching the to-be-detected delimiter with the target delimiter, and matching the to-be-detected sub-name with the target sub-specification to obtain a matching result; Based on the matching result, a branch naming detection result of the name to be detected is determined.

2. The method according to claim 1, characterized in that The step of matching the to-be-detected delimiter with the target delimiter and matching the to-be-detected sub-name with the target sub-specification to obtain a matching result includes: Counting a first number of the target sub-specifications and a second number of the sub-names to be detected; If the first number is equal to the second number, then each of the to-be-detected delimiters is matched with the corresponding target delimiters in order of precedence, and each of the to-be-detected sub-names is matched with the corresponding target sub-specifications to obtain a matching result.

3. The method according to claim 2, characterized in that The method further comprises matching each of the to-be-detected delimiters with the corresponding target delimiters in a sequential order, and matching each of the to-be-detected sub-names with the corresponding target sub-specifications to obtain a matching result; Determining a branch naming detection result of the name to be detected based on the matching result includes: If, in order of precedence, each of the to-be-detected delimiters matches the corresponding target delimiters, and each of the to-be-detected sub-names matches the corresponding target sub-specifications, then the branch naming specification of the to-be-detected names is determined.

4. The method according to claim 2, characterized in that: The method further comprises matching each of the to-be-detected delimiters with the corresponding target delimiters in a sequential order, and matching each of the to-be-detected sub-names with the corresponding target sub-specifications to obtain a matching result; Determining a branch naming detection result of the name to be detected based on the matching result includes: If, in order of precedence, at least one of the delimiters to be detected does not match the corresponding target delimiter, or at least one of the sub-names to be detected does not match the corresponding target sub-standard, then it is determined that the branch naming of the name to be detected is not standardized, and a non-standard prompt message is generated.

5. The method according to claim 1, characterized in that The target separator includes at least one of the following: " / ", "-"; The target sub-specification includes a specification name and description information; the target sub-specification includes at least one of the following: The specification name is the work type, and the corresponding description information includes at least one of the following: new features, fixes, and release versions; The specification name is the developer, and the corresponding description information is lowercase letters; The standard name is the start time, and the corresponding description information is an 8-digit number; The standard name is work item, and the corresponding description information is lowercase words connected by "-".

6. The method according to claim 5, characterized in that The target naming convention is: work type / developer / start time-work item; Among them, " / " is used to connect adjacent target sub-specifications; " / " is also used to generate a new folder corresponding to the adjacent right-hand canonical name under the current folder corresponding to the adjacent left-hand canonical name; "-" is used to connect adjacent target subspecifications.

7. The method according to claim 1, characterized in that Before matching the to-be-detected delimiter with the corresponding target delimiter and matching the to-be-detected sub-name with the corresponding target sub-specification to obtain a matching result, the method further includes: Extracting the separator to be detected in the name to be detected; Based on the separator to be detected, the sub-name to be detected in the name to be detected is extracted.

8. A branch naming detection device, characterized in that: The device comprises: An acquisition unit, used for acquiring a name to be detected; wherein the name to be detected includes at least one sub-name to be detected; adjacent sub-names to be detected are connected by a separator to be detected; A response unit, configured to obtain a target naming specification from at least one preset candidate naming specification in response to a specification selection operation by a user; wherein the target naming specification includes at least one target sub-specification, and adjacent target sub-specifications are connected by a target separator; A detection unit, used to match the to-be-detected delimiter with the target delimiter, and to match the to-be-detected sub-name with the target sub-specification to obtain a matching result; The detection unit is further configured to determine a branch naming detection result of the name to be detected based on the matching result.

9. An electronic device, characterized in that: comprising a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the branch naming detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the branch naming detection method according to any one of claims 1 to 7 is implemented.