In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article focuses on "how to write Commit records". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to write Commit records.
Install the plug-in
In IDEA's Marketplace, search Git Commit Template and you can install the plug-in. The plug-in is very small and can be downloaded soon.
When you normally submit code from IDEA. We found an extra small button.
After clicking, a window will pop up. Let you design the submission template.
So much information really makes people dizzy. No wonder programmers don't like to write submission records.
In fact, the format of this submission record is already explained in the plug-in installation interface.
():
From the description, you can easily see what should be included in a submission record. The type that has the most types is, of course, the submission type.
Submission type Type
Let's explain it in the order in which the plug-ins are displayed.
The meaning of the feat function feature is also the most commonly used. When your function changes, you can use this type of type.
Fix of course refers to bug repair.
Docs updated the documentation or updated the comments
Style code format adjustment, such as performing format, changing tab display, etc.
Refactor refactoring code. Refers to the adjustment of the structure of the code, such as reorganizing the code using some design patterns
Perf optimizes the performance of the project or module. For example, change some parameters of jvm, change stringbuffer to stringbuilder, etc.
The simplicity of test is to add code related to unit testing and automation.
Build affects some changes in compilation, such as changing the maven plug-in, adding the npm process, and so on.
Changes in continuous integration of ci. Now some build systems like to use yml to describe ci functions. If there is such a change, it is recommended to use ci
Chore other changes. For example, some comment changes or file cleanup. If the src and test code files are not affected, you can put them here.
Revert rolled back some of the previous code
In addition to these presets, teams can also add new type according to their own needs. For example, if you specialize in processing online work orders, you can create a type called ticket.
Range scope
Scope means scope, which mainly refers to the influence side of the code. Scope does not require enforcement, but the team can design according to their own understanding. It is usually divided into two ways: technical dimension and business dimension. For example, according to the technology is divided into: controller, dto, service, dao and so on. However, because multiple scope are involved in a feature submission (none of them like very fine-grained submissions), it is rare to divide them according to the technical dimension.
It is also a good choice to divide it according to the business module. For example, divided into user, order and so on, it is easy to see whether it affects the user module or the order module.
If you really don't know how to fill it out, leave it blank.
Other
Topic subject
This reflects the ability to summarize and generalize, so there is no need to run. One sentence can explain what the main submission is. Subject is also the default line displayed by many git management tools. If you write the standard, then the submission record looks beautiful and organized.
Body Body
Mainly fill in the detailed change record. I am used to listing 1234, but if your subject is very good, the text can be weakened directly. But if there is plenty of time, it is a good habit to fill in the causes and consequences of important records and the background of the demand.
Tail Footer
Add some additional hook, such as automatically closing the work order of jira after submitting the record (JIRA and gitlab can be linked). For example, trigger some document compilation or other actions.
This part of the custom line is also relatively strong.
Skip CI
Finally, there is a skip CI option. General ci tools can be set to automatically trigger compilation when code is submitted. But you can tell it to ignore this submission. This may be because you anticipate some build risks in advance, or you just don't want to compile.
End
Finally, looking at a typical submission record, with the support of the tools, our nonsense is taken seriously.
Fix (order): fixed bug business feedback that can buy a car for 1 penny. It has sold 100w Closes # 2455 [skip ci]
In fact, the core of the submission is type and subject. One is used to indicate its submission type, and the other is used to summarize the submission. Once these two points are written, 80% of programmers can be easily killed.
With these basics, it becomes very easy to generate change log automatically from commit log. It is also feasible to automatically generate release change records in conjunction with the continuous integration platform, which is why team management has always emphasized the submission specification of git. Because it's really useful.
At this point, I believe you have a deeper understanding of "how to write Commit records". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.