Are there any commit policies?

My boss yesterday announced new rules for fixing checks in the repository. This policy is valid for fixation in the head / trunk and branches.
A commit message must have the following elements:

  • Reason (error identifier, project identifier, or functional changes)
  • Reviewer Name

After committing, we must also create a blog entry for changes to our CMS.

I am not a big fan of this commit policy because I usually don’t need a reviewer when I make new or experimental material in an unproductive branch.

Do you have any commit policies that you should follow?

I think it is a good idea to change the production branch just because of a bug report, but commit in development branches should be less restrictive.

+6
version-control policy
source share
7 answers

Commit in advance and commit frequently.

In fact, we use / trunk for development and tags for forking different releases. Only structural intrusive changes are included in / branches.

We actively use tags for production and acceptance releases, so we can easily return in time. Everything that was done on the trunk should only have a message describing that the commit was changed or added briefly.

I am not a big fan of using the message space to communicate with the Bug ID, it still requires searching for the identifier, in which case you can also find it in the bug tracking software and close it there, which is about the same effort to me.

Not to say that I don’t like any svn integration: - We use more automatic nant scripts to create releases that deploy them to / tags - svn props actually stores our version numbers: p. - hook scripts for email notification and message logging (great for copying pasted notes).

+2
source share

We have a number of policies that are applied through the built-in plug-in for Visual Studio. We verify that code compilation and these unit tests succeed. At the moment, we also check the coverage of the code and issue warnings for code that does not have enough tests. We also perform various consistency checks and verify that the corresponding task is present in our change management system to ensure that all changes are traceable.

The advantage of supporting tools is great, because in fact people do not respect policies, but obviously there is a drawback, and these checks take time to start. However, with many developers it is difficult to enforce standards without proper tool support.

+2
source share

The reviewer seems pointless for the reasons you mentioned, because not everything needs to be viewed by others.

In the past, the only commit policy we had (where I worked) was to include a comment indicating that you changed and why, but this is more common sense than anything else.

+1
source share

A general commit policy is to associate an error identifier with a chest commit as an excuse. Version control and bug tracking systems are sometimes configured to enforce this policy.

+1
source share

Our commit policy is a bit like yours, only we don’t apply it on task branches (where the task branch looks like a developer sandbox for experiments).

Our comments on comments should include either a change management identifier (new feature, extension) or a problem identifier (bug fix). You should also include a brief explanation of why you made this change; version control keeps track of who, what, when, and where.

+1
source share

My error message includes a brief description of what I implemented or changed in classes.

The error number and additional descriptions that I put in the comments above the new code. The identifiers inside the commit messages that we put when we merge the changes into the marked branch.

Auto-assembly checks various functions and products every night, also make sure the code base is stable.

But in the end, I think that you cannot have too many descriptions for new or changed classes, but too many policies that you must follow before committing. The name of the reviewer is something that I would not put in a commit message.

Think about the fact that you sometimes have to give up the code that you implemented 2 years ago. And then you are happy with the commit messages, which are not like "Update after debugging".

0
source share

We have branches for each released major version of the software, which is still actively supported. To check in any of these branches, an error identifier is required - this is done by scmbug , which not only verifies that the comment is a prefix of the error identifier, but also searches for this error in the error database, makes sure that it is assigned to the committer and, possibly, checks other criteria (for example, that the "Commit to branches" field is the branch that is assigned).

One of the products has more potential to compromise the way, and for verification, this requires not only an error identifier, but also code verification. However, the code verification criteria are processed in our error database - we have custom fields for this, and the error cannot be accepted and closed until it is considered. For me, this works from a conceptual level - it might be better to check the code that is believed to work in the repository, not considered, and then reopen the error and change it if necessary, and not postpone the fix until you You will be sure it is ready for release.

Other than that, there is no explicit policy for the trunk (although, of course, the general principles of verification often do not interrupt the assembly, including good descriptive commit messages, while still checking in units of work).

0
source share

All Articles