This is the mail archive of the mailing list for the glibc 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]

git vs ChangeLog

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:

There are surely other such write-ups around, but this is the first
one I found today (and I don't recall at all where I got the info
for doing it myself many moons ago).  Someone with more round tuits
(and/or tolerance for wiki-writing) than I have should put the
details on the glibc wiki, refined to just what matters for our git
repository.  Note that you want not just a "ChangeLog" pattern but
also a "*/ChangeLog*" to catch nptl/ChangeLog, ports/, etc.

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.



# Script to process e.g. monotone diff output into ChangeLog fragments.

awk '
$1 == "+++" { file = $2; firsthunk = 0; next }
file !~ /\/?ChangeLog.*/ { next }

$1 == "@@" {
  firsthunk = !firsthunk;
  if (firsthunk) {
    dir = file;
    sub(/^[ab](\/|$)/, "", dir);
    if (dir ~ /\/?ChangeLog$/) sub(/\/?ChangeLog$/, "/", dir);
    if (dir != "" && dir != "/") print dir;
  else error;
  in_context = 0;

!firsthunk { error }
/^[^+]/ { in_context = 1; next }

in_context { error }

{ sub(/^\+/, ""); print; }
' ${1+"$@"}

git show -b ${1+"$@"} | extract-changelog-from-diff
git show --pretty=format: ${1+"$@"} |
filterdiff --exclude='*/ChangeLog*' |
sed '/^diff --git.*\/ChangeLog.*/{

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