Signed-off-by: Koosha Khajehmoogahi <koosha@xxxxxxxxx> --- t/t4202-log.sh | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 5f2b290..ab6f371 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -428,6 +428,147 @@ cat > expect <<\EOF * initial EOF +cat > only_merges <<EOF +Merge tag 'reach' +Merge tags 'octopus-a' and 'octopus-b' +Merge branch 'tangle' +Merge branch 'side' (early part) into tangle +Merge branch 'master' (early part) into tangle +Merge branch 'side' +EOF + +cat > only_commits <<EOF +seventh +octopus-b +octopus-a +reach +tangle-a +side-2 +side-1 +Second +sixth +fifth +fourth +third +second +initial +EOF + +cat > both_commits_merges <<EOF +Merge tag 'reach' +Merge tags 'octopus-a' and 'octopus-b' +seventh +octopus-b +octopus-a +reach +Merge branch 'tangle' +Merge branch 'side' (early part) into tangle +Merge branch 'master' (early part) into tangle +tangle-a +Merge branch 'side' +side-2 +side-1 +Second +sixth +fifth +fourth +third +second +initial +EOF + +test_expect_success 'log with config log.merges=show' ' + git config log.merges show && + git log --pretty=tformat:%s >actual && + test_cmp both_commits_merges actual && + git config --unset log.merges +' + +test_expect_success 'log with config log.merges=only' ' + git config log.merges only && + git log --pretty=tformat:%s >actual && + test_cmp only_merges actual && + git config --unset log.merges +' + +test_expect_success 'log with config log.merges=hide' ' + git config log.merges hide && + git log --pretty=tformat:%s >actual && + test_cmp only_commits actual && + git config --unset log.merges +' + +test_expect_success 'log with config log.merges=show with git log --no-merges' ' + git config log.merges show && + git log --no-merges --pretty=tformat:%s >actual && + test_cmp only_commits actual && + git config --unset log.merges +' + +test_expect_success 'log with config log.merges=hide with git log ---merges' ' + git config log.merges hide && + git log --merges --pretty=tformat:%s >actual && + test_cmp only_merges actual && + git config --unset log.merges +' + +test_expect_success 'log --merges=show' ' + git log --merges=show --pretty=tformat:%s >actual && + test_cmp both_commits_merges actual +' + +test_expect_success 'log --merges=only' ' + git log --merges=only --pretty=tformat:%s >actual && + test_cmp only_merges actual +' + +test_expect_success 'log --merges=hide' ' + git log --merges=hide --pretty=tformat:%s >actual && + test_cmp only_commits actual +' + +test_expect_success 'log --merges=show with config log.merges=hide' ' + git config log.merges hide && + git log --merges=show --pretty=tformat:%s >actual && + test_cmp both_commits_merges actual && + git config --unset log.merges +' + +test_expect_success 'log --merges=show with config log.merges=only' ' + git config log.merges only && + git log --merges=show --pretty=tformat:%s >actual && + test_cmp both_commits_merges actual && + git config --unset log.merges +' + +test_expect_success 'log --merges=only with config log.merges=show' ' + git config log.merges show && + git log --merges=only --pretty=tformat:%s >actual && + test_cmp only_merges actual && + git config --unset log.merges +' + +test_expect_success 'log --merges=only with config log.merges=hide' ' + git config log.merges hide && + git log --merges=only --pretty=tformat:%s >actual && + test_cmp only_merges actual && + git config --unset log.merges +' + +test_expect_success 'log --merges=hide with config log.merges=show' ' + git config log.merges show && + git log --merges=hide --pretty=tformat:%s >actual && + test_cmp only_commits actual && + git config --unset log.merges +' + +test_expect_success 'log --merges=hide with config log.merges=only' ' + git config log.merges only && + git log --merges=hide --pretty=tformat:%s >actual && + test_cmp only_commits actual && + git config --unset log.merges +' + test_expect_success 'log --graph with merge' ' git log --graph --date-order --pretty=tformat:%s | sed "s/ *\$//" >actual && -- 2.3.3.263.g095251d.dirty -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html