This is the mail archive of the libc-alpha@sourceware.org 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]

Re: [PATCH] Add --print-dirs option for ldconfig


> I see. I'd noticed Dave had done that and it does seem better to not
> have the ChangeLog be part of the diff since it's easy to conflict. Is
> there a tool you guys use to generate the ChangeLog entry for the
> patch text and/or merge the entry into the actual ChangeLog when
> applying patches?

I have the following script (~/bin/extract-changelog-from-diff).

Sometimes I run:
	git show | extract-changelog-from-diff; git show | filterdiff --exclude='*/ChangeLog'

#!/bin/sh

# 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(/\/?ChangeLog$/, "", dir);
    if (dir != "") print "\n" dir "/";
  }
  else error;
  in_context = 0;
  next;
}

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

in_context { error }

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


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