lib-rebase: Provide clearer debugging info about what the editor did
(For testing "rebase -i"): Output the "rebase -i" command script before and after the edits, to make it clearer what the editor did. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Jan 12, 2010 at 16:38 UTC
f64b4856243a9ea9445068a0989c71a8915c3862
1 file changed
+3
-2
t/lib-rebase.sh
+3
-2
@@ -29,6 +29,7 @@ test -z "$EXPECT_COUNT" ||
29
test -z "$FAKE_LINES" && exit
30
grep -v '^#' < "$1" > "$1".tmp
31
rm -f "$1"
32
+echo 'rebase -i script before editing:'
33
cat "$1".tmp
34
action=pick
35
for line in $FAKE_LINES; do
@@ -36,12 +37,12 @@ for line in $FAKE_LINES; do
37
squash|fixup|edit|reword)
38
action="$line";;
39
*)
39
- echo sed -n "${line}s/^pick/$action/p"
40
- sed -n "${line}p" < "$1".tmp
40
sed -n "${line}s/^pick/$action/p" < "$1".tmp >> "$1"
41
action=pick;;
42
esac
43
done
44
+echo 'rebase -i script after editing:'
45
+cat "$1"
46
EOF
47
48
test_set_editor "$(pwd)/fake-editor.sh"