mc/maint/ldiff
Slava Zanko abcd23406d remove ChangeLog files from mc tree
Description by Sergei Trofimovich:

GNU ChangeLog? files are result of CVS stupidpity about changeset tracking.
Currently constantly updated ChangeLogs? diverge in different branches and cause collisions(!)
when 'git merge' (almost ANY SINGLE MERGE!).

Major changes can be described in NEWS file, minor changes can be autogenerated via 'git log'/'git shortlog'
and friends (if needed at all).
2009-05-27 14:53:23 +03:00

23 lines
773 B
Bash
Executable File

#! /bin/sh
# This script makes pretty looking patches provided that the old files
# are kept around with the .v0 suffix.
: ${backup_suffix=${1:-"\.v0"}}
backup_files=`find . -path "*$backup_suffix" -type f | sort -u`
for oldfile in $backup_files; do
newfile=`echo $oldfile | sed 's,^\./,,;s/'$backup_suffix'$//'`
oldlabel="$oldprefix$newfile"
newlabel="$newprefix$newfile"
find "$oldfile" ! -size 0 | grep . >/dev/null || \
{ oldfile="/dev/null"; oldlabel="/dev/null"; }
find "$newfile" ! -size 0 | grep . >/dev/null || \
{ newfile="/dev/null"; newlabel="/dev/null"; }
case $newfile in
*.c) dflags="-u -p" ;;
*.po) dflags='-U 1 -I^#[:,.~]';;
*) dflags="-u" ;;
esac
diff $dflags -L "$oldlabel" -L "$newlabel" "$oldfile" "$newfile"
done