* [PATCH 0/2] merge --summary vs. merge.summary
@ 2008-04-03 9:03 SZEDER Gábor
2008-04-03 9:03 ` [PATCH 1/2] merge, pull: rename '--summary' option to '--diffstat' SZEDER Gábor
2008-04-03 10:30 ` [PATCH 0/2] merge --summary vs. merge.summary Jeff King
0 siblings, 2 replies; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-03 9:03 UTC (permalink / raw)
To: git; +Cc: SZEDER Gábor
The documentation of 'git merge' says the following:
--summary
Show a diffstat at the end of the merge. The diffstat is also
controlled by the configuration option merge.diffstat.
-n, --no-summary
Do not show diffstat at the end of the merge.
and
merge.summary
Whether to include summaries of merged commits in newly created
merge commit. False by default.
So the '--summary' option controls the printing of diffstat, while the
'merge.summary' config variable controls the behaviour of 'fmt-merge-msg',
and '--summary' and 'merge.diffstat' are controlling the same thing. This
is inconsistent and quite confusing. In fact, it took me quite a while to
figure out, how Junio generates those nice merge commit messages, as I
have never actually read the meaning of 'merge.summary', thinking that it
must do the same as '--summary'.
These two patches will resolve this issue.
Best,
Gábor
SZEDER Gábor (2):
merge, pull: rename '--summary' option to '--diffstat'
merge, pull: add option to put summary into the merge commit message
Documentation/git-merge.txt | 2 +-
Documentation/merge-options.txt | 13 +++++++++++--
contrib/completion/git-completion.bash | 3 ++-
git-merge.sh | 18 +++++++++++++-----
git-pull.sh | 24 ++++++++++++++----------
t/t7600-merge.sh | 22 ++++++++++++++++++----
6 files changed, 59 insertions(+), 23 deletions(-)
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 1/2] merge, pull: rename '--summary' option to '--diffstat'
2008-04-03 9:03 [PATCH 0/2] merge --summary vs. merge.summary SZEDER Gábor
@ 2008-04-03 9:03 ` SZEDER Gábor
2008-04-03 9:03 ` [PATCH 2/2] merge, pull: add option to put summary into the merge commit message SZEDER Gábor
2008-04-03 10:30 ` [PATCH 0/2] merge --summary vs. merge.summary Jeff King
1 sibling, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-03 9:03 UTC (permalink / raw)
To: git; +Cc: SZEDER Gábor
Because this option does actually just that. And now it's also consistent
with 'merge.diffstat'.
The patch also updates documentation, tests, and bash completion
accordingly.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/git-merge.txt | 2 +-
Documentation/merge-options.txt | 4 ++--
contrib/completion/git-completion.bash | 2 +-
git-merge.sh | 8 ++++----
git-pull.sh | 16 ++++++++--------
t/t7600-merge.sh | 6 +++---
6 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index c136b10..d260ab1 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -9,7 +9,7 @@ git-merge - Join two or more development histories together
SYNOPSIS
--------
[verse]
-'git-merge' [-n] [--summary] [--no-commit] [--squash] [-s <strategy>]...
+'git-merge' [-n] [--diffstat] [--no-commit] [--squash] [-s <strategy>]...
[-m <msg>] <remote> <remote>...
'git-merge' <msg> HEAD <remote>...
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 9f1fc82..edd13a5 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -1,8 +1,8 @@
---summary::
+--diffstat::
Show a diffstat at the end of the merge. The diffstat is also
controlled by the configuration option merge.diffstat.
--n, \--no-summary::
+-n, \--no-diffstat::
Do not show diffstat at the end of the merge.
--no-commit::
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 791e30f..2e6cad7 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -776,7 +776,7 @@ _git_merge ()
;;
--*)
__gitcomp "
- --no-commit --no-summary --squash --strategy
+ --no-commit --no-diffstat --squash --strategy
"
return
esac
diff --git a/git-merge.sh b/git-merge.sh
index 7dbbb1d..739b466 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -8,8 +8,8 @@ OPTIONS_SPEC="\
git-merge [options] <remote>...
git-merge [options] <msg> HEAD <remote>
--
-summary show a diffstat at the end of the merge
-n,no-summary don't show a diffstat at the end of the merge
+diffstat show a diffstat at the end of the merge
+n,no-diffstat don't show a diffstat at the end of the merge
squash create a single commit instead of doing a merge
commit perform a commit if the merge sucesses (default)
ff allow fast forward (default)
@@ -148,9 +148,9 @@ merge_name () {
parse_config () {
while test $# != 0; do
case "$1" in
- -n|--no-summary)
+ -n|--no-diffstat)
show_diffstat=false ;;
- --summary)
+ --diffstat)
show_diffstat=t ;;
--squash)
test "$allow_fast_forward" = t ||
diff --git a/git-pull.sh b/git-pull.sh
index 3ce32b5..6a46e14 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -4,7 +4,7 @@
#
# Fetch one or more remote refs and merge it/them into the current HEAD.
-USAGE='[-n | --no-summary] [--[no-]commit] [--[no-]squash] [--[no-]ff] [-s strategy]... [<fetch-options>] <repo> <head>...'
+USAGE='[-n | --no-diffstat] [--[no-]commit] [--[no-]squash] [--[no-]ff] [-s strategy]... [<fetch-options>] <repo> <head>...'
LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.'
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=
@@ -16,18 +16,18 @@ cd_to_toplevel
test -z "$(git ls-files -u)" ||
die "You are in the middle of a conflicted merge."
-strategy_args= no_summary= no_commit= squash= no_ff=
+strategy_args= no_diffstat= no_commit= squash= no_ff=
curr_branch=$(git symbolic-ref -q HEAD)
curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||")
rebase=$(git config --bool branch.$curr_branch_short.rebase)
while :
do
case "$1" in
- -n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\
- --no-summa|--no-summar|--no-summary)
- no_summary=-n ;;
- --summary)
- no_summary=$1
+ -n|--n|--no|--no-|--no-d|--no-di|--no-dif|--no-diff|\
+ --no-diffs|--no-diffst|--no-diffsta|--no-diffstat)
+ no_diffstat=-n ;;
+ --diffstat)
+ no_diffstat=$1
;;
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
no_commit=--no-commit ;;
@@ -176,5 +176,5 @@ merge_name=$(git fmt-merge-msg <"$GIT_DIR/FETCH_HEAD") || exit
test true = "$rebase" &&
exec git-rebase $strategy_args --onto $merge_head \
${oldremoteref:-$merge_head}
-exec git-merge $no_summary $no_commit $squash $no_ff $strategy_args \
+exec git-merge $no_diffstat $no_commit $squash $no_ff $strategy_args \
"$merge_name" HEAD $merge_head
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 56869ac..bbbd580 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -368,7 +368,7 @@ test_expect_success 'override config option -n' '
git reset --hard c1 &&
git config branch.master.mergeoptions "-n" &&
test_tick &&
- git merge --summary c2 >diffstat.txt &&
+ git merge --diffstat c2 >diffstat.txt &&
verify_merge file result.1-5 msg.1-5 &&
verify_parents $c1 $c2 &&
if ! grep "^ file | *2 +-$" diffstat.txt
@@ -379,9 +379,9 @@ test_expect_success 'override config option -n' '
test_debug 'gitk --all'
-test_expect_success 'override config option --summary' '
+test_expect_success 'override config option --diffstat' '
git reset --hard c1 &&
- git config branch.master.mergeoptions "--summary" &&
+ git config branch.master.mergeoptions "--diffstat" &&
test_tick &&
git merge -n c2 >diffstat.txt &&
verify_merge file result.1-5 msg.1-5 &&
--
1.5.5.rc2.38.g3b417
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 2/2] merge, pull: add option to put summary into the merge commit message
2008-04-03 9:03 ` [PATCH 1/2] merge, pull: rename '--summary' option to '--diffstat' SZEDER Gábor
@ 2008-04-03 9:03 ` SZEDER Gábor
0 siblings, 0 replies; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-03 9:03 UTC (permalink / raw)
To: git; +Cc: SZEDER Gábor
These options are basically the command line option equivalents of the
'merge.summary' config variable, and are in sync with the options of
'fmt-merge-msg'.
The patch also updates documentation and bash completion accordingly, and
adds a test.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/merge-options.txt | 9 +++++++++
contrib/completion/git-completion.bash | 3 ++-
git-merge.sh | 10 +++++++++-
git-pull.sh | 10 +++++++---
t/t7600-merge.sh | 16 +++++++++++++++-
5 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index edd13a5..ece6040 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -5,6 +5,15 @@
-n, \--no-diffstat::
Do not show diffstat at the end of the merge.
+--summary::
+ In addition to branch names, populate the log message with
+ one-line descriptions from the actual commits that are being
+ merged.
+
+--no-summary::
+ Do not list one-line descriptions from the actual commits being
+ merged.
+
--no-commit::
Perform the merge but pretend the merge failed and do
not autocommit, to give the user a chance to inspect and
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 2e6cad7..8413b29 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -776,7 +776,8 @@ _git_merge ()
;;
--*)
__gitcomp "
- --no-commit --no-diffstat --squash --strategy
+ --no-commit --no-diffstat --summary --no-summary
+ --squash --strategy
"
return
esac
diff --git a/git-merge.sh b/git-merge.sh
index 739b466..03bcfb1 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -10,6 +10,10 @@ git-merge [options] <msg> HEAD <remote>
--
diffstat show a diffstat at the end of the merge
n,no-diffstat don't show a diffstat at the end of the merge
+summary put one-line descriptions of the merged commits into
+ the merge commit message
+no-summary don't put one-line descriptions of the merged commits
+ into the merge commit message
squash create a single commit instead of doing a merge
commit perform a commit if the merge sucesses (default)
ff allow fast forward (default)
@@ -152,6 +156,10 @@ parse_config () {
show_diffstat=false ;;
--diffstat)
show_diffstat=t ;;
+ --summary)
+ summary_arg=--summary ;;
+ --no-summary)
+ summary_arg=--no-summary ;;
--squash)
test "$allow_fast_forward" = t ||
die "You cannot combine --squash with --no-ff."
@@ -258,7 +266,7 @@ else
merge_name=$(for remote
do
merge_name "$remote"
- done | git fmt-merge-msg
+ done | git fmt-merge-msg $summary_arg
)
merge_msg="${merge_msg:+$merge_msg$LF$LF}$merge_name"
fi
diff --git a/git-pull.sh b/git-pull.sh
index 6a46e14..99387c8 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -29,6 +29,10 @@ do
--diffstat)
no_diffstat=$1
;;
+ --no-s|--no-su|--no-sum|--no-summ|--no-summa|--no-summar|--no-summary)
+ summary_arg=--no-summary ;;
+ --s|--su|--sum|--summ|--summa|--summar|--summary)
+ summary_arg=--summary ;;
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
no_commit=--no-commit ;;
--c|--co|--com|--comm|--commi|--commit)
@@ -172,9 +176,9 @@ then
exit
fi
-merge_name=$(git fmt-merge-msg <"$GIT_DIR/FETCH_HEAD") || exit
+merge_name=$(git fmt-merge-msg $summary_arg <"$GIT_DIR/FETCH_HEAD") || exit
test true = "$rebase" &&
exec git-rebase $strategy_args --onto $merge_head \
${oldremoteref:-$merge_head}
-exec git-merge $no_diffstat $no_commit $squash $no_ff $strategy_args \
- "$merge_name" HEAD $merge_head
+exec git-merge $no_diffstat $no_commit $summary_arg $squash $no_ff \
+ $strategy_args "$merge_name" HEAD $merge_head
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index bbbd580..a762d31 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.nosummary &&
+ echo "* commit 'c3':" >msg.summary &&
+ echo " commit 3" >>msg.summary &&
+ echo >>msg.summary
}
verify_diff() {
@@ -441,6 +445,16 @@ test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '
verify_head $c1
'
+test_expect_success 'merge --summary' '
+ git reset --hard c0 &&
+ git merge --no-summary c2 &&
+ git show -s --pretty=format:%b HEAD >msg.act &&
+ verify_diff msg.nosummary msg.act "[OOPS] bad merge summary" &&
+ git merge --summary c3 &&
+ git show -s --pretty=format:%b HEAD >msg.act &&
+ verify_diff msg.summary msg.act "[OOPS] bad merge summary"
+'
+
test_debug 'gitk --all'
test_done
--
1.5.5.rc2.38.g3b417
^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH 0/2] merge --summary vs. merge.summary
2008-04-03 9:03 [PATCH 0/2] merge --summary vs. merge.summary SZEDER Gábor
2008-04-03 9:03 ` [PATCH 1/2] merge, pull: rename '--summary' option to '--diffstat' SZEDER Gábor
@ 2008-04-03 10:30 ` Jeff King
2008-04-03 11:03 ` SZEDER Gábor
2008-04-05 14:48 ` [PATCH] merge, pull: introduce '--diffstat' option SZEDER Gábor
1 sibling, 2 replies; 32+ messages in thread
From: Jeff King @ 2008-04-03 10:30 UTC (permalink / raw)
To: SZEDER Gábor; +Cc: git
On Thu, Apr 03, 2008 at 11:03:14AM +0200, SZEDER Gábor wrote:
> So the '--summary' option controls the printing of diffstat, while the
> 'merge.summary' config variable controls the behaviour of 'fmt-merge-msg',
Think that --diffstat is probably a better name. But your series
actually _changes_ the meaning of --summary, which is probably a bad
idea for people who have scripted around these.
The problem is that you have two concepts with the same name; giving one
of the concepts the name means that the other concept breaks.
I think the most compatible way to go forward is to use two new names:
1. --summary (and --no- form) changes to --diffstat; --summary remains
as a compatibility alias for --diffstat.
2. merge.summary becomes merge.something_else, along with
--something-else support. merge.summary remains as a compatibility
option for merge.something_else.
Though I can't think of a good "something_else". Given that there isn't
even a command-line equivalent to merge.summary now, maybe just leave it
as merge.summary, stop advertising --summary (even though it is a
compatibility alias, we officially call it --diffstat), and then there
is less confusion on the part of documentation readers (though perhaps
more on the part of those who blindly try --summary).
-Peff
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 0/2] merge --summary vs. merge.summary
2008-04-03 10:30 ` [PATCH 0/2] merge --summary vs. merge.summary Jeff King
@ 2008-04-03 11:03 ` SZEDER Gábor
2008-04-05 14:48 ` [PATCH] merge, pull: introduce '--diffstat' option SZEDER Gábor
1 sibling, 0 replies; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-03 11:03 UTC (permalink / raw)
To: Jeff King; +Cc: git
Hi Jeff,
On Thu, Apr 03, 2008 at 06:30:56AM -0400, Jeff King wrote:
> On Thu, Apr 03, 2008 at 11:03:14AM +0200, SZEDER Gábor wrote:
>
> > So the '--summary' option controls the printing of diffstat, while the
> > 'merge.summary' config variable controls the behaviour of 'fmt-merge-msg',
>
> Think that --diffstat is probably a better name. But your series
> actually _changes_ the meaning of --summary, which is probably a bad
> idea for people who have scripted around these.
>
> The problem is that you have two concepts with the same name; giving one
> of the concepts the name means that the other concept breaks.
Well, I agree with you, and I had the same concerns you expressed
here.
> 2. merge.summary becomes merge.something_else, along with
> --something-else support. merge.summary remains as a compatibility
> option for merge.something_else.
>
> Though I can't think of a good "something_else".
Me neither.
> Given that there isn't
> even a command-line equivalent to merge.summary now, maybe just leave it
> as merge.summary
I think that the name of the command-line option and the config
variable should be in sync, so having merge.sync and --something-else
is probably not a good idea. Furthermore, I think it should also be
sync with the options of fmt-merge-msg.
Regards,
Gábor
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH] merge, pull: introduce '--diffstat' option
2008-04-03 10:30 ` [PATCH 0/2] merge --summary vs. merge.summary Jeff King
2008-04-03 11:03 ` SZEDER Gábor
@ 2008-04-05 14:48 ` SZEDER Gábor
2008-04-05 15:35 ` Teemu Likonen
1 sibling, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-05 14:48 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, Git Mailing List, SZEDER Gábor
At present, the 'merge --summary' command line option and
'merge.diffstat' config variable are controlling the same thing: whether
to show a diffstat at the end of the merge or not. This is inconsistent
and confusing.
This patch adds the '--diffstat' and '--no-diffstat' options to 'merge'
and 'pull', making the name of the command line option and the
config variable consistent. Documentation, tests, and bash completion
are also updated accordingly.
The '--summary' and '--no-summary' options are still accepted, but are
not advertised.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
But there is still a conflict between the 'merge.summary' config
variable and the now not advertised '--summary' option, that should be
resolved.
Documentation/git-merge.txt | 2 +-
Documentation/merge-options.txt | 4 ++--
contrib/completion/git-completion.bash | 2 +-
git-merge.sh | 8 ++++----
git-pull.sh | 16 +++++++---------
t/t7600-merge.sh | 6 +++---
6 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index c136b10..d260ab1 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -9,7 +9,7 @@ git-merge - Join two or more development histories together
SYNOPSIS
--------
[verse]
-'git-merge' [-n] [--summary] [--no-commit] [--squash] [-s <strategy>]...
+'git-merge' [-n] [--diffstat] [--no-commit] [--squash] [-s <strategy>]...
[-m <msg>] <remote> <remote>...
'git-merge' <msg> HEAD <remote>...
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 9f1fc82..edd13a5 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -1,8 +1,8 @@
---summary::
+--diffstat::
Show a diffstat at the end of the merge. The diffstat is also
controlled by the configuration option merge.diffstat.
--n, \--no-summary::
+-n, \--no-diffstat::
Do not show diffstat at the end of the merge.
--no-commit::
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 791e30f..2e6cad7 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -776,7 +776,7 @@ _git_merge ()
;;
--*)
__gitcomp "
- --no-commit --no-summary --squash --strategy
+ --no-commit --no-diffstat --squash --strategy
"
return
esac
diff --git a/git-merge.sh b/git-merge.sh
index 7dbbb1d..b51eef8 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -8,8 +8,8 @@ OPTIONS_SPEC="\
git-merge [options] <remote>...
git-merge [options] <msg> HEAD <remote>
--
-summary show a diffstat at the end of the merge
-n,no-summary don't show a diffstat at the end of the merge
+diffstat show a diffstat at the end of the merge
+n,no-diffstat don't show a diffstat at the end of the merge
squash create a single commit instead of doing a merge
commit perform a commit if the merge sucesses (default)
ff allow fast forward (default)
@@ -148,9 +148,9 @@ merge_name () {
parse_config () {
while test $# != 0; do
case "$1" in
- -n|--no-summary)
+ -n|--no-diffstat|--no-summary)
show_diffstat=false ;;
- --summary)
+ --diffstat|--summary)
show_diffstat=t ;;
--squash)
test "$allow_fast_forward" = t ||
diff --git a/git-pull.sh b/git-pull.sh
index 3ce32b5..20a2024 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -4,7 +4,7 @@
#
# Fetch one or more remote refs and merge it/them into the current HEAD.
-USAGE='[-n | --no-summary] [--[no-]commit] [--[no-]squash] [--[no-]ff] [-s strategy]... [<fetch-options>] <repo> <head>...'
+USAGE='[-n | --no-diffstat] [--[no-]commit] [--[no-]squash] [--[no-]ff] [-s strategy]... [<fetch-options>] <repo> <head>...'
LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.'
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=
@@ -16,19 +16,17 @@ cd_to_toplevel
test -z "$(git ls-files -u)" ||
die "You are in the middle of a conflicted merge."
-strategy_args= no_summary= no_commit= squash= no_ff=
+strategy_args= no_diffstat= no_commit= squash= no_ff=
curr_branch=$(git symbolic-ref -q HEAD)
curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||")
rebase=$(git config --bool branch.$curr_branch_short.rebase)
while :
do
case "$1" in
- -n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\
- --no-summa|--no-summar|--no-summary)
- no_summary=-n ;;
- --summary)
- no_summary=$1
- ;;
+ -n|--no-diffstat|--no-summary)
+ no_diffstat=-n ;;
+ --diffstat|--summary)
+ no_diffstat=$1 ;;
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
no_commit=--no-commit ;;
--c|--co|--com|--comm|--commi|--commit)
@@ -176,5 +174,5 @@ merge_name=$(git fmt-merge-msg <"$GIT_DIR/FETCH_HEAD") || exit
test true = "$rebase" &&
exec git-rebase $strategy_args --onto $merge_head \
${oldremoteref:-$merge_head}
-exec git-merge $no_summary $no_commit $squash $no_ff $strategy_args \
+exec git-merge $no_diffstat $no_commit $squash $no_ff $strategy_args \
"$merge_name" HEAD $merge_head
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 56869ac..bbbd580 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -368,7 +368,7 @@ test_expect_success 'override config option -n' '
git reset --hard c1 &&
git config branch.master.mergeoptions "-n" &&
test_tick &&
- git merge --summary c2 >diffstat.txt &&
+ git merge --diffstat c2 >diffstat.txt &&
verify_merge file result.1-5 msg.1-5 &&
verify_parents $c1 $c2 &&
if ! grep "^ file | *2 +-$" diffstat.txt
@@ -379,9 +379,9 @@ test_expect_success 'override config option -n' '
test_debug 'gitk --all'
-test_expect_success 'override config option --summary' '
+test_expect_success 'override config option --diffstat' '
git reset --hard c1 &&
- git config branch.master.mergeoptions "--summary" &&
+ git config branch.master.mergeoptions "--diffstat" &&
test_tick &&
git merge -n c2 >diffstat.txt &&
verify_merge file result.1-5 msg.1-5 &&
--
1.5.5.rc3.10.g79e34
^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH] merge, pull: introduce '--diffstat' option
2008-04-05 14:48 ` [PATCH] merge, pull: introduce '--diffstat' option SZEDER Gábor
@ 2008-04-05 15:35 ` Teemu Likonen
2008-04-05 18:51 ` Junio C Hamano
0 siblings, 1 reply; 32+ messages in thread
From: Teemu Likonen @ 2008-04-05 15:35 UTC (permalink / raw)
To: git; +Cc: SZEDER Gábor, Junio C Hamano, Jeff King
SZEDER Gábor kirjoitti:
> At present, the 'merge --summary' command line option and
> 'merge.diffstat' config variable are controlling the same thing:
> whether to show a diffstat at the end of the merge or not. This is
> inconsistent and confusing.
> But there is still a conflict between the 'merge.summary' config
> variable and the now not advertised '--summary' option, that should
> be resolved.
I very much agree with you: --summary/--no-summary are logical and
intuitive equivalents of merge.summary, as are --diffstat/--no-diffstat
to merge.diffstat.
How about this: Officially and explicitly deprecate --(no-)summary and
advertise --(no-)diffstat as replacement. Also advertise that in some
future release --(no-)summary will have different meaning (i.e.
equivalent to merge.summary). There would be a reasonable (?) period
before changing the meaning of --(no-)summary.
This is a bit hassle but I think in long term this would be a gain for
Git's user interface. I believe these are not the kind of options that
many scripts vitally depend on, so the change would be pretty safe I
think.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH] merge, pull: introduce '--diffstat' option
2008-04-05 15:35 ` Teemu Likonen
@ 2008-04-05 18:51 ` Junio C Hamano
2008-04-06 1:23 ` [PATCH 0/6] merge summary and diffstat options cleanup SZEDER Gábor
2008-04-06 13:53 ` [PATCH] merge, pull: introduce '--diffstat' option Jeff King
0 siblings, 2 replies; 32+ messages in thread
From: Junio C Hamano @ 2008-04-05 18:51 UTC (permalink / raw)
To: Teemu Likonen; +Cc: git, SZEDER Gábor, Jeff King
Teemu Likonen <tlikonen@iki.fi> writes:
> How about this: Officially and explicitly deprecate --(no-)summary and
> advertise --(no-)diffstat as replacement. Also advertise that in some
> future release --(no-)summary will have different meaning (i.e.
> equivalent to merge.summary). There would be a reasonable (?) period
> before changing the meaning of --(no-)summary.
>
> This is a bit hassle...
I'd favor, in the longer run:
* --stat option to mean "show the diffstat between ORIG_HEAD and merge
result" (i.e. current --summary);
* perhaps a new configuration merge.stat to control the default for the
above;
* merge.log configuration to mean "add list of one-line log to the merge
commit message" (i.e. current merge.summary);
* perhaps a --log option to override the config default for each
invocation.
* deprecate --summary and merge.summary and remove them long after people
are used to the above new set.
Transition needs to happen over time and across a major release bump.
We can do the first four in 1.5.6, and immediately declare deprecation,
and removal of --summary/merge.summary perhaps in 1.6.0.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 0/6] merge summary and diffstat options cleanup
2008-04-05 18:51 ` Junio C Hamano
@ 2008-04-06 1:23 ` SZEDER Gábor
2008-04-06 1:23 ` [PATCH 1/6] doc: moved merge.* config variables into separate merge-config.txt SZEDER Gábor
2008-04-06 13:53 ` [PATCH] merge, pull: introduce '--diffstat' option Jeff King
1 sibling, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-06 1:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Jeff King, Teemu Likonen, SZEDER Gábor
On Sat, Apr 05, 2008 at 11:51:51AM -0700, Junio C Hamano wrote:
> I'd favor, in the longer run:
>
> * --stat option to mean "show the diffstat between ORIG_HEAD and merge
> result" (i.e. current --summary);
I have only looked at the 'merge.diffstat' config variable, and wanted
to make the command line option consistent with it. But you are right,
'--stat' is better, because it's in sync with other commands as well.
> * perhaps a new configuration merge.stat to control the default for the
> above;
>
> * merge.log configuration to mean "add list of one-line log to the merge
> commit message" (i.e. current merge.summary);
>
> * perhaps a --log option to override the config default for each
> invocation.
>
> * deprecate --summary and merge.summary and remove them long after people
> are used to the above new set.
>
> Transition needs to happen over time and across a major release bump.
>
> We can do the first four in 1.5.6, and immediately declare
> deprecation,
> and removal of --summary/merge.summary perhaps in 1.6.0.
The first patch is an independent documentation cleanup that could be
merged regardless of the other patches, but the others depend on it.
Patches 2-5 are implementing your first four point. Patch 4 not only
adds the 'merge.log' config variable, but also adds corresponding
command line options.
Finally, the last patch removes all the deprecated stuff.
SZEDER Gábor (6):
doc: moved merge.* config variables into separate merge-config.txt
merge, pull: introduce '--(no-)stat' option
add 'merge.stat' config variable
fmt-merge-msg: add '--(no-)log' options and 'merge.log' config
variable
merge, pull: add '--(no-)log' command line option
merge: remove deprecated summary and diffstat options and config
variables
Documentation/config.txt | 32 +----------------------------
Documentation/git-fmt-merge-msg.txt | 10 ++++----
Documentation/git-merge.txt | 15 +-----------
Documentation/merge-config.txt | 35 ++++++++++++++++++++++++++++++++
Documentation/merge-options.txt | 15 +++++++++++--
builtin-fmt-merge-msg.c | 8 +++---
contrib/completion/git-completion.bash | 2 +-
git-merge.sh | 18 ++++++++++------
git-pull.sh | 20 +++++++++---------
t/t6200-fmt-merge-msg.sh | 6 ++--
t/t7600-merge.sh | 22 ++++++++++++++++---
11 files changed, 102 insertions(+), 81 deletions(-)
create mode 100644 Documentation/merge-config.txt
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 1/6] doc: moved merge.* config variables into separate merge-config.txt
2008-04-06 1:23 ` [PATCH 0/6] merge summary and diffstat options cleanup SZEDER Gábor
@ 2008-04-06 1:23 ` SZEDER Gábor
2008-04-06 1:23 ` [PATCH 2/6] merge, pull: introduce '--(no-)stat' option SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-06 1:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Jeff King, Teemu Likonen, SZEDER Gábor
Include the new file from config.txt and git-merge.txt.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/config.txt | 32 +-------------------------------
Documentation/git-merge.txt | 13 +------------
Documentation/merge-config.txt | 31 +++++++++++++++++++++++++++++++
3 files changed, 33 insertions(+), 43 deletions(-)
create mode 100644 Documentation/merge-config.txt
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 04c01c5..f009740 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -768,37 +768,7 @@ man.viewer::
Specify the programs that may be used to display help in the
'man' format. See linkgit:git-help[1].
-merge.summary::
- Whether to include summaries of merged commits in newly created
- merge commit messages. False by default.
-
-merge.tool::
- Controls which merge resolution program is used by
- linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3",
- "tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and
- "opendiff". Any other value is treated is custom merge tool
- and there must be a corresponing mergetool.<tool>.cmd option.
-
-merge.verbosity::
- Controls the amount of output shown by the recursive merge
- strategy. Level 0 outputs nothing except a final error
- message if conflicts were detected. Level 1 outputs only
- conflicts, 2 outputs conflicts and file changes. Level 5 and
- above outputs debugging information. The default is level 2.
- Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable.
-
-merge.<driver>.name::
- Defines a human readable name for a custom low-level
- merge driver. See linkgit:gitattributes[5] for details.
-
-merge.<driver>.driver::
- Defines the command that implements a custom low-level
- merge driver. See linkgit:gitattributes[5] for details.
-
-merge.<driver>.recursive::
- Names a low-level merge driver to be used when
- performing an internal merge between common ancestors.
- See linkgit:gitattributes[5] for details.
+include::merge-config.txt[]
mergetool.<tool>.path::
Override the path for the given tool. This is useful in case
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index c136b10..821e21b 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -46,18 +46,7 @@ linkgit:git-reset[1].
CONFIGURATION
-------------
-
-merge.summary::
- Whether to include summaries of merged commits in newly
- created merge commit. False by default.
-
-merge.verbosity::
- Controls the amount of output shown by the recursive merge
- strategy. Level 0 outputs nothing except a final error
- message if conflicts were detected. Level 1 outputs only
- conflicts, 2 outputs conflicts and file changes. Level 5 and
- above outputs debugging information. The default is level 2.
- Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable.
+include::merge-config.txt[]
branch.<name>.mergeoptions::
Sets default options for merging into branch <name>. The syntax and
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
new file mode 100644
index 0000000..cc815cc
--- /dev/null
+++ b/Documentation/merge-config.txt
@@ -0,0 +1,31 @@
+merge.summary::
+ Whether to include summaries of merged commits in newly created
+ merge commit messages. False by default.
+
+merge.tool::
+ Controls which merge resolution program is used by
+ linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3",
+ "tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and
+ "opendiff". Any other value is treated is custom merge tool
+ and there must be a corresponing mergetool.<tool>.cmd option.
+
+merge.verbosity::
+ Controls the amount of output shown by the recursive merge
+ strategy. Level 0 outputs nothing except a final error
+ message if conflicts were detected. Level 1 outputs only
+ conflicts, 2 outputs conflicts and file changes. Level 5 and
+ above outputs debugging information. The default is level 2.
+ Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable.
+
+merge.<driver>.name::
+ Defines a human readable name for a custom low-level
+ merge driver. See linkgit:gitattributes[5] for details.
+
+merge.<driver>.driver::
+ Defines the command that implements a custom low-level
+ merge driver. See linkgit:gitattributes[5] for details.
+
+merge.<driver>.recursive::
+ Names a low-level merge driver to be used when
+ performing an internal merge between common ancestors.
+ See linkgit:gitattributes[5] for details.
--
1.5.5.rc3.9.gba703
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 2/6] merge, pull: introduce '--(no-)stat' option
2008-04-06 1:23 ` [PATCH 1/6] doc: moved merge.* config variables into separate merge-config.txt SZEDER Gábor
@ 2008-04-06 1:23 ` SZEDER Gábor
2008-04-06 1:23 ` [PATCH 3/6] add 'merge.stat' config variable SZEDER Gábor
2008-04-06 2:36 ` [PATCH 2/6] merge, pull: introduce '--(no-)stat' option Junio C Hamano
0 siblings, 2 replies; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-06 1:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Jeff King, Teemu Likonen, SZEDER Gábor
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.
'--(no-)summary' options are still accepted, but are not advertised.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/git-merge.txt | 2 +-
Documentation/merge-options.txt | 4 ++--
contrib/completion/git-completion.bash | 2 +-
git-merge.sh | 8 ++++----
git-pull.sh | 16 +++++++---------
t/t7600-merge.sh | 6 +++---
6 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 821e21b..ef1f055 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -9,7 +9,7 @@ git-merge - Join two or more development histories together
SYNOPSIS
--------
[verse]
-'git-merge' [-n] [--summary] [--no-commit] [--squash] [-s <strategy>]...
+'git-merge' [-n] [--stat] [--no-commit] [--squash] [-s <strategy>]...
[-m <msg>] <remote> <remote>...
'git-merge' <msg> HEAD <remote>...
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 9f1fc82..bc81580 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -1,8 +1,8 @@
---summary::
+--stat::
Show a diffstat at the end of the merge. The diffstat is also
controlled by the configuration option merge.diffstat.
--n, \--no-summary::
+-n, \--no-stat::
Do not show diffstat at the end of the merge.
--no-commit::
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 791e30f..6f3b78c 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -776,7 +776,7 @@ _git_merge ()
;;
--*)
__gitcomp "
- --no-commit --no-summary --squash --strategy
+ --no-commit --no-stat --squash --strategy
"
return
esac
diff --git a/git-merge.sh b/git-merge.sh
index 7dbbb1d..1b693ad 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -8,8 +8,8 @@ OPTIONS_SPEC="\
git-merge [options] <remote>...
git-merge [options] <msg> HEAD <remote>
--
-summary show a diffstat at the end of the merge
-n,no-summary don't show a diffstat at the end of the merge
+stat show a diffstat at the end of the merge
+n,no-stat don't show a diffstat at the end of the merge
squash create a single commit instead of doing a merge
commit perform a commit if the merge sucesses (default)
ff allow fast forward (default)
@@ -148,9 +148,9 @@ merge_name () {
parse_config () {
while test $# != 0; do
case "$1" in
- -n|--no-summary)
+ -n|--no-stat|--no-summary)
show_diffstat=false ;;
- --summary)
+ --stat|--summary)
show_diffstat=t ;;
--squash)
test "$allow_fast_forward" = t ||
diff --git a/git-pull.sh b/git-pull.sh
index 3ce32b5..ed83ce1 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -4,7 +4,7 @@
#
# Fetch one or more remote refs and merge it/them into the current HEAD.
-USAGE='[-n | --no-summary] [--[no-]commit] [--[no-]squash] [--[no-]ff] [-s strategy]... [<fetch-options>] <repo> <head>...'
+USAGE='[-n | --no-stat] [--[no-]commit] [--[no-]squash] [--[no-]ff] [-s strategy]... [<fetch-options>] <repo> <head>...'
LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.'
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=
@@ -16,19 +16,17 @@ cd_to_toplevel
test -z "$(git ls-files -u)" ||
die "You are in the middle of a conflicted merge."
-strategy_args= no_summary= no_commit= squash= no_ff=
+strategy_args= no_stat= no_commit= squash= no_ff=
curr_branch=$(git symbolic-ref -q HEAD)
curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||")
rebase=$(git config --bool branch.$curr_branch_short.rebase)
while :
do
case "$1" in
- -n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\
- --no-summa|--no-summar|--no-summary)
- no_summary=-n ;;
- --summary)
- no_summary=$1
- ;;
+ -n|--no-stat|--no-summary)
+ no_stat=-n ;;
+ --stat|--summary)
+ no_stat=$1 ;;
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
no_commit=--no-commit ;;
--c|--co|--com|--comm|--commi|--commit)
@@ -176,5 +174,5 @@ merge_name=$(git fmt-merge-msg <"$GIT_DIR/FETCH_HEAD") || exit
test true = "$rebase" &&
exec git-rebase $strategy_args --onto $merge_head \
${oldremoteref:-$merge_head}
-exec git-merge $no_summary $no_commit $squash $no_ff $strategy_args \
+exec git-merge $no_stat $no_commit $squash $no_ff $strategy_args \
"$merge_name" HEAD $merge_head
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 56869ac..1d323ec 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -368,7 +368,7 @@ test_expect_success 'override config option -n' '
git reset --hard c1 &&
git config branch.master.mergeoptions "-n" &&
test_tick &&
- git merge --summary c2 >diffstat.txt &&
+ 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
@@ -379,9 +379,9 @@ test_expect_success 'override config option -n' '
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 &&
--
1.5.5.rc3.9.gba703
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 3/6] add 'merge.stat' config variable
2008-04-06 1:23 ` [PATCH 2/6] merge, pull: introduce '--(no-)stat' option SZEDER Gábor
@ 2008-04-06 1:23 ` SZEDER Gábor
2008-04-06 1:23 ` [PATCH 4/6] fmt-merge-msg: add '--(no-)log' options and 'merge.log' " SZEDER Gábor
2008-04-06 2:36 ` [PATCH 2/6] merge, pull: introduce '--(no-)stat' option Junio C Hamano
1 sibling, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-06 1:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Jeff King, Teemu Likonen, SZEDER Gábor
This variable has the same effect, as 'merge.diffstat'.
Also mention it in the documentation.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/merge-config.txt | 4 ++++
Documentation/merge-options.txt | 2 +-
git-merge.sh | 1 +
3 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
index cc815cc..6d0a797 100644
--- a/Documentation/merge-config.txt
+++ b/Documentation/merge-config.txt
@@ -1,3 +1,7 @@
+merge.stat::
+ Whether to print the diffstat berween ORIG_HEAD and merge result
+ at the end of the merge. True by default.
+
merge.summary::
Whether to include summaries of merged commits in newly created
merge commit messages. False by default.
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index bc81580..b89ace8 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -1,6 +1,6 @@
--stat::
Show a diffstat at the end of the merge. The diffstat is also
- controlled by the configuration option merge.diffstat.
+ controlled by the configuration option merge.stat.
-n, \--no-stat::
Do not show diffstat at the end of the merge.
diff --git a/git-merge.sh b/git-merge.sh
index 1b693ad..004e367 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -210,6 +210,7 @@ while test $args_left -lt $#; do shift; done
if test -z "$show_diffstat"; then
test "$(git config --bool merge.diffstat)" = false && show_diffstat=false
+ test "$(git config --bool merge.stat)" = false && show_diffstat=false
test -z "$show_diffstat" && show_diffstat=t
fi
--
1.5.5.rc3.9.gba703
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 4/6] fmt-merge-msg: add '--(no-)log' options and 'merge.log' config variable
2008-04-06 1:23 ` [PATCH 3/6] add 'merge.stat' config variable SZEDER Gábor
@ 2008-04-06 1:23 ` SZEDER Gábor
2008-04-06 1:23 ` [PATCH 5/6] merge, pull: add '--(no-)log' command line option SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-06 1:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Jeff King, Teemu Likonen, SZEDER Gábor
These are doing the same as the '--(no-)summary' options or 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 not advertised.
'merge.log' takes precedence over 'merge.summary'.
Update documentation and test accordingly.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/git-fmt-merge-msg.txt | 10 +++++-----
Documentation/merge-config.txt | 2 +-
builtin-fmt-merge-msg.c | 14 ++++++++++----
t/t6200-fmt-merge-msg.sh | 6 +++---
4 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/Documentation/git-fmt-merge-msg.txt b/Documentation/git-fmt-merge-msg.txt
index 8615ae3..bf9c26b 100644
--- a/Documentation/git-fmt-merge-msg.txt
+++ b/Documentation/git-fmt-merge-msg.txt
@@ -9,8 +9,8 @@ git-fmt-merge-msg - Produce a merge commit message
SYNOPSIS
--------
[verse]
-git-fmt-merge-msg [--summary | --no-summary] <$GIT_DIR/FETCH_HEAD
-git-fmt-merge-msg [--summary | --no-summary] -F <file>
+git-fmt-merge-msg [--log | --no-log] <$GIT_DIR/FETCH_HEAD
+git-fmt-merge-msg [--log | --no-log] -F <file>
DESCRIPTION
-----------
@@ -24,12 +24,12 @@ automatically invoking `git-merge`.
OPTIONS
-------
---summary::
+--log::
In addition to branch names, populate the log message with
one-line descriptions from the actual commits that are being
merged.
---no-summary::
+--no-log::
Do not list one-line descriptions from the actual commits being
merged.
@@ -40,7 +40,7 @@ OPTIONS
CONFIGURATION
-------------
-merge.summary::
+merge.log::
Whether to include summaries of merged commits in newly
merge commit messages. False by default.
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
index 6d0a797..9719311 100644
--- a/Documentation/merge-config.txt
+++ b/Documentation/merge-config.txt
@@ -2,7 +2,7 @@ merge.stat::
Whether to print the diffstat berween ORIG_HEAD and merge result
at the end of the merge. True by default.
-merge.summary::
+merge.log::
Whether to include summaries of merged commits in newly created
merge commit messages. False by default.
diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c
index ebb3f37..d49f545 100644
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
@@ -6,13 +6,18 @@
#include "tag.h"
static const char *fmt_merge_msg_usage =
- "git-fmt-merge-msg [--summary] [--no-summary] [--file <file>]";
+ "git-fmt-merge-msg [--log] [--no-log] [--file <file>]";
static int merge_summary;
static int fmt_merge_msg_config(const char *key, const char *value)
{
- if (!strcmp("merge.summary", key))
+ static int found_merge_log = 0;
+ if (!strcmp("merge.log", key)) {
+ found_merge_log = 1;
+ merge_summary = git_config_bool(key, value);
+ }
+ if (!found_merge_log && !strcmp("merge.summary", key))
merge_summary = git_config_bool(key, value);
return 0;
}
@@ -250,9 +255,10 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
git_config(fmt_merge_msg_config);
while (argc > 1) {
- if (!strcmp(argv[1], "--summary"))
+ if (!strcmp(argv[1], "--log") || !strcmp(argv[1], "--summary"))
merge_summary = 1;
- else if (!strcmp(argv[1], "--no-summary"))
+ else if (!strcmp(argv[1], "--no-log")
+ || !strcmp(argv[1], "--no-summary"))
merge_summary = 0;
else if (!strcmp(argv[1], "-F") || !strcmp(argv[1], "--file")) {
if (argc < 3)
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index 9f70afc..1a04b89 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -107,7 +107,7 @@ EOF
test_expect_success 'merge-msg test #3' '
- git config merge.summary true &&
+ git config merge.log true &&
git checkout master &&
setdate &&
@@ -137,7 +137,7 @@ EOF
test_expect_success 'merge-msg test #4' '
- git config merge.summary true &&
+ git config merge.log true &&
git checkout master &&
setdate &&
@@ -149,7 +149,7 @@ test_expect_success 'merge-msg test #4' '
test_expect_success 'merge-msg test #5' '
- git config merge.summary yes &&
+ git config merge.log yes &&
git checkout master &&
setdate &&
--
1.5.5.rc3.9.gba703
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 5/6] merge, pull: add '--(no-)log' command line option
2008-04-06 1:23 ` [PATCH 4/6] fmt-merge-msg: add '--(no-)log' options and 'merge.log' " SZEDER Gábor
@ 2008-04-06 1:23 ` SZEDER Gábor
2008-04-06 1:23 ` [PATCH 6/6] merge: remove deprecated summary and diffstat options and config variables SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-06 1:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Jeff King, Teemu Likonen, SZEDER Gábor
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 <szeder@ira.uka.de>
---
Documentation/merge-options.txt | 9 +++++++++
contrib/completion/git-completion.bash | 2 +-
git-merge.sh | 8 ++++++--
git-pull.sh | 8 +++++---
t/t7600-merge.sh | 16 +++++++++++++++-
5 files changed, 36 insertions(+), 7 deletions(-)
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index b89ace8..0333913 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -5,6 +5,15 @@
-n, \--no-stat::
Do not show diffstat at the end of the merge.
+--log::
+ In addition to branch names, populate the log message with
+ one-line descriptions from the actual commits that are being
+ merged.
+
+--no-log::
+ Do not list one-line descriptions from the actual commits being
+ merged.
+
--no-commit::
Perform the merge but pretend the merge failed and do
not autocommit, to give the user a chance to inspect and
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 6f3b78c..5880dbe 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -776,7 +776,7 @@ _git_merge ()
;;
--*)
__gitcomp "
- --no-commit --no-stat --squash --strategy
+ --no-commit --no-stat --log --no-log --squash --strategy
"
return
esac
diff --git a/git-merge.sh b/git-merge.sh
index 004e367..a903e2b 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -10,6 +10,8 @@ git-merge [options] <msg> HEAD <remote>
--
stat show a diffstat at the end of the merge
n,no-stat don't show a diffstat at the end of the merge
+log add list of one-line log to merge commit message
+no-log don't add list of one-line log to merge commit message
squash create a single commit instead of doing a merge
commit perform a commit if the merge sucesses (default)
ff allow fast forward (default)
@@ -37,7 +39,7 @@ use_strategies=
allow_fast_forward=t
allow_trivial_merge=t
-squash= no_commit=
+squash= no_commit= log_arg=
dropsave() {
rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
@@ -152,6 +154,8 @@ parse_config () {
show_diffstat=false ;;
--stat|--summary)
show_diffstat=t ;;
+ --log|--no-log)
+ log_arg=$1 ;;
--squash)
test "$allow_fast_forward" = t ||
die "You cannot combine --squash with --no-ff."
@@ -259,7 +263,7 @@ else
merge_name=$(for remote
do
merge_name "$remote"
- done | git fmt-merge-msg
+ done | git fmt-merge-msg $log_arg
)
merge_msg="${merge_msg:+$merge_msg$LF$LF}$merge_name"
fi
diff --git a/git-pull.sh b/git-pull.sh
index ed83ce1..bf0c298 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -16,7 +16,7 @@ cd_to_toplevel
test -z "$(git ls-files -u)" ||
die "You are in the middle of a conflicted merge."
-strategy_args= no_stat= no_commit= squash= no_ff=
+strategy_args= no_stat= no_commit= squash= no_ff= log_arg=
curr_branch=$(git symbolic-ref -q HEAD)
curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||")
rebase=$(git config --bool branch.$curr_branch_short.rebase)
@@ -27,6 +27,8 @@ do
no_stat=-n ;;
--stat|--summary)
no_stat=$1 ;;
+ --log|--no-log)
+ log_arg=$1 ;;
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
no_commit=--no-commit ;;
--c|--co|--com|--comm|--commi|--commit)
@@ -170,9 +172,9 @@ then
exit
fi
-merge_name=$(git fmt-merge-msg <"$GIT_DIR/FETCH_HEAD") || exit
+merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit
test true = "$rebase" &&
exec git-rebase $strategy_args --onto $merge_head \
${oldremoteref:-$merge_head}
-exec git-merge $no_stat $no_commit $squash $no_ff $strategy_args \
+exec git-merge $no_stat $no_commit $squash $no_ff $log_arg $strategy_args \
"$merge_name" HEAD $merge_head
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 1d323ec..dd1b2d7 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() {
@@ -441,6 +445,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
--
1.5.5.rc3.9.gba703
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 6/6] merge: remove deprecated summary and diffstat options and config variables
2008-04-06 1:23 ` [PATCH 5/6] merge, pull: add '--(no-)log' command line option SZEDER Gábor
@ 2008-04-06 1:23 ` SZEDER Gábor
0 siblings, 0 replies; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-06 1:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Jeff King, Teemu Likonen, SZEDER Gábor
Also remove them from 'pull' and 'fmt-merge-msg'.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
builtin-fmt-merge-msg.c | 12 +++---------
git-merge.sh | 5 ++---
git-pull.sh | 4 ++--
3 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c
index d49f545..0bf87c1 100644
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
@@ -12,12 +12,7 @@ static int merge_summary;
static int fmt_merge_msg_config(const char *key, const char *value)
{
- static int found_merge_log = 0;
- if (!strcmp("merge.log", key)) {
- found_merge_log = 1;
- merge_summary = git_config_bool(key, value);
- }
- if (!found_merge_log && !strcmp("merge.summary", key))
+ if (!strcmp("merge.log", key))
merge_summary = git_config_bool(key, value);
return 0;
}
@@ -255,10 +250,9 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
git_config(fmt_merge_msg_config);
while (argc > 1) {
- if (!strcmp(argv[1], "--log") || !strcmp(argv[1], "--summary"))
+ if (!strcmp(argv[1], "--log"))
merge_summary = 1;
- else if (!strcmp(argv[1], "--no-log")
- || !strcmp(argv[1], "--no-summary"))
+ else if (!strcmp(argv[1], "--no-log"))
merge_summary = 0;
else if (!strcmp(argv[1], "-F") || !strcmp(argv[1], "--file")) {
if (argc < 3)
diff --git a/git-merge.sh b/git-merge.sh
index a903e2b..db79851 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -150,9 +150,9 @@ merge_name () {
parse_config () {
while test $# != 0; do
case "$1" in
- -n|--no-stat|--no-summary)
+ -n|--no-stat)
show_diffstat=false ;;
- --stat|--summary)
+ --stat)
show_diffstat=t ;;
--log|--no-log)
log_arg=$1 ;;
@@ -213,7 +213,6 @@ parse_config "$@"
while test $args_left -lt $#; do shift; done
if test -z "$show_diffstat"; then
- test "$(git config --bool merge.diffstat)" = false && show_diffstat=false
test "$(git config --bool merge.stat)" = false && show_diffstat=false
test -z "$show_diffstat" && show_diffstat=t
fi
diff --git a/git-pull.sh b/git-pull.sh
index bf0c298..11d37a6 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -23,9 +23,9 @@ rebase=$(git config --bool branch.$curr_branch_short.rebase)
while :
do
case "$1" in
- -n|--no-stat|--no-summary)
+ -n|--no-stat)
no_stat=-n ;;
- --stat|--summary)
+ --stat)
no_stat=$1 ;;
--log|--no-log)
log_arg=$1 ;;
--
1.5.5.rc3.9.gba703
^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH 2/6] merge, pull: introduce '--(no-)stat' option
2008-04-06 1:23 ` [PATCH 2/6] merge, pull: introduce '--(no-)stat' option SZEDER Gábor
2008-04-06 1:23 ` [PATCH 3/6] add 'merge.stat' config variable SZEDER Gábor
@ 2008-04-06 2:36 ` Junio C Hamano
2008-04-16 0:38 ` [PATCH v2 00/12] merge summary and diffstat options cleanup SZEDER Gábor
1 sibling, 1 reply; 32+ messages in thread
From: Junio C Hamano @ 2008-04-06 2:36 UTC (permalink / raw)
To: SZEDER Gábor; +Cc: git, Jeff King, Teemu Likonen
SZEDER Gábor <szeder@ira.uka.de> writes:
> '--(no-)summary' options are still accepted, but are not advertised.
Given that...
> diff --git a/git-merge.sh b/git-merge.sh
> index 7dbbb1d..1b693ad 100755
> --- a/git-merge.sh
> +++ b/git-merge.sh
> @@ -8,8 +8,8 @@ OPTIONS_SPEC="\
> git-merge [options] <remote>...
> git-merge [options] <msg> HEAD <remote>
> --
> -summary show a diffstat at the end of the merge
> -n,no-summary don't show a diffstat at the end of the merge
> +stat show a diffstat at the end of the merge
> +n,no-stat don't show a diffstat at the end of the merge
> squash create a single commit instead of doing a merge
> commit perform a commit if the merge sucesses (default)
> ff allow fast forward (default)
...this hunk removes the original options from OPTIONS_SPEC, I suspect you
would get "unknown option 'stat'" from underlying "git rev-parse --parseopt".
You probably haven't noticed the breakage because you replaced all
existing --summary with --stat in the tests, though. Oops.
We would want to take a three-stage approach where we (1) start accepting
both forms without changing the official names shown to the users, (2)
deprecate the old names and make the new ones official, and then (3)
finally remove the old ones. Your 2 thru 5 roll (1) and (2) into one
step.
I would not have major problem with this "hasty deprecation" in "usage"
strings, but I find it somewhat problematic to stop mentioning the old
names in the documentation and bash completion from day one. People learn
old names elsewhere (e.g. in somebody's blog entry) and then try to find
the description in their manual and they are already removed from your
copy. Oops.
So I pretty much prefer to have an explicit deprecation period where both
forms are not just accepted but described as equals, but with the older
ones marked clearly as deprecated and planned for removal, so that people
would know what is going on.
Other than that, the rest of the series looked Ok from my cursory review.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH] merge, pull: introduce '--diffstat' option
2008-04-05 18:51 ` Junio C Hamano
2008-04-06 1:23 ` [PATCH 0/6] merge summary and diffstat options cleanup SZEDER Gábor
@ 2008-04-06 13:53 ` Jeff King
2008-04-06 14:37 ` Jakub Narebski
1 sibling, 1 reply; 32+ messages in thread
From: Jeff King @ 2008-04-06 13:53 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Teemu Likonen, git, SZEDER Gábor
On Sat, Apr 05, 2008 at 11:51:51AM -0700, Junio C Hamano wrote:
> I'd favor, in the longer run:
>
> * --stat option to mean "show the diffstat between ORIG_HEAD and merge
> result" (i.e. current --summary);
>
> * perhaps a new configuration merge.stat to control the default for the
> above;
>
> * merge.log configuration to mean "add list of one-line log to the merge
> commit message" (i.e. current merge.summary);
>
> * perhaps a --log option to override the config default for each
> invocation.
>
> * deprecate --summary and merge.summary and remove them long after people
> are used to the above new set.
I'll add a belated "yes I agree" to this. This is what I was trying to
describe earlier in the thread, but for some reason couldn't think of
the obvious name "log" to replace merge.summary. :)
-Peff
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH] merge, pull: introduce '--diffstat' option
2008-04-06 13:53 ` [PATCH] merge, pull: introduce '--diffstat' option Jeff King
@ 2008-04-06 14:37 ` Jakub Narebski
0 siblings, 0 replies; 32+ messages in thread
From: Jakub Narebski @ 2008-04-06 14:37 UTC (permalink / raw)
To: git
Jeff King wrote:
> On Sat, Apr 05, 2008 at 11:51:51AM -0700, Junio C Hamano wrote:
>> * perhaps a --log option to override the config default for each
>> invocation.
[...]
>
> I'll add a belated "yes I agree" to this. This is what I was trying to
> describe earlier in the thread, but for some reason couldn't think of
> the obvious name "log" to replace merge.summary. :)
It looks more like --shortlog, by the way...
(Stupid backwards compatibility...)
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2 00/12] merge summary and diffstat options cleanup
2008-04-06 2:36 ` [PATCH 2/6] merge, pull: introduce '--(no-)stat' option Junio C Hamano
@ 2008-04-16 0:38 ` SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 01/12] doc: moved merge.* config variables into separate merge-config.txt SZEDER Gábor
2008-04-16 4:23 ` [PATCH v2 00/12] merge summary and diffstat options cleanup Junio C Hamano
0 siblings, 2 replies; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:38 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
On Sat, Apr 05, 2008 at 07:36:57PM -0700, Junio C Hamano wrote:
> ...this hunk removes the original options from OPTIONS_SPEC, I suspect you
> would get "unknown option 'stat'" from underlying "git rev-parse --parseopt".
>
> You probably haven't noticed the breakage because you replaced all
> existing --summary with --stat in the tests, though. Oops.
It was not clear to me that this OPTIONS_SPEC is used for parsing,
too. This series fixes the problem.
> We would want to take a three-stage approach where we (1) start accepting
> both forms without changing the official names shown to the users, (2)
> deprecate the old names and make the new ones official, and then (3)
> finally remove the old ones. Your 2 thru 5 roll (1) and (2) into one
> step.
>
> I would not have major problem with this "hasty deprecation" in "usage"
> strings, but I find it somewhat problematic to stop mentioning the old
> names in the documentation and bash completion from day one. People learn
> old names elsewhere (e.g. in somebody's blog entry) and then try to find
> the description in their manual and they are already removed from your
> copy. Oops.
Yeah, you are right that deprecated options should not be removed from
the documentation.
However, I think that rolling (1) and (2) into one step is better than
having them separate. If we have the two steps separate will also
cause confusion, as users learning merge & co. between (1) and (2)
might wonder, why are there two options for the same thing and which
one should they prefer. They might even suspect that one of the
options will be deprecated in the future, but they will not be able to
tell which without looking at e.g. the mailing list archives. I would
also prefer to remove the deprecated options and config variables from
bash completion, because their users will then notice earlier that the
options are deprecated.
But anyway, in this patch series steps (1) and (2) are split into
separate set of patches, so you can decide to have steps (1) and (2)
separately or not.
The first six patches are adding the new options and config variables
to merge, pull, and fmt-merge-msg, but are not deprecating the old
ones. They are also updating documentation, tests, and bash
completion accordingly. (Patches 1 and 4 are independent cleanups
that could be merged regardless of the other patches, but the others
are depending on them.)
Patches 7-9 are marking the old options and config variables as
deprecated.
And finally, patches 10-12 are removing all the deprecated stuff, but
they are there only for illustration purposes at the moment, to see
how things will look like after the deprecation period.
SZEDER Gábor (12):
doc: moved merge.* config variables into separate merge-config.txt
merge, pull: introduce '--(no-)stat' options
add 'merge.stat' config variable
t6200-fmt-merge-msg: put expected messages into different files
fmt-merge-msg: add '--(no-)log' options and 'merge.log' config
variable
merge, pull: add '--(no-)log' command line option
merge, pull: mark '--(no-)summary' options as deprecated
merge, pull: mark the config variable 'merge.diffstat' as deprecated
fmt-merge-msg: mark summary-related option and config variable as
deprecated
merge, pull: remove deprecated '--(no-)summary' options
merge, pull: remove deprecated 'merge.diffstat' config variable
fmt-merge-msg: remove deprecated summary-related options and config
variable
Documentation/config.txt | 32 +------------------
Documentation/git-fmt-merge-msg.txt | 10 +++---
Documentation/git-merge.txt | 17 ++--------
Documentation/merge-config.txt | 35 ++++++++++++++++++++
Documentation/merge-options.txt | 15 +++++++--
builtin-fmt-merge-msg.c | 8 ++--
contrib/completion/git-completion.bash | 6 ++-
git-merge.sh | 18 ++++++----
git-pull.sh | 20 ++++++------
t/t6200-fmt-merge-msg.sh | 54 ++++++++++++++++++++++++-------
t/t7600-merge.sh | 24 +++++++++++---
11 files changed, 146 insertions(+), 93 deletions(-)
create mode 100644 Documentation/merge-config.txt
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2 01/12] doc: moved merge.* config variables into separate merge-config.txt
2008-04-16 0:38 ` [PATCH v2 00/12] merge summary and diffstat options cleanup SZEDER Gábor
@ 2008-04-16 0:39 ` SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 02/12] merge, pull: introduce '--(no-)stat' options SZEDER Gábor
2008-04-16 4:23 ` [PATCH v2 00/12] merge summary and diffstat options cleanup Junio C Hamano
1 sibling, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
Include the new file from config.txt and git-merge.txt.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/config.txt | 32 +-------------------------------
Documentation/git-merge.txt | 13 +------------
Documentation/merge-config.txt | 31 +++++++++++++++++++++++++++++++
3 files changed, 33 insertions(+), 43 deletions(-)
create mode 100644 Documentation/merge-config.txt
diff --git a/Documentation/config.txt b/Documentation/config.txt
index fe43b12..bef6127 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -768,37 +768,7 @@ man.viewer::
Specify the programs that may be used to display help in the
'man' format. See linkgit:git-help[1].
-merge.summary::
- Whether to include summaries of merged commits in newly created
- merge commit messages. False by default.
-
-merge.tool::
- Controls which merge resolution program is used by
- linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3",
- "tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and
- "opendiff". Any other value is treated is custom merge tool
- and there must be a corresponing mergetool.<tool>.cmd option.
-
-merge.verbosity::
- Controls the amount of output shown by the recursive merge
- strategy. Level 0 outputs nothing except a final error
- message if conflicts were detected. Level 1 outputs only
- conflicts, 2 outputs conflicts and file changes. Level 5 and
- above outputs debugging information. The default is level 2.
- Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable.
-
-merge.<driver>.name::
- Defines a human readable name for a custom low-level
- merge driver. See linkgit:gitattributes[5] for details.
-
-merge.<driver>.driver::
- Defines the command that implements a custom low-level
- merge driver. See linkgit:gitattributes[5] for details.
-
-merge.<driver>.recursive::
- Names a low-level merge driver to be used when
- performing an internal merge between common ancestors.
- See linkgit:gitattributes[5] for details.
+include::merge-config.txt[]
mergetool.<tool>.path::
Override the path for the given tool. This is useful in case
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index c136b10..821e21b 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -46,18 +46,7 @@ linkgit:git-reset[1].
CONFIGURATION
-------------
-
-merge.summary::
- Whether to include summaries of merged commits in newly
- created merge commit. False by default.
-
-merge.verbosity::
- Controls the amount of output shown by the recursive merge
- strategy. Level 0 outputs nothing except a final error
- message if conflicts were detected. Level 1 outputs only
- conflicts, 2 outputs conflicts and file changes. Level 5 and
- above outputs debugging information. The default is level 2.
- Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable.
+include::merge-config.txt[]
branch.<name>.mergeoptions::
Sets default options for merging into branch <name>. The syntax and
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
new file mode 100644
index 0000000..cc815cc
--- /dev/null
+++ b/Documentation/merge-config.txt
@@ -0,0 +1,31 @@
+merge.summary::
+ Whether to include summaries of merged commits in newly created
+ merge commit messages. False by default.
+
+merge.tool::
+ Controls which merge resolution program is used by
+ linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3",
+ "tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and
+ "opendiff". Any other value is treated is custom merge tool
+ and there must be a corresponing mergetool.<tool>.cmd option.
+
+merge.verbosity::
+ Controls the amount of output shown by the recursive merge
+ strategy. Level 0 outputs nothing except a final error
+ message if conflicts were detected. Level 1 outputs only
+ conflicts, 2 outputs conflicts and file changes. Level 5 and
+ above outputs debugging information. The default is level 2.
+ Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable.
+
+merge.<driver>.name::
+ Defines a human readable name for a custom low-level
+ merge driver. See linkgit:gitattributes[5] for details.
+
+merge.<driver>.driver::
+ Defines the command that implements a custom low-level
+ merge driver. See linkgit:gitattributes[5] for details.
+
+merge.<driver>.recursive::
+ Names a low-level merge driver to be used when
+ performing an internal merge between common ancestors.
+ See linkgit:gitattributes[5] for details.
--
1.5.5.76.g546c
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH v2 02/12] merge, pull: introduce '--(no-)stat' options
2008-04-16 0:39 ` [PATCH v2 01/12] doc: moved merge.* config variables into separate merge-config.txt SZEDER Gábor
@ 2008-04-16 0:39 ` SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 03/12] add 'merge.stat' config variable SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
These options have the same effect as the current '--(no-)summary'
options (i.e. whether to show a diffsat at the end of the merge or not),
and are consistent with the '--stat' option of other git commands.
Documentation, tests, and bash completion are updated accordingly.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/git-merge.txt | 4 ++--
Documentation/merge-options.txt | 4 ++--
contrib/completion/git-completion.bash | 2 +-
git-merge.sh | 10 ++++++----
git-pull.sh | 16 +++++++---------
t/t7600-merge.sh | 21 ++++++++++++++++++---
6 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 821e21b..c514e3b 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -9,8 +9,8 @@ git-merge - Join two or more development histories together
SYNOPSIS
--------
[verse]
-'git-merge' [-n] [--summary] [--no-commit] [--squash] [-s <strategy>]...
- [-m <msg>] <remote> <remote>...
+'git-merge' [-n | --no-stat | --no-summary] [--stat | --summary] [--no-commit]
+ [--squash] [-s <strategy>]... [-m <msg>] <remote> <remote>...
'git-merge' <msg> HEAD <remote>...
DESCRIPTION
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 9f1fc82..c82bc7e 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -1,8 +1,8 @@
---summary::
+--stat, \--summary::
Show a diffstat at the end of the merge. The diffstat is also
controlled by the configuration option merge.diffstat.
--n, \--no-summary::
+-n, \--no-stat, \--no-summary::
Do not show diffstat at the end of the merge.
--no-commit::
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 4d81963..5221a1a 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -779,7 +779,7 @@ _git_merge ()
;;
--*)
__gitcomp "
- --no-commit --no-summary --squash --strategy
+ --no-commit --no-stat --no-summary --squash --strategy
"
return
esac
diff --git a/git-merge.sh b/git-merge.sh
index 7dbbb1d..cda78de 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -8,8 +8,10 @@ OPTIONS_SPEC="\
git-merge [options] <remote>...
git-merge [options] <msg> HEAD <remote>
--
-summary show a diffstat at the end of the merge
-n,no-summary don't show a diffstat at the end of the merge
+stat show a diffstat at the end of the merge
+n,no-stat don't show a diffstat at the end of the merge
+summary equivalent to --stat
+no-summary equivalent to --no-stat
squash create a single commit instead of doing a merge
commit perform a commit if the merge sucesses (default)
ff allow fast forward (default)
@@ -148,9 +150,9 @@ merge_name () {
parse_config () {
while test $# != 0; do
case "$1" in
- -n|--no-summary)
+ -n|--no-stat|--no-summary)
show_diffstat=false ;;
- --summary)
+ --stat|--summary)
show_diffstat=t ;;
--squash)
test "$allow_fast_forward" = t ||
diff --git a/git-pull.sh b/git-pull.sh
index 3ce32b5..0bac8ae 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -4,7 +4,7 @@
#
# Fetch one or more remote refs and merge it/them into the current HEAD.
-USAGE='[-n | --no-summary] [--[no-]commit] [--[no-]squash] [--[no-]ff] [-s strategy]... [<fetch-options>] <repo> <head>...'
+USAGE='[-n | --no-stat | --no-summary] [--[no-]commit] [--[no-]squash] [--[no-]ff] [-s strategy]... [<fetch-options>] <repo> <head>...'
LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.'
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=
@@ -16,19 +16,17 @@ cd_to_toplevel
test -z "$(git ls-files -u)" ||
die "You are in the middle of a conflicted merge."
-strategy_args= no_summary= no_commit= squash= no_ff=
+strategy_args= no_stat= no_commit= squash= no_ff=
curr_branch=$(git symbolic-ref -q HEAD)
curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||")
rebase=$(git config --bool branch.$curr_branch_short.rebase)
while :
do
case "$1" in
- -n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\
- --no-summa|--no-summar|--no-summary)
- no_summary=-n ;;
- --summary)
- no_summary=$1
- ;;
+ -n|--no-stat|--no-summary)
+ no_stat=-n ;;
+ --stat|--summary)
+ no_stat=$1 ;;
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
no_commit=--no-commit ;;
--c|--co|--com|--comm|--commi|--commit)
@@ -176,5 +174,5 @@ merge_name=$(git fmt-merge-msg <"$GIT_DIR/FETCH_HEAD") || exit
test true = "$rebase" &&
exec git-rebase $strategy_args --onto $merge_head \
${oldremoteref:-$merge_head}
-exec git-merge $no_summary $no_commit $squash $no_ff $strategy_args \
+exec git-merge $no_stat $no_commit $squash $no_ff $strategy_args \
"$merge_name" HEAD $merge_head
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 56869ac..e5b48fb 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -364,7 +364,22 @@ 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 --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"
+ fi
+'
+
+test_debug 'gitk --all'
+
+test_expect_success 'override config option -n with --summary' '
git reset --hard c1 &&
git config branch.master.mergeoptions "-n" &&
test_tick &&
@@ -379,9 +394,9 @@ test_expect_success 'override config option -n' '
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 &&
--
1.5.5.76.g546c
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH v2 03/12] add 'merge.stat' config variable
2008-04-16 0:39 ` [PATCH v2 02/12] merge, pull: introduce '--(no-)stat' options SZEDER Gábor
@ 2008-04-16 0:39 ` SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 04/12] t6200-fmt-merge-msg: put expected messages into different files SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
This config variable has the same effect as the current
'merge.diffstat', but its name is consistent with the related command
line option.
Update documentation and bash completion accordingly.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/merge-config.txt | 5 +++++
Documentation/merge-options.txt | 3 ++-
contrib/completion/git-completion.bash | 1 +
git-merge.sh | 1 +
4 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
index cc815cc..15efc0d 100644
--- a/Documentation/merge-config.txt
+++ b/Documentation/merge-config.txt
@@ -1,3 +1,8 @@
+merge.stat::
+merge.diffstat::
+ Whether to print the diffstat berween ORIG_HEAD and merge result
+ at the end of the merge. True by default.
+
merge.summary::
Whether to include summaries of merged commits in newly created
merge commit messages. False by default.
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index c82bc7e..9c46dcb 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -1,6 +1,7 @@
--stat, \--summary::
Show a diffstat at the end of the merge. The diffstat is also
- controlled by the configuration option merge.diffstat.
+ controlled by the configuration option merge.stat (and the
+ equivalent merge.diffstat).
-n, \--no-stat, \--no-summary::
Do not show diffstat at the end of the merge.
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 5221a1a..4caff8d 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1022,6 +1022,7 @@ _git_config ()
i18n.logOutputEncoding
log.showroot
merge.tool
+ merge.stat
merge.summary
merge.verbosity
pack.window
diff --git a/git-merge.sh b/git-merge.sh
index cda78de..a29a7ec 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -212,6 +212,7 @@ while test $args_left -lt $#; do shift; done
if test -z "$show_diffstat"; then
test "$(git config --bool merge.diffstat)" = false && show_diffstat=false
+ test "$(git config --bool merge.stat)" = false && show_diffstat=false
test -z "$show_diffstat" && show_diffstat=t
fi
--
1.5.5.76.g546c
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH v2 04/12] t6200-fmt-merge-msg: put expected messages into different files
2008-04-16 0:39 ` [PATCH v2 03/12] add 'merge.stat' config variable SZEDER Gábor
@ 2008-04-16 0:39 ` SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 05/12] fmt-merge-msg: add '--(no-)log' options and 'merge.log' config variable SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
t/t6200-fmt-merge-msg.sh | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index 526d7d1..1af3ab2 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -69,7 +69,7 @@ test_expect_success setup '
git show-branch
'
-cat >expected <<\EOF
+cat >msg.left.nolog <<\EOF
Merge branch 'left'
EOF
@@ -79,10 +79,10 @@ test_expect_success 'merge-msg test #1' '
git fetch . left &&
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
- git diff actual expected
+ git diff actual msg.left.nolog
'
-cat >expected <<\EOF
+cat >msg.left_trash <<\EOF
Merge branch 'left' of ../trash
EOF
@@ -92,10 +92,10 @@ test_expect_success 'merge-msg test #2' '
git fetch ../trash left &&
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
- git diff actual expected
+ git diff actual msg.left_trash
'
-cat >expected <<\EOF
+cat >msg.left.log <<\EOF
Merge branch 'left'
* left:
@@ -115,10 +115,10 @@ test_expect_success 'merge-msg test #3' '
git fetch . left &&
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
- git diff actual expected
+ git diff actual msg.left.log
'
-cat >expected <<\EOF
+cat >msg.left_right.log <<\EOF
Merge branches 'left' and 'right'
* left:
@@ -145,7 +145,7 @@ test_expect_success 'merge-msg test #4' '
git fetch . left right &&
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
- git diff actual expected
+ git diff actual msg.left_right.log
'
test_expect_success 'merge-msg test #5' '
@@ -157,7 +157,7 @@ test_expect_success 'merge-msg test #5' '
git fetch . left right &&
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
- git diff actual expected
+ git diff actual msg.left_right.log
'
test_done
--
1.5.5.76.g546c
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH v2 05/12] fmt-merge-msg: add '--(no-)log' options and 'merge.log' config variable
2008-04-16 0:39 ` [PATCH v2 04/12] t6200-fmt-merge-msg: put expected messages into different files SZEDER Gábor
@ 2008-04-16 0:39 ` SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 06/12] merge, pull: add '--(no-)log' command line option SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
These options and config variable have the same effect as the current
'--(no-)summary' options and 'merge.summary' config variable.
'merge.log' takes precedence over 'merge.summary'.
Documentation and bash completion are updated accordingly. Tests are
also updated and new tests are added to ensure that the command line
options are working properly and are overriding the config variables.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/git-fmt-merge-msg.txt | 7 ++++-
Documentation/merge-config.txt | 1 +
builtin-fmt-merge-msg.c | 14 ++++++++---
contrib/completion/git-completion.bash | 1 +
t/t6200-fmt-merge-msg.sh | 40 ++++++++++++++++++++++++++++++-
5 files changed, 55 insertions(+), 8 deletions(-)
diff --git a/Documentation/git-fmt-merge-msg.txt b/Documentation/git-fmt-merge-msg.txt
index 8615ae3..cd441c5 100644
--- a/Documentation/git-fmt-merge-msg.txt
+++ b/Documentation/git-fmt-merge-msg.txt
@@ -9,8 +9,8 @@ git-fmt-merge-msg - Produce a merge commit message
SYNOPSIS
--------
[verse]
-git-fmt-merge-msg [--summary | --no-summary] <$GIT_DIR/FETCH_HEAD
-git-fmt-merge-msg [--summary | --no-summary] -F <file>
+git-fmt-merge-msg [--[no-]log | --[no-]summary] <$GIT_DIR/FETCH_HEAD
+git-fmt-merge-msg [--[no-]log | --[no-]summary] -F <file>
DESCRIPTION
-----------
@@ -24,11 +24,13 @@ automatically invoking `git-merge`.
OPTIONS
-------
+--log::
--summary::
In addition to branch names, populate the log message with
one-line descriptions from the actual commits that are being
merged.
+--no-log::
--no-summary::
Do not list one-line descriptions from the actual commits being
merged.
@@ -40,6 +42,7 @@ OPTIONS
CONFIGURATION
-------------
+merge.log::
merge.summary::
Whether to include summaries of merged commits in newly
merge commit messages. False by default.
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
index 15efc0d..a0f71e6 100644
--- a/Documentation/merge-config.txt
+++ b/Documentation/merge-config.txt
@@ -3,6 +3,7 @@ merge.diffstat::
Whether to print the diffstat berween ORIG_HEAD and merge result
at the end of the merge. True by default.
+merge.log::
merge.summary::
Whether to include summaries of merged commits in newly created
merge commit messages. False by default.
diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c
index ebb3f37..3df8ff8 100644
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
@@ -6,13 +6,18 @@
#include "tag.h"
static const char *fmt_merge_msg_usage =
- "git-fmt-merge-msg [--summary] [--no-summary] [--file <file>]";
+ "git-fmt-merge-msg [--log | --summary] [--no-log | --no-summary] [--file <file>]";
static int merge_summary;
static int fmt_merge_msg_config(const char *key, const char *value)
{
- if (!strcmp("merge.summary", key))
+ static int found_merge_log = 0;
+ if (!strcmp("merge.log", key)) {
+ found_merge_log = 1;
+ merge_summary = git_config_bool(key, value);
+ }
+ if (!found_merge_log && !strcmp("merge.summary", key))
merge_summary = git_config_bool(key, value);
return 0;
}
@@ -250,9 +255,10 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
git_config(fmt_merge_msg_config);
while (argc > 1) {
- if (!strcmp(argv[1], "--summary"))
+ if (!strcmp(argv[1], "--log") || !strcmp(argv[1], "--summary"))
merge_summary = 1;
- else if (!strcmp(argv[1], "--no-summary"))
+ else if (!strcmp(argv[1], "--no-log")
+ || !strcmp(argv[1], "--no-summary"))
merge_summary = 0;
else if (!strcmp(argv[1], "-F") || !strcmp(argv[1], "--file")) {
if (argc < 3)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 4caff8d..276a984 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1023,6 +1023,7 @@ _git_config ()
log.showroot
merge.tool
merge.stat
+ merge.log
merge.summary
merge.verbosity
pack.window
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index 1af3ab2..20704eb 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -138,7 +138,8 @@ EOF
test_expect_success 'merge-msg test #4' '
- git config merge.summary true &&
+ git config --unset merge.summary &&
+ git config merge.log true &&
git checkout master &&
setdate &&
@@ -150,7 +151,7 @@ test_expect_success 'merge-msg test #4' '
test_expect_success 'merge-msg test #5' '
- git config merge.summary yes &&
+ git config merge.log yes &&
git checkout master &&
setdate &&
@@ -160,4 +161,39 @@ test_expect_success 'merge-msg test #5' '
git diff actual msg.left_right.log
'
+test_expect_success 'merge-msg command line options #1' '
+ git config --unset merge.log &&
+
+ git checkout master &&
+ setdate &&
+ git fetch . left &&
+
+ git fmt-merge-msg <.git/FETCH_HEAD >actual &&
+ git diff actual msg.left.nolog
+'
+
+test_expect_success 'merge-msg command line options #2' '
+ git fmt-merge-msg --log <.git/FETCH_HEAD >actual &&
+ git diff actual msg.left.log
+'
+
+test_expect_success 'merge-msg command line options #3' '
+ git fmt-merge-msg --summary <.git/FETCH_HEAD >actual &&
+ git diff actual msg.left.log
+'
+
+test_expect_success 'merge-msg command line option overrides config #1' '
+ git config merge.log true &&
+
+ git fmt-merge-msg --no-log <.git/FETCH_HEAD >actual &&
+ git diff actual msg.left.nolog
+'
+
+test_expect_success 'merge-msg command line option overrides config #2' '
+ git config merge.log false &&
+
+ git fmt-merge-msg --log <.git/FETCH_HEAD >actual &&
+ git diff actual msg.left.log
+'
+
test_done
--
1.5.5.76.g546c
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH v2 06/12] merge, pull: add '--(no-)log' command line option
2008-04-16 0:39 ` [PATCH v2 05/12] fmt-merge-msg: add '--(no-)log' options and 'merge.log' config variable SZEDER Gábor
@ 2008-04-16 0:39 ` SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 07/12] merge, pull: mark '--(no-)summary' options as deprecated SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
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 <szeder@ira.uka.de>
---
Documentation/merge-options.txt | 9 +++++++++
contrib/completion/git-completion.bash | 3 ++-
git-merge.sh | 8 ++++++--
git-pull.sh | 8 +++++---
t/t7600-merge.sh | 16 +++++++++++++++-
5 files changed, 37 insertions(+), 7 deletions(-)
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 9c46dcb..41ef152 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -6,6 +6,15 @@
-n, \--no-stat, \--no-summary::
Do not show diffstat at the end of the merge.
+--log::
+ In addition to branch names, populate the log message with
+ one-line descriptions from the actual commits that are being
+ merged.
+
+--no-log::
+ Do not list one-line descriptions from the actual commits being
+ merged.
+
--no-commit::
Perform the merge but pretend the merge failed and do
not autocommit, to give the user a chance to inspect and
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 276a984..ef7bf44 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -779,7 +779,8 @@ _git_merge ()
;;
--*)
__gitcomp "
- --no-commit --no-stat --no-summary --squash --strategy
+ --no-commit --no-stat --no-summary --log --no-log
+ --squash --strategy
"
return
esac
diff --git a/git-merge.sh b/git-merge.sh
index a29a7ec..4cda3ec 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -12,6 +12,8 @@ stat show a diffstat at the end of the merge
n,no-stat don't show a diffstat at the end of the merge
summary equivalent to --stat
no-summary equivalent to --no-stat
+log add list of one-line log to merge commit message
+no-log don't add list of one-line log to merge commit message
squash create a single commit instead of doing a merge
commit perform a commit if the merge sucesses (default)
ff allow fast forward (default)
@@ -39,7 +41,7 @@ use_strategies=
allow_fast_forward=t
allow_trivial_merge=t
-squash= no_commit=
+squash= no_commit= log_arg=
dropsave() {
rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
@@ -154,6 +156,8 @@ parse_config () {
show_diffstat=false ;;
--stat|--summary)
show_diffstat=t ;;
+ --log|--no-log)
+ log_arg=$1 ;;
--squash)
test "$allow_fast_forward" = t ||
die "You cannot combine --squash with --no-ff."
@@ -261,7 +265,7 @@ else
merge_name=$(for remote
do
merge_name "$remote"
- done | git fmt-merge-msg
+ done | git fmt-merge-msg $log_arg
)
merge_msg="${merge_msg:+$merge_msg$LF$LF}$merge_name"
fi
diff --git a/git-pull.sh b/git-pull.sh
index 0bac8ae..e344afb 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -16,7 +16,7 @@ cd_to_toplevel
test -z "$(git ls-files -u)" ||
die "You are in the middle of a conflicted merge."
-strategy_args= no_stat= no_commit= squash= no_ff=
+strategy_args= no_stat= no_commit= squash= no_ff= log_arg=
curr_branch=$(git symbolic-ref -q HEAD)
curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||")
rebase=$(git config --bool branch.$curr_branch_short.rebase)
@@ -27,6 +27,8 @@ do
no_stat=-n ;;
--stat|--summary)
no_stat=$1 ;;
+ --log|--no-log)
+ log_arg=$1 ;;
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
no_commit=--no-commit ;;
--c|--co|--com|--comm|--commi|--commit)
@@ -170,9 +172,9 @@ then
exit
fi
-merge_name=$(git fmt-merge-msg <"$GIT_DIR/FETCH_HEAD") || exit
+merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit
test true = "$rebase" &&
exec git-rebase $strategy_args --onto $merge_head \
${oldremoteref:-$merge_head}
-exec git-merge $no_stat $no_commit $squash $no_ff $strategy_args \
+exec git-merge $no_stat $no_commit $squash $no_ff $log_arg $strategy_args \
"$merge_name" HEAD $merge_head
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index e5b48fb..6680321 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
--
1.5.5.76.g546c
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH v2 07/12] merge, pull: mark '--(no-)summary' options as deprecated
2008-04-16 0:39 ` [PATCH v2 06/12] merge, pull: add '--(no-)log' command line option SZEDER Gábor
@ 2008-04-16 0:39 ` SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 08/12] merge, pull: mark the config variable 'merge.diffstat' " SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
Also remove them from bash completion.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/git-merge.txt | 4 ++--
Documentation/merge-options.txt | 10 ++++++++--
contrib/completion/git-completion.bash | 2 +-
git-merge.sh | 4 ++--
4 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index c514e3b..2f9edd8 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -9,8 +9,8 @@ git-merge - Join two or more development histories together
SYNOPSIS
--------
[verse]
-'git-merge' [-n | --no-stat | --no-summary] [--stat | --summary] [--no-commit]
- [--squash] [-s <strategy>]... [-m <msg>] <remote> <remote>...
+'git-merge' [-n | --no-stat] [--stat] [--no-commit] [--squash]
+ [-s <strategy>]... [-m <msg>] <remote> <remote>...
'git-merge' <msg> HEAD <remote>...
DESCRIPTION
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 41ef152..d0a2ac9 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -1,11 +1,17 @@
---stat, \--summary::
+--stat::
Show a diffstat at the end of the merge. The diffstat is also
controlled by the configuration option merge.stat (and the
equivalent merge.diffstat).
--n, \--no-stat, \--no-summary::
+-n, \--no-stat::
Do not show diffstat at the end of the merge.
+--summary::
+ Deprecated equivalent of --stat.
+
+--no-summary::
+ Deprecated equivalent of --no-stat.
+
--log::
In addition to branch names, populate the log message with
one-line descriptions from the actual commits that are being
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index ef7bf44..adc1a75 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -779,7 +779,7 @@ _git_merge ()
;;
--*)
__gitcomp "
- --no-commit --no-stat --no-summary --log --no-log
+ --no-commit --no-stat --log --no-log
--squash --strategy
"
return
diff --git a/git-merge.sh b/git-merge.sh
index 4cda3ec..f0b764f 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -10,8 +10,8 @@ git-merge [options] <msg> HEAD <remote>
--
stat show a diffstat at the end of the merge
n,no-stat don't show a diffstat at the end of the merge
-summary equivalent to --stat
-no-summary equivalent to --no-stat
+summary deprecated equivalent of --stat
+no-summary deprecated equivalent of --no-stat
log add list of one-line log to merge commit message
no-log don't add list of one-line log to merge commit message
squash create a single commit instead of doing a merge
--
1.5.5.76.g546c
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH v2 08/12] merge, pull: mark the config variable 'merge.diffstat' as deprecated
2008-04-16 0:39 ` [PATCH v2 07/12] merge, pull: mark '--(no-)summary' options as deprecated SZEDER Gábor
@ 2008-04-16 0:39 ` SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 09/12] fmt-merge-msg: mark summary-related option and config variable " SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/merge-config.txt | 4 +++-
Documentation/merge-options.txt | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
index a0f71e6..5000162 100644
--- a/Documentation/merge-config.txt
+++ b/Documentation/merge-config.txt
@@ -1,8 +1,10 @@
merge.stat::
-merge.diffstat::
Whether to print the diffstat berween ORIG_HEAD and merge result
at the end of the merge. True by default.
+merge.diffstat::
+ Deprecated equivalent of merge.stat.
+
merge.log::
merge.summary::
Whether to include summaries of merged commits in newly created
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index d0a2ac9..f282556 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -1,7 +1,7 @@
--stat::
Show a diffstat at the end of the merge. The diffstat is also
controlled by the configuration option merge.stat (and the
- equivalent merge.diffstat).
+ deprecated merge.diffstat).
-n, \--no-stat::
Do not show diffstat at the end of the merge.
--
1.5.5.76.g546c
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH v2 09/12] fmt-merge-msg: mark summary-related option and config variable as deprecated
2008-04-16 0:39 ` [PATCH v2 08/12] merge, pull: mark the config variable 'merge.diffstat' " SZEDER Gábor
@ 2008-04-16 0:39 ` SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 10/12] merge, pull: remove deprecated '--(no-)summary' options SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/git-fmt-merge-msg.txt | 16 +++++++++++-----
Documentation/merge-config.txt | 4 +++-
builtin-fmt-merge-msg.c | 2 +-
contrib/completion/git-completion.bash | 1 -
t/t6200-fmt-merge-msg.sh | 2 +-
5 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/Documentation/git-fmt-merge-msg.txt b/Documentation/git-fmt-merge-msg.txt
index cd441c5..6e23e6c 100644
--- a/Documentation/git-fmt-merge-msg.txt
+++ b/Documentation/git-fmt-merge-msg.txt
@@ -9,8 +9,8 @@ git-fmt-merge-msg - Produce a merge commit message
SYNOPSIS
--------
[verse]
-git-fmt-merge-msg [--[no-]log | --[no-]summary] <$GIT_DIR/FETCH_HEAD
-git-fmt-merge-msg [--[no-]log | --[no-]summary] -F <file>
+git-fmt-merge-msg [--[no-]log] <$GIT_DIR/FETCH_HEAD
+git-fmt-merge-msg [--[no-]log] -F <file>
DESCRIPTION
-----------
@@ -25,16 +25,20 @@ OPTIONS
-------
--log::
---summary::
In addition to branch names, populate the log message with
one-line descriptions from the actual commits that are being
merged.
--no-log::
---no-summary::
Do not list one-line descriptions from the actual commits being
merged.
+--summary::
+ Deprecated equivalent of --log.
+
+--no-summary::
+ Deprecated equivalent of --no-log.
+
--file <file>, -F <file>::
Take the list of merged objects from <file> instead of
stdin.
@@ -43,10 +47,12 @@ CONFIGURATION
-------------
merge.log::
-merge.summary::
Whether to include summaries of merged commits in newly
merge commit messages. False by default.
+merge.summary::
+ Deprecated equivalent of merge.log.
+
SEE ALSO
--------
linkgit:git-merge[1]
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
index 5000162..45b107d 100644
--- a/Documentation/merge-config.txt
+++ b/Documentation/merge-config.txt
@@ -6,10 +6,12 @@ merge.diffstat::
Deprecated equivalent of merge.stat.
merge.log::
-merge.summary::
Whether to include summaries of merged commits in newly created
merge commit messages. False by default.
+merge.summary::
+ Deprecated equivalent of merge.log.
+
merge.tool::
Controls which merge resolution program is used by
linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3",
diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c
index 3df8ff8..d49f545 100644
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
@@ -6,7 +6,7 @@
#include "tag.h"
static const char *fmt_merge_msg_usage =
- "git-fmt-merge-msg [--log | --summary] [--no-log | --no-summary] [--file <file>]";
+ "git-fmt-merge-msg [--log] [--no-log] [--file <file>]";
static int merge_summary;
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index adc1a75..49ada35 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1025,7 +1025,6 @@ _git_config ()
merge.tool
merge.stat
merge.log
- merge.summary
merge.verbosity
pack.window
pack.depth
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index 20704eb..926ca50 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -177,7 +177,7 @@ test_expect_success 'merge-msg command line options #2' '
git diff actual msg.left.log
'
-test_expect_success 'merge-msg command line options #3' '
+test_expect_success 'merge-msg deprecated command line options' '
git fmt-merge-msg --summary <.git/FETCH_HEAD >actual &&
git diff actual msg.left.log
'
--
1.5.5.76.g546c
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH v2 10/12] merge, pull: remove deprecated '--(no-)summary' options
2008-04-16 0:39 ` [PATCH v2 09/12] fmt-merge-msg: mark summary-related option and config variable " SZEDER Gábor
@ 2008-04-16 0:39 ` SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 11/12] merge, pull: remove deprecated 'merge.diffstat' config variable SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
Also remove related test.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/merge-options.txt | 6 ------
git-merge.sh | 6 ++----
git-pull.sh | 4 ++--
t/t7600-merge.sh | 15 ---------------
4 files changed, 4 insertions(+), 27 deletions(-)
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index f282556..f22fc6e 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -6,12 +6,6 @@
-n, \--no-stat::
Do not show diffstat at the end of the merge.
---summary::
- Deprecated equivalent of --stat.
-
---no-summary::
- Deprecated equivalent of --no-stat.
-
--log::
In addition to branch names, populate the log message with
one-line descriptions from the actual commits that are being
diff --git a/git-merge.sh b/git-merge.sh
index f0b764f..263b337 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -10,8 +10,6 @@ git-merge [options] <msg> HEAD <remote>
--
stat show a diffstat at the end of the merge
n,no-stat don't show a diffstat at the end of the merge
-summary deprecated equivalent of --stat
-no-summary deprecated equivalent of --no-stat
log add list of one-line log to merge commit message
no-log don't add list of one-line log to merge commit message
squash create a single commit instead of doing a merge
@@ -152,9 +150,9 @@ merge_name () {
parse_config () {
while test $# != 0; do
case "$1" in
- -n|--no-stat|--no-summary)
+ -n|--no-stat)
show_diffstat=false ;;
- --stat|--summary)
+ --stat)
show_diffstat=t ;;
--log|--no-log)
log_arg=$1 ;;
diff --git a/git-pull.sh b/git-pull.sh
index e344afb..d1edb9c 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -23,9 +23,9 @@ rebase=$(git config --bool branch.$curr_branch_short.rebase)
while :
do
case "$1" in
- -n|--no-stat|--no-summary)
+ -n|--no-stat)
no_stat=-n ;;
- --stat|--summary)
+ --stat)
no_stat=$1 ;;
--log|--no-log)
log_arg=$1 ;;
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 6680321..6fc626e 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -383,21 +383,6 @@ test_expect_success 'override config option -n with --stat' '
test_debug 'gitk --all'
-test_expect_success 'override config option -n with --summary' '
- git reset --hard c1 &&
- git config branch.master.mergeoptions "-n" &&
- test_tick &&
- git merge --summary 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"
- fi
-'
-
-test_debug 'gitk --all'
-
test_expect_success 'override config option --stat' '
git reset --hard c1 &&
git config branch.master.mergeoptions "--stat" &&
--
1.5.5.76.g546c
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH v2 11/12] merge, pull: remove deprecated 'merge.diffstat' config variable
2008-04-16 0:39 ` [PATCH v2 10/12] merge, pull: remove deprecated '--(no-)summary' options SZEDER Gábor
@ 2008-04-16 0:39 ` SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 12/12] fmt-merge-msg: remove deprecated summary-related options and " SZEDER Gábor
0 siblings, 1 reply; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/merge-config.txt | 3 ---
Documentation/merge-options.txt | 3 +--
git-merge.sh | 1 -
3 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
index 45b107d..896f914 100644
--- a/Documentation/merge-config.txt
+++ b/Documentation/merge-config.txt
@@ -2,9 +2,6 @@ merge.stat::
Whether to print the diffstat berween ORIG_HEAD and merge result
at the end of the merge. True by default.
-merge.diffstat::
- Deprecated equivalent of merge.stat.
-
merge.log::
Whether to include summaries of merged commits in newly created
merge commit messages. False by default.
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index f22fc6e..0333913 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -1,7 +1,6 @@
--stat::
Show a diffstat at the end of the merge. The diffstat is also
- controlled by the configuration option merge.stat (and the
- deprecated merge.diffstat).
+ controlled by the configuration option merge.stat.
-n, \--no-stat::
Do not show diffstat at the end of the merge.
diff --git a/git-merge.sh b/git-merge.sh
index 263b337..db79851 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -213,7 +213,6 @@ parse_config "$@"
while test $args_left -lt $#; do shift; done
if test -z "$show_diffstat"; then
- test "$(git config --bool merge.diffstat)" = false && show_diffstat=false
test "$(git config --bool merge.stat)" = false && show_diffstat=false
test -z "$show_diffstat" && show_diffstat=t
fi
--
1.5.5.76.g546c
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH v2 12/12] fmt-merge-msg: remove deprecated summary-related options and config variable
2008-04-16 0:39 ` [PATCH v2 11/12] merge, pull: remove deprecated 'merge.diffstat' config variable SZEDER Gábor
@ 2008-04-16 0:39 ` SZEDER Gábor
0 siblings, 0 replies; 32+ messages in thread
From: SZEDER Gábor @ 2008-04-16 0:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, SZEDER Gábor
Also remove related test.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
Documentation/git-fmt-merge-msg.txt | 9 ---------
Documentation/merge-config.txt | 3 ---
builtin-fmt-merge-msg.c | 12 +++---------
t/t6200-fmt-merge-msg.sh | 8 +-------
4 files changed, 4 insertions(+), 28 deletions(-)
diff --git a/Documentation/git-fmt-merge-msg.txt b/Documentation/git-fmt-merge-msg.txt
index 6e23e6c..4d0ca4c 100644
--- a/Documentation/git-fmt-merge-msg.txt
+++ b/Documentation/git-fmt-merge-msg.txt
@@ -33,12 +33,6 @@ OPTIONS
Do not list one-line descriptions from the actual commits being
merged.
---summary::
- Deprecated equivalent of --log.
-
---no-summary::
- Deprecated equivalent of --no-log.
-
--file <file>, -F <file>::
Take the list of merged objects from <file> instead of
stdin.
@@ -50,9 +44,6 @@ merge.log::
Whether to include summaries of merged commits in newly
merge commit messages. False by default.
-merge.summary::
- Deprecated equivalent of merge.log.
-
SEE ALSO
--------
linkgit:git-merge[1]
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
index 896f914..9719311 100644
--- a/Documentation/merge-config.txt
+++ b/Documentation/merge-config.txt
@@ -6,9 +6,6 @@ merge.log::
Whether to include summaries of merged commits in newly created
merge commit messages. False by default.
-merge.summary::
- Deprecated equivalent of merge.log.
-
merge.tool::
Controls which merge resolution program is used by
linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3",
diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c
index d49f545..0bf87c1 100644
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
@@ -12,12 +12,7 @@ static int merge_summary;
static int fmt_merge_msg_config(const char *key, const char *value)
{
- static int found_merge_log = 0;
- if (!strcmp("merge.log", key)) {
- found_merge_log = 1;
- merge_summary = git_config_bool(key, value);
- }
- if (!found_merge_log && !strcmp("merge.summary", key))
+ if (!strcmp("merge.log", key))
merge_summary = git_config_bool(key, value);
return 0;
}
@@ -255,10 +250,9 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
git_config(fmt_merge_msg_config);
while (argc > 1) {
- if (!strcmp(argv[1], "--log") || !strcmp(argv[1], "--summary"))
+ if (!strcmp(argv[1], "--log"))
merge_summary = 1;
- else if (!strcmp(argv[1], "--no-log")
- || !strcmp(argv[1], "--no-summary"))
+ else if (!strcmp(argv[1], "--no-log"))
merge_summary = 0;
else if (!strcmp(argv[1], "-F") || !strcmp(argv[1], "--file")) {
if (argc < 3)
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index 926ca50..d844661 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -108,7 +108,7 @@ EOF
test_expect_success 'merge-msg test #3' '
- git config merge.summary true &&
+ git config merge.log true &&
git checkout master &&
setdate &&
@@ -138,7 +138,6 @@ EOF
test_expect_success 'merge-msg test #4' '
- git config --unset merge.summary &&
git config merge.log true &&
git checkout master &&
@@ -177,11 +176,6 @@ test_expect_success 'merge-msg command line options #2' '
git diff actual msg.left.log
'
-test_expect_success 'merge-msg deprecated command line options' '
- git fmt-merge-msg --summary <.git/FETCH_HEAD >actual &&
- git diff actual msg.left.log
-'
-
test_expect_success 'merge-msg command line option overrides config #1' '
git config merge.log true &&
--
1.5.5.76.g546c
^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH v2 00/12] merge summary and diffstat options cleanup
2008-04-16 0:38 ` [PATCH v2 00/12] merge summary and diffstat options cleanup SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 01/12] doc: moved merge.* config variables into separate merge-config.txt SZEDER Gábor
@ 2008-04-16 4:23 ` Junio C Hamano
1 sibling, 0 replies; 32+ messages in thread
From: Junio C Hamano @ 2008-04-16 4:23 UTC (permalink / raw)
To: SZEDER Gábor; +Cc: git
SZEDER Gábor <szeder@ira.uka.de> writes:
> On Sat, Apr 05, 2008 at 07:36:57PM -0700, Junio C Hamano wrote:
>> ...this hunk removes the original options from OPTIONS_SPEC, I suspect you
>> would get "unknown option 'stat'" from underlying "git rev-parse --parseopt".
>>
>> You probably haven't noticed the breakage because you replaced all
>> existing --summary with --stat in the tests, though. Oops.
> It was not clear to me that this OPTIONS_SPEC is used for parsing,
> too. This series fixes the problem.
The previous one already is on 'next'. If you have anything new to add,
please improve upon them incrementally.
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2008-04-16 4:24 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-03 9:03 [PATCH 0/2] merge --summary vs. merge.summary SZEDER Gábor
2008-04-03 9:03 ` [PATCH 1/2] merge, pull: rename '--summary' option to '--diffstat' SZEDER Gábor
2008-04-03 9:03 ` [PATCH 2/2] merge, pull: add option to put summary into the merge commit message SZEDER Gábor
2008-04-03 10:30 ` [PATCH 0/2] merge --summary vs. merge.summary Jeff King
2008-04-03 11:03 ` SZEDER Gábor
2008-04-05 14:48 ` [PATCH] merge, pull: introduce '--diffstat' option SZEDER Gábor
2008-04-05 15:35 ` Teemu Likonen
2008-04-05 18:51 ` Junio C Hamano
2008-04-06 1:23 ` [PATCH 0/6] merge summary and diffstat options cleanup SZEDER Gábor
2008-04-06 1:23 ` [PATCH 1/6] doc: moved merge.* config variables into separate merge-config.txt SZEDER Gábor
2008-04-06 1:23 ` [PATCH 2/6] merge, pull: introduce '--(no-)stat' option SZEDER Gábor
2008-04-06 1:23 ` [PATCH 3/6] add 'merge.stat' config variable SZEDER Gábor
2008-04-06 1:23 ` [PATCH 4/6] fmt-merge-msg: add '--(no-)log' options and 'merge.log' " SZEDER Gábor
2008-04-06 1:23 ` [PATCH 5/6] merge, pull: add '--(no-)log' command line option SZEDER Gábor
2008-04-06 1:23 ` [PATCH 6/6] merge: remove deprecated summary and diffstat options and config variables SZEDER Gábor
2008-04-06 2:36 ` [PATCH 2/6] merge, pull: introduce '--(no-)stat' option Junio C Hamano
2008-04-16 0:38 ` [PATCH v2 00/12] merge summary and diffstat options cleanup SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 01/12] doc: moved merge.* config variables into separate merge-config.txt SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 02/12] merge, pull: introduce '--(no-)stat' options SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 03/12] add 'merge.stat' config variable SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 04/12] t6200-fmt-merge-msg: put expected messages into different files SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 05/12] fmt-merge-msg: add '--(no-)log' options and 'merge.log' config variable SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 06/12] merge, pull: add '--(no-)log' command line option SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 07/12] merge, pull: mark '--(no-)summary' options as deprecated SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 08/12] merge, pull: mark the config variable 'merge.diffstat' " SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 09/12] fmt-merge-msg: mark summary-related option and config variable " SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 10/12] merge, pull: remove deprecated '--(no-)summary' options SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 11/12] merge, pull: remove deprecated 'merge.diffstat' config variable SZEDER Gábor
2008-04-16 0:39 ` [PATCH v2 12/12] fmt-merge-msg: remove deprecated summary-related options and " SZEDER Gábor
2008-04-16 4:23 ` [PATCH v2 00/12] merge summary and diffstat options cleanup Junio C Hamano
2008-04-06 13:53 ` [PATCH] merge, pull: introduce '--diffstat' option Jeff King
2008-04-06 14:37 ` Jakub Narebski
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).