This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ChangeLog management tip


I spent a good chunk of today figuring out how I would manage ChangeLog
files in the new all-git world.  For me this underscores how we ought to
just get rid of them; but I realize from previous discussions that this
probably won't happen, so I tried to get along.

My main goal is to preserve two nice features of git: "git send-email"
and "git merge"; while also following the gdb rules about having the
ChangeLog entry in the commit message and about not sending the
ChangeLog entry as part of the patch.

What I came up with is reasonably ugly, but at least it satisfies the
above.


First, follow the instructions for installing git-merge-changelog:

    http://gnu.wildebeest.org/blog/mjw/2012/03/16/automagically-merging-changelog-files-with-mercurial-or-git/

This will let you do step 1, which is to always write ChangeLog entries
in the correct files in the source tree.


Next, put the prepare-commit-msg script, attached, into your .git/hooks.
This script will update your commit message with the contents of any
ChangeLog files you have edited.

Normally it does the right thing.  However of course you ought to
double-check it.

The idea here is that gdb rules require double-transcription of the
ChangeLog entries.  My approach makes the files the canonical source,
and the commit message derived from those.

This adds a little line saying "~ChangeLog~" to the commit message.
I trust nobody will care.


Then, add this to your .git/config:

[diff "changelog"]
	command = /bin/true

This defines an external diff command that we'll use when sending email.

To do this, put the attached git-gdb-email script into your PATH
somewhere.

Then, instead of "git send-email", use "git gdb-email".
This will arrange for ChangeLog diffs to be dropped from your patch.


I think the only thing that remains is having a nice way to update the
dates at the top of ChangeLog entries.  I may write a wrapper for git
filter-branch that knows how to do this.

Tom

Attachment: prepare-commit-msg
Description: prepare-commit-msg

Attachment: git-gdb-email
Description: git-gdb-email


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]