]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
Add tool to reverse order parents in commit produced by pull
authorKacper Kornet <draenog@pld-linux.org>
Thu, 11 Apr 2013 17:00:47 +0000 (18:00 +0100)
committerKacper Kornet <draenog@pld-linux.org>
Thu, 11 Apr 2013 18:07:29 +0000 (19:07 +0100)
Merges produced by git pull from upstream repository results
in history with "wrong" first-parent ancestry. Tool fixmerge.sh
fixes such a commit. It also modifies the commit message to reflect
what was really merged where.

fixmerge.sh [new file with mode: 0755]

diff --git a/fixmerge.sh b/fixmerge.sh
new file mode 100755 (executable)
index 0000000..90ef7a2
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Changes the order of parents and commitlog in the merge produced by git pull. It produces
+# the nicer history with git log --first-parent
+
+git filter-branch -f --parent-filter "tee ~/P.OUT | awk '{if(NF==4) print \$1,\$4,\$3,\$2;}'| tee -a ~/P.OUT" \
+    --msg-filter "sed 's/\(Merge branch .*\) of/\1 into/'" HEAD^!
This page took 0.47635 seconds and 4 git commands to generate.