diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-08-12 17:27:28 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-12 17:27:28 -0700 |
commit | 5b2eeed1ba36caf71341c1557f2054681c353a14 (patch) | |
tree | 716016eb1036804ea67163ac299c35ad8abedb7d /t | |
parent | a0e46390d397e71182e42930b98b6b59a1a84898 (diff) | |
parent | 65347030590bcc251a9ff2ed96487a0f1b9e9fa8 (diff) | |
download | git-5b2eeed1ba36caf71341c1557f2054681c353a14.tar.gz git-5b2eeed1ba36caf71341c1557f2054681c353a14.tar.xz |
Merge branch 'jc/post-simplify' into tr/filter-branch
* jc/post-simplify:
Topo-sort before --simplify-merges
revision traversal: show full history with merge simplification
revision.c: whitespace fix
Diffstat (limited to 't')
-rwxr-xr-x | t/t6012-rev-list-simplify.sh | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh new file mode 100755 index 000000000..510bb9679 --- /dev/null +++ b/t/t6012-rev-list-simplify.sh @@ -0,0 +1,93 @@ +#!/bin/sh + +test_description='merge simplification' + +. ./test-lib.sh + +note () { + git tag "$1" +} + +_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' +_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" + +unnote () { + git name-rev --tags --stdin | sed -e "s|$_x40 (tags/\([^)]*\)) |\1 |g" +} + +test_expect_success setup ' + echo "Hi there" >file && + git add file && + test_tick && git commit -m "Initial file" && + note A && + + git branch other-branch && + + echo "Hello" >file && + git add file && + test_tick && git commit -m "Modified file" && + note B && + + git checkout other-branch && + + echo "Hello" >file && + git add file && + test_tick && git commit -m "Modified the file identically" && + note C && + + echo "This is a stupid example" >another-file && + git add another-file && + test_tick && git commit -m "Add another file" && + note D && + + test_tick && git merge -m "merge" master && + note E && + + echo "Yet another" >elif && + git add elif && + test_tick && git commit -m "Irrelevant change" && + note F && + + git checkout master && + echo "Yet another" >elif && + git add elif && + test_tick && git commit -m "Another irrelevant change" && + note G && + + test_tick && git merge -m "merge" other-branch && + note H && + + echo "Final change" >file && + test_tick && git commit -a -m "Final change" && + note I +' + +FMT='tformat:%P %H | %s' + +check_result () { + for c in $1 + do + echo "$c" + done >expect && + shift && + param="$*" && + test_expect_success "log $param" ' + git log --pretty="$FMT" --parents $param | + unnote >actual && + sed -e "s/^.* \([^ ]*\) .*/\1/" >check <actual && + test_cmp expect check || { + cat actual + false + } + ' +} + +check_result 'I H G F E D C B A' --full-history +check_result 'I H E C B A' --full-history -- file +check_result 'I H E C B A' --full-history --topo-order -- file +check_result 'I H E C B A' --full-history --date-order -- file +check_result 'I E C B A' --simplify-merges -- file +check_result 'I B A' -- file +check_result 'I B A' --topo-order -- file + +test_done |