summaryrefslogtreecommitdiff
path: root/t/t3415-rebase-autosquash.sh
diff options
context:
space:
mode:
authorMichael Rappazzo <rappazzo@gmail.com>2015-06-13 16:26:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-15 18:42:58 (GMT)
commit16cf51c7a2e82f27577bb1bdcdc013c34815803e (patch)
tree3401b5762913fc10a6297ec6ca4511f7df4e12b0 /t/t3415-rebase-autosquash.sh
parent7974889a053574e449b55ca543a486e38e74864f (diff)
downloadgit-16cf51c7a2e82f27577bb1bdcdc013c34815803e.zip
git-16cf51c7a2e82f27577bb1bdcdc013c34815803e.tar.gz
git-16cf51c7a2e82f27577bb1bdcdc013c34815803e.tar.bz2
git-rebase--interactive.sh: add config option for custom instruction format
A config option 'rebase.instructionFormat' can override the default 'oneline' format of the rebase instruction list. Since the list is parsed using the left, right or boundary mark plus the sha1, they are prepended to the instruction format. Signed-off-by: Michael Rappazzo <rappazzo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3415-rebase-autosquash.sh')
-rwxr-xr-xt/t3415-rebase-autosquash.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
index 41370ab..8f53e54 100755
--- a/t/t3415-rebase-autosquash.sh
+++ b/t/t3415-rebase-autosquash.sh
@@ -250,4 +250,25 @@ test_expect_success 'squash! fixup!' '
test_auto_fixup_fixup squash fixup
'
+test_expect_success 'autosquash with custom inst format' '
+ git reset --hard base &&
+ git config --add rebase.instructionFormat "[%an @ %ar] %s" &&
+ echo 2 >file1 &&
+ git add -u &&
+ test_tick &&
+ git commit -m "squash! $(git rev-parse --short HEAD^)" &&
+ echo 1 >file1 &&
+ git add -u &&
+ test_tick &&
+ git commit -m "squash! $(git log -n 1 --format=%s HEAD~2)" &&
+ git tag final-squash-instFmt &&
+ test_tick &&
+ git rebase --autosquash -i HEAD~4 &&
+ git log --oneline >actual &&
+ test_line_count = 3 actual &&
+ git diff --exit-code final-squash-instFmt &&
+ test 1 = "$(git cat-file blob HEAD^:file1)" &&
+ test 2 = $(git cat-file commit HEAD^ | grep squash | wc -l)
+'
+
test_done