Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maintaining a changelog.txt file in a DVCS

I'm working on a git project that uses lots of branches. For the most part, this has been a really great workflow. I'm happy merging between branches, love being able to cherry-pick code, and the overall lifecycle that comes with git and other dvcs's.

I've got one pain point that is really hurting. How to maintain a changelog.txt.

I've found it hurts whenever I do a merge (the changelog.txt often conflicts), and when cherry-picking commits I've accidentally managed to pickup changes that really weren't desired.

I'd love to see a good answer to this problem.

like image 262
Rob Dawson Avatar asked Mar 01 '11 05:03

Rob Dawson


1 Answers

You could annotate your checkin comments and parse these comments once you're ready to ship a new version of your software (I guess that's the most common use case for providing a changelog).

The comments could be built the following way (obviously only those belonging to commits that do modify something noteworthy):

WHAT WHERE DESCRIPTION

Where WHAT could be

  • FIX for bug fixes
  • CHG for changes
  • NEW for new code

WHERE should be one word describing the module where WHAT was done. Following these two informations, you provide your DESCRIPTION describing the modification in deep.

Once you're ready to ship, get the logs since the last version and parse them. The logs can be obtained using git log tagname_of_last_version... See the man page of git log for output and filtering options.

like image 65
eckes Avatar answered Oct 15 '22 05:10

eckes