git vs ChangeLog

Thomas Schwinge thomas@codesourcery.com
Sat Nov 3 13:46:00 GMT 2012


Hi!

On Thu, 26 Jul 2012 14:57:41 -0700 (PDT), Roland McGrath <roland@hack.frob.com> wrote:
> Mark Wielaard has a handy blog entry describing how to use gnulib's
> git-merge-changelog tool to make 'git rebase' and 'git merge' far
> less annoying when dealing with ChangeLog files:
> 
> http://gnu.wildebeest.org/blog/mjw/2012/03/16/automagically-merging-changelog-files-with-mercurial-or-git/

As Petr Baudis noted, a similar write-up is already present at
<http://sourceware.org/glibc/wiki/GlibcGit#ChangeLogs>.  I now added a
link to Mark's.


> Also, I personally use the two attached scripts so that 'git show-gnu'
> is the handy way to produce the standard format for posting a patch
> once you've done a git commit on a local branch.

I added a link to
<http://sourceware.org/glibc/wiki/Contribution%20checklist#Properly_Formatted_GNU_ChangeLog>.


I use the following patch to make this work for »git config --global
diff.noprefix true« (which removes the »a/«, »b/« prefixes that Git uses
when showing diffs, and which I have no idea what they might be useful
for, apart from making copy'n'paste of such filenames more difficult).

diff --git command/git-show-gnu command/git-show-gnu
index bc8982e..dcbbd18 100755
--- command/git-show-gnu
+++ command/git-show-gnu
@@ -2,8 +2,8 @@
 
 git show -b ${1+"$@"} | extract-changelog-from-diff
 git show --pretty=format: ${1+"$@"} |
-filterdiff --exclude='*/ChangeLog*' |
-sed '/^diff --git.*\/ChangeLog.*/{
+filterdiff --exclude='ChangeLog*' --exclude='*/ChangeLog*' |
+sed '/^diff --git.*[/ ]ChangeLog.*/{
 N
 d
 }'

Also, there is an additional blank line between the ChangeLog block and
the diff.

And, one could think about using »filterdiff --clean« instead of the sed
invocation.


Grüße,
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20121103/4d052606/attachment.sig>


More information about the Libc-alpha mailing list