From: Ian Jackson Date: Wed, 30 Apr 2014 17:34:39 +0000 (+0100) Subject: Merge remote-tracking branch 'mdw/mdw/convert-script' X-Git-Tag: cvs-to-git-conversion^2~2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=adns.git;a=commitdiff_plain;h=194b32e42f9d2a9555b920defef6fffae792e008;hp=ceaf70dbd1b58bb51a65f905b845505e00b54037 Merge remote-tracking branch 'mdw/mdw/convert-script' "iwj's original" 8298cc36e3a7eef91f722e7115ea8b5a9366fb55 is actually identical to 8e04e8e83b27a61d1471c81de5f8aabe29dda30a apart from the .gitignore Conflicts: convert --- diff --git a/convert b/convert index 60b1998..78d4ac3 100755 --- a/convert +++ b/convert @@ -43,7 +43,7 @@ graftmergein () { local branchname=branch-$desc mkdir -p .git/info local branchtip=`git rev-parse $branchname~0` - local oldparents=`git-log -n1 --pretty=format:%P $mergecommit` + local oldparents=`git log -n1 --pretty=format:%P $mergecommit` cat <>.git/info/grafts $2 $oldparents $branchtip END @@ -92,8 +92,19 @@ cat >$tmp/msg-filter <<'FEND' perl -ne ' $out .= $_; END { + if ($out =~ /\*\*\* empty log message/) { + ($out = `git diff $ENV{GIT_COMMIT}^ $ENV{GIT_COMMIT} -- changelog`) + =~ s/\A.*\n\@\@ /\@\@ /s; + } + if ($out !~ /\n.*\n/) { + $out = `fmt <<'\''EOF'\'' +$out +EOF +`; + } if ($out =~ m/^\@\@/s && - $out =~ m/^(?:\+ )?[^\@ ].*\w.*$/m) { + ($out =~ m/^\+(?!u?adns).*\w.*$/m || + $out =~ m/^\-(?!u?adns).*\w.*$/m)) { print $&, "\n\n" or die $!; } print $out or die $!; @@ -102,11 +113,11 @@ perl -ne ' FEND chmod +x $tmp/msg-filter -git-filter-branch --msg-filter $tmp/msg-filter \ - `git-show-ref | awk '{print $2}'` +git filter-branch --msg-filter $tmp/msg-filter \ + `git show-ref | awk '{print $2}'` -git-show-ref | awk '{print $2}' | grep '^refs/original/' \ - | xargs -n1 git-update-ref -d +git show-ref | awk '{print $2}' | grep '^refs/original/' \ + | xargs -n1 git update-ref -d rm -rf $tmp/converted mkdir $tmp/converted