From d8abe148bece83f6c3e5ebe6075aef236322ed74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Sun, 6 Apr 2008 03:23:43 +0200 Subject: merge, pull: introduce '--(no-)stat' option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This option has the same effect as '--(no-)summary' (i.e. whether to show a diffsat at the end of the merge or not), and it is consistent with the '--stat' option of other git commands. Documentation, tests, and bash completion are updaed accordingly, and the old --summary option is marked as being deprected. Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- t/t7600-merge.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 't') diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh index 56869acee..dd3eb9736 100755 --- a/t/t7600-merge.sh +++ b/t/t7600-merge.sh @@ -364,7 +364,7 @@ test_expect_success 'merge c1 with c2 (squash in config)' ' test_debug 'gitk --all' -test_expect_success 'override config option -n' ' +test_expect_success 'override config option -n with --summary' ' git reset --hard c1 && git config branch.master.mergeoptions "-n" && test_tick && @@ -373,15 +373,30 @@ test_expect_success 'override config option -n' ' verify_parents $c1 $c2 && if ! grep "^ file | *2 +-$" diffstat.txt then - echo "[OOPS] diffstat was not generated" + echo "[OOPS] diffstat was not generated with --summary" + false + fi +' + +test_expect_success 'override config option -n with --stat' ' + git reset --hard c1 && + git config branch.master.mergeoptions "-n" && + test_tick && + git merge --stat c2 >diffstat.txt && + verify_merge file result.1-5 msg.1-5 && + verify_parents $c1 $c2 && + if ! grep "^ file | *2 +-$" diffstat.txt + then + echo "[OOPS] diffstat was not generated with --stat" + false fi ' test_debug 'gitk --all' -test_expect_success 'override config option --summary' ' +test_expect_success 'override config option --stat' ' git reset --hard c1 && - git config branch.master.mergeoptions "--summary" && + git config branch.master.mergeoptions "--stat" && test_tick && git merge -n c2 >diffstat.txt && verify_merge file result.1-5 msg.1-5 && -- cgit v1.2.1 From 6cd9cfefc505ed5ab5ff435ff9ef338ac8721225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Sun, 6 Apr 2008 03:23:45 +0200 Subject: fmt-merge-msg: add '--(no-)log' options and 'merge.log' config variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are new synonyms to the '--(no-)summary' option and the 'merge.summary' config variable, but are consistent with the soon to be added 'merge --(no-)log' options. The 'merge.summary' config variable and '--(no-)summary' options are still accepted, but are advertised to be removed in the future. 'merge.log' takes precedence over 'merge.summary' if they are both set inconsistently. Update documentation and tests accordingly. Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- t/t6200-fmt-merge-msg.sh | 54 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 3 deletions(-) (limited to 't') diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh index 526d7d1c4..bd4e49bf1 100755 --- a/t/t6200-fmt-merge-msg.sh +++ b/t/t6200-fmt-merge-msg.sh @@ -106,8 +106,24 @@ Merge branch 'left' Common #1 EOF -test_expect_success 'merge-msg test #3' ' +test_expect_success 'merge-msg test #3-1' ' + git config --unset-all merge.log + git config --unset-all merge.summary + git config merge.log true && + + git checkout master && + setdate && + git fetch . left && + + git fmt-merge-msg <.git/FETCH_HEAD >actual && + git diff actual expected +' + +test_expect_success 'merge-msg test #3-2' ' + + git config --unset-all merge.log + git config --unset-all merge.summary git config merge.summary true && git checkout master && @@ -136,8 +152,24 @@ Merge branches 'left' and 'right' Common #1 EOF -test_expect_success 'merge-msg test #4' ' +test_expect_success 'merge-msg test #4-1' ' + + git config --unset-all merge.log + git config --unset-all merge.summary + git config merge.log true && + + git checkout master && + setdate && + git fetch . left right && + + git fmt-merge-msg <.git/FETCH_HEAD >actual && + git diff actual expected +' + +test_expect_success 'merge-msg test #4-2' ' + git config --unset-all merge.log + git config --unset-all merge.summary git config merge.summary true && git checkout master && @@ -148,8 +180,24 @@ test_expect_success 'merge-msg test #4' ' git diff actual expected ' -test_expect_success 'merge-msg test #5' ' +test_expect_success 'merge-msg test #5-1' ' + + git config --unset-all merge.log + git config --unset-all merge.summary + git config merge.log yes && + + git checkout master && + setdate && + git fetch . left right && + + git fmt-merge-msg <.git/FETCH_HEAD >actual && + git diff actual expected +' + +test_expect_success 'merge-msg test #5-2' ' + git config --unset-all merge.log + git config --unset-all merge.summary git config merge.summary yes && git checkout master && -- cgit v1.2.1 From efb779f8873e5aa36be29a4e551186c62c1b580c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Sun, 6 Apr 2008 03:23:46 +0200 Subject: merge, pull: add '--(no-)log' command line option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are the command line option equivalents of the 'merge.log' config variable. The patch also updates documentation and bash completion accordingly, and adds a test. Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- t/t7600-merge.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh index dd3eb9736..d21cd290d 100755 --- a/t/t7600-merge.sh +++ b/t/t7600-merge.sh @@ -104,7 +104,11 @@ create_merge_msgs() { git log --no-merges ^HEAD c2 >>squash.1-5 && echo "Squashed commit of the following:" >squash.1-5-9 && echo >>squash.1-5-9 && - git log --no-merges ^HEAD c2 c3 >>squash.1-5-9 + git log --no-merges ^HEAD c2 c3 >>squash.1-5-9 && + echo > msg.nolog && + echo "* commit 'c3':" >msg.log && + echo " commit 3" >>msg.log && + echo >>msg.log } verify_diff() { @@ -456,6 +460,16 @@ test_expect_success 'merge c0 with c1 (ff overrides no-ff)' ' verify_head $c1 ' +test_expect_success 'merge log message' ' + git reset --hard c0 && + git merge --no-log c2 && + git show -s --pretty=format:%b HEAD >msg.act && + verify_diff msg.nolog msg.act "[OOPS] bad merge log message" && + git merge --log c3 && + git show -s --pretty=format:%b HEAD >msg.act && + verify_diff msg.log msg.act "[OOPS] bad merge log message" +' + test_debug 'gitk --all' test_done -- cgit v1.2.1