What git tag names and description should I give when implementing a feature on a big application repo?

1.1k views Asked by At

Take the example of branches and commit messages related to my question:

  • When I work on a feature, I name my branch feat/featureName
  • When I want to test something, I checkout my junk/nameOfTest branch
  • When I commit, I apply 7 rules of a great commit message

All these being said, is there a pattern I could follow to write good git tag names and descriptions in a huge repo where everyone works on his own feature?

E.g. if I work on a "user groups" feature, after 10 commits where I created the basic CRUD, should I tag it with v0.1-alpha-groups and in description I should list all controls available by now?

Please give me some examples of good git tag naming and description best-practices.

1

There are 1 answers

0
VonC On BEST ANSWER

You can consider using semver2 (Semantic Versioning) for the tag naming convention.

After that, you can check out "Command-line tips for effective release announcements", which have some good tips, including the release notes production:

If your release isn't large, your release notes could include a summary of the contained commits; this is useful for minor point releases. You can use git shortlog to do this:

$ git shortlog 0.5..0.6 --no-merges
David Winterbottom (661):
      Add defaults to the counts on the product summary dashboard page
      Tidy up urls.py and settings.py
      Use mirrors when pip installing the demo site
      Install django-oscar-stores
      Add link to stores page in footer
...

You can even use --format to provide links to Github commits:

$ git shortlog 0.3.4..0.4 --no-merges --format="%s (https://github.com/tangentlabs/django-oscar-stores/commit/%h)"

This won't always be appropriate if your release if there are thousands of commits.

You have a similar approach in "Very Easy Changelogs with Git":

git log 1.0.0...1.1.0 --pretty=format:'<li> %s &mdash; %cn &bull; <a href="http://github.com/<username>/<repo>commit/%H" target="_blank">%h</a></li>' | grep -v Merge > changelog.html