git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] disable merge summaries if they are disabled
@ 2007-05-23 15:28 Alex Riesen
  2007-05-23 16:03 ` Alex Riesen
  2007-05-23 18:22 ` Junio C Hamano
  0 siblings, 2 replies; 9+ messages in thread
From: Alex Riesen @ 2007-05-23 15:28 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano

[-- Attachment #1: Type: text/plain, Size: 136 bytes --]

Otherwise the merge.summary option has no visible effect.

---
 git-merge.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

[-- Attachment #2: 0001-disable-merge-summaries-if-the-are-disabled.txt --]
[-- Type: text/plain, Size: 617 bytes --]

From 20ef81ca3b30a4c96906b3512ca1b52d2bec3698 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@gmail.com>
Date: Wed, 23 May 2007 15:52:16 +0200
Subject: [PATCH] disable merge summaries if they are disabled

---
 git-merge.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/git-merge.sh b/git-merge.sh
index 351676f..7fbe03a 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -121,6 +121,7 @@ merge_name () {
 case "$#" in 0) usage ;; esac
 
 have_message=
+test $(git-config merge.summary) = false && no_summary=t
 while case "$#" in 0) break ;; esac
 do
 	case "$1" in
-- 
1.5.2.784.gb18c


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] disable merge summaries if they are disabled
  2007-05-23 15:28 [PATCH] disable merge summaries if they are disabled Alex Riesen
@ 2007-05-23 16:03 ` Alex Riesen
  2007-05-23 18:22 ` Junio C Hamano
  1 sibling, 0 replies; 9+ messages in thread
From: Alex Riesen @ 2007-05-23 16:03 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

Otherwise the merge.summary option has no visible effect.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>

---

Forgot the sign-off.

 git-merge.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

[-- Attachment #2: 0001-disable-merge-summaries-if-the-are-disabled.txt --]
[-- Type: text/plain, Size: 666 bytes --]

From 20ef81ca3b30a4c96906b3512ca1b52d2bec3698 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@gmail.com>
Date: Wed, 23 May 2007 15:52:16 +0200
Subject: [PATCH] disable merge summaries if they are disabled

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 git-merge.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/git-merge.sh b/git-merge.sh
index 351676f..7fbe03a 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -121,6 +121,7 @@ merge_name () {
 case "$#" in 0) usage ;; esac
 
 have_message=
+test $(git-config merge.summary) = false && no_summary=t
 while case "$#" in 0) break ;; esac
 do
 	case "$1" in
-- 
1.5.2.787.g56770


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] disable merge summaries if they are disabled
  2007-05-23 15:28 [PATCH] disable merge summaries if they are disabled Alex Riesen
  2007-05-23 16:03 ` Alex Riesen
@ 2007-05-23 18:22 ` Junio C Hamano
  2007-05-23 19:58   ` Alex Riesen
  1 sibling, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2007-05-23 18:22 UTC (permalink / raw)
  To: Alex Riesen; +Cc: Git Mailing List

"Alex Riesen" <raa.lkml@gmail.com> writes:

> Otherwise the merge.summary option has no visible effect.

I suspect you are mistaking a different merge summary.  The
option affects fmt-merge-msg, iow, the shortlog looking summary
that appears as the commit message in a merge commit.

The command line parameter --no-summary inhibits the diffstat
given to the terminal after "git-pull/git-merge" is made.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] disable merge summaries if they are disabled
  2007-05-23 18:22 ` Junio C Hamano
@ 2007-05-23 19:58   ` Alex Riesen
  2007-05-23 20:02     ` [PATCH] Add a configuration option to control diffstat after merge Alex Riesen
  2007-05-23 20:03     ` [PATCH] disable merge summaries if they are disabled Junio C Hamano
  0 siblings, 2 replies; 9+ messages in thread
From: Alex Riesen @ 2007-05-23 19:58 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

Junio C Hamano, Wed, May 23, 2007 20:22:57 +0200:
> "Alex Riesen" <raa.lkml@gmail.com> writes:
> 
> > Otherwise the merge.summary option has no visible effect.
> 
> I suspect you are mistaking a different merge summary.  The
> option affects fmt-merge-msg, iow, the shortlog looking summary
> that appears as the commit message in a merge commit.
> 
> The command line parameter --no-summary inhibits the diffstat
> given to the terminal after "git-pull/git-merge" is made.
> 

I did it again, didn't I?! :)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] Add a configuration option to control diffstat after merge
  2007-05-23 19:58   ` Alex Riesen
@ 2007-05-23 20:02     ` Alex Riesen
  2007-05-23 20:18       ` Junio C Hamano
  2007-05-23 20:03     ` [PATCH] disable merge summaries if they are disabled Junio C Hamano
  1 sibling, 1 reply; 9+ messages in thread
From: Alex Riesen @ 2007-05-23 20:02 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

The diffstat can be controlled either with command-line options
(--summary|--no-summary) or with merge.diffstat. The default is
left as it was: diffstat is active by default.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---

I have to explain the implementation a bit: in Windows, every exec is
*very* expensive, so I tried to avoid a call to git-config as long as
possible. The stupid OS is my reason for this change, actually:
diffstat not just takes too long. It also takes a *long* while before
the diffstat even starts!

 Documentation/git-merge.txt     |    2 +-
 Documentation/merge-options.txt |    4 ++++
 git-merge.sh                    |   18 ++++++++++++------
 git-pull.sh                     |    3 +++
 4 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 9c08efa..912ef29 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] [--no-commit] [--squash] [-s <strategy>]...
+'git-merge' [-n] [--summary] [--no-commit] [--squash] [-s <strategy>]...
 	[-m <msg>] <remote> <remote>...
 
 DESCRIPTION
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 182cef5..56f1d8d 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -1,3 +1,7 @@
+--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.
 
diff --git a/git-merge.sh b/git-merge.sh
index 351676f..80f7de8 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -3,7 +3,7 @@
 # Copyright (c) 2005 Junio C Hamano
 #
 
-USAGE='[-n] [--no-commit] [--squash] [-s <strategy>] [-m=<merge-message>] <commit>+'
+USAGE='[-n] [--summary] [--no-commit] [--squash] [-s <strategy>] [-m=<merge-message>] <commit>+'
 
 SUBDIRECTORY_OK=Yes
 . git-sh-setup
@@ -88,12 +88,11 @@ finish () {
 	'')
 		;;
 	?*)
-		case "$no_summary" in
-		'')
+		if test "$show_diffstat" = t
+		then
 			# We want color (if set), but no pager
 			GIT_PAGER='' git-diff --stat --summary -M "$head" "$1"
-			;;
-		esac
+		fi
 		;;
 	esac
 }
@@ -126,7 +125,9 @@ do
 	case "$1" in
 	-n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\
 		--no-summa|--no-summar|--no-summary)
-		no_summary=t ;;
+		show_diffstat=false ;;
+	--summary)
+		show_diffstat=t ;;
 	--sq|--squ|--squa|--squas|--squash)
 		squash=t no_commit=t ;;
 	--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
@@ -168,6 +169,11 @@ do
 	shift
 done
 
+if test -z "$show_diffstat"; then
+    test "$(git-config merge.diffstat)" = false && show_diffstat=false
+    test -z "$show_diffstat" && show_diffstat=t
+fi
+
 # This could be traditional "merge <msg> HEAD <commit>..."  and the
 # way we can tell it is to see if the second token is HEAD, but some
 # people might have misused the interface and used a committish that
diff --git a/git-pull.sh b/git-pull.sh
index a3665d7..ba0ca07 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -22,6 +22,9 @@ do
 	-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
+		;;
 	--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
 		no_commit=--no-commit ;;
 	--sq|--squ|--squa|--squas|--squash)
-- 
1.5.2.36.g04e2-dirty

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] disable merge summaries if they are disabled
  2007-05-23 19:58   ` Alex Riesen
  2007-05-23 20:02     ` [PATCH] Add a configuration option to control diffstat after merge Alex Riesen
@ 2007-05-23 20:03     ` Junio C Hamano
  1 sibling, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2007-05-23 20:03 UTC (permalink / raw)
  To: Alex Riesen; +Cc: Git Mailing List

Alex Riesen <raa.lkml@gmail.com> writes:

> Junio C Hamano, Wed, May 23, 2007 20:22:57 +0200:
>> "Alex Riesen" <raa.lkml@gmail.com> writes:
>> 
>> > Otherwise the merge.summary option has no visible effect.
>> 
>> I suspect you are mistaking a different merge summary.  The
>> option affects fmt-merge-msg, iow, the shortlog looking summary
>> that appears as the commit message in a merge commit.
>> 
>> The command line parameter --no-summary inhibits the diffstat
>> given to the terminal after "git-pull/git-merge" is made.
>> 
>
> I did it again, didn't I?! :)

You could argue that it is not your fault but is a faulty and
misleading documentation, if you supply a patch to clarify it
;-).

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add a configuration option to control diffstat after merge
  2007-05-23 20:02     ` [PATCH] Add a configuration option to control diffstat after merge Alex Riesen
@ 2007-05-23 20:18       ` Junio C Hamano
  2007-05-23 20:43         ` Alex Riesen
  0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2007-05-23 20:18 UTC (permalink / raw)
  To: Alex Riesen; +Cc: Git Mailing List

Alex Riesen <raa.lkml@gmail.com> writes:

> The diffstat can be controlled either with command-line options
> (--summary|--no-summary) or with merge.diffstat. The default is
> left as it was: diffstat is active by default.
>
> Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
> ---
>
> I have to explain the implementation a bit: in Windows, every exec is
> *very* expensive, so I tried to avoid a call to git-config as long as
> possible. The stupid OS is my reason for this change, actually:
> diffstat not just takes too long. It also takes a *long* while before
> the diffstat even starts!

Even on Linux, if your project is well modularized and your
workflow is "merge small and merge often" like the kernel is, it
is not unusual that the final diffstat takes much longer than a
merge.  But the diffstat is not an eye-candy but is an important
safety measure from the workflow point of view.

> @@ -168,6 +169,11 @@ do
>  	shift
>  done
>  
> +if test -z "$show_diffstat"; then
> +    test "$(git-config merge.diffstat)" = false && show_diffstat=false
> +    test -z "$show_diffstat" && show_diffstat=t
> +fi

Isn't this hunk wrong?

[merge]
	diffstat = 0
        diffstat = false

should both mean "merge.diffstat is set to false".
"git config --bool" does that.

And when merge.diffstat does not appear in the configuration
file, "git config --bool merge.diffstat" exits non-zero.

if test -z "$show_diffstat"; then
    test "$(git-config --bool merge.diffstat)" = false && show_diffstat=false
    test -z "$show_diffstat" && show_diffstat=t
fi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add a configuration option to control diffstat after merge
  2007-05-23 20:18       ` Junio C Hamano
@ 2007-05-23 20:43         ` Alex Riesen
  2007-05-23 21:01           ` Alex Riesen
  0 siblings, 1 reply; 9+ messages in thread
From: Alex Riesen @ 2007-05-23 20:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

Junio C Hamano, Wed, May 23, 2007 22:18:05 +0200:
> Alex Riesen <raa.lkml@gmail.com> writes:
> 
> > The diffstat can be controlled either with command-line options
> > (--summary|--no-summary) or with merge.diffstat. The default is
> > left as it was: diffstat is active by default.
> >
> > Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
> > ---
> >
> > I have to explain the implementation a bit: in Windows, every exec is
> > *very* expensive, so I tried to avoid a call to git-config as long as
> > possible. The stupid OS is my reason for this change, actually:
> > diffstat not just takes too long. It also takes a *long* while before
> > the diffstat even starts!
> 
> Even on Linux, if your project is well modularized and your
> workflow is "merge small and merge often" like the kernel is, it
> is not unusual that the final diffstat takes much longer than a
> merge.  But the diffstat is not an eye-candy but is an important
> safety measure from the workflow point of view.

Can't have it on Windows. It makes me prefer git-am to git-merge.

> > @@ -168,6 +169,11 @@ do
> >  	shift
> >  done
> >  
> > +if test -z "$show_diffstat"; then
> > +    test "$(git-config merge.diffstat)" = false && show_diffstat=false
> > +    test -z "$show_diffstat" && show_diffstat=t
> > +fi
> 
> Isn't this hunk wrong?
> 

It is. Will resend in an hour, unless you beat me to it

> if test -z "$show_diffstat"; then
>     test "$(git-config --bool merge.diffstat)" = false && show_diffstat=false
>     test -z "$show_diffstat" && show_diffstat=t
> fi

Thanks!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] Add a configuration option to control diffstat after merge
  2007-05-23 20:43         ` Alex Riesen
@ 2007-05-23 21:01           ` Alex Riesen
  0 siblings, 0 replies; 9+ messages in thread
From: Alex Riesen @ 2007-05-23 21:01 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

The diffstat can be controlled either with command-line options
(--summary|--no-summary) or with merge.diffstat. The default is
left as it was: diffstat is active by default.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
Alex Riesen, Wed, May 23, 2007 22:43:12 +0200:
> > > +if test -z "$show_diffstat"; then
> > > +    test "$(git-config merge.diffstat)" = false && show_diffstat=false
> > > +    test -z "$show_diffstat" && show_diffstat=t
> > > +fi
> > 
> > Isn't this hunk wrong?
> > 
> 
> It is. Will resend in an hour, unless you beat me to it
> 
> > if test -z "$show_diffstat"; then
> >     test "$(git-config --bool merge.diffstat)" = false && show_diffstat=false
> >     test -z "$show_diffstat" && show_diffstat=t
> > fi
> 
> Thanks!
> 

 Documentation/git-merge.txt     |    2 +-
 Documentation/merge-options.txt |    4 ++++
 git-merge.sh                    |   18 ++++++++++++------
 git-pull.sh                     |    3 +++
 4 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 9c08efa..912ef29 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] [--no-commit] [--squash] [-s <strategy>]...
+'git-merge' [-n] [--summary] [--no-commit] [--squash] [-s <strategy>]...
 	[-m <msg>] <remote> <remote>...
 
 DESCRIPTION
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 182cef5..56f1d8d 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -1,3 +1,7 @@
+--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.
 
diff --git a/git-merge.sh b/git-merge.sh
index 351676f..44e9b70 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -3,7 +3,7 @@
 # Copyright (c) 2005 Junio C Hamano
 #
 
-USAGE='[-n] [--no-commit] [--squash] [-s <strategy>] [-m=<merge-message>] <commit>+'
+USAGE='[-n] [--summary] [--no-commit] [--squash] [-s <strategy>] [-m=<merge-message>] <commit>+'
 
 SUBDIRECTORY_OK=Yes
 . git-sh-setup
@@ -88,12 +88,11 @@ finish () {
 	'')
 		;;
 	?*)
-		case "$no_summary" in
-		'')
+		if test "$show_diffstat" = t
+		then
 			# We want color (if set), but no pager
 			GIT_PAGER='' git-diff --stat --summary -M "$head" "$1"
-			;;
-		esac
+		fi
 		;;
 	esac
 }
@@ -126,7 +125,9 @@ do
 	case "$1" in
 	-n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\
 		--no-summa|--no-summar|--no-summary)
-		no_summary=t ;;
+		show_diffstat=false ;;
+	--summary)
+		show_diffstat=t ;;
 	--sq|--squ|--squa|--squas|--squash)
 		squash=t no_commit=t ;;
 	--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
@@ -168,6 +169,11 @@ do
 	shift
 done
 
+if test -z "$show_diffstat"; then
+    test "$(git-config --bool merge.diffstat)" = false && show_diffstat=false
+    test -z "$show_diffstat" && show_diffstat=t
+fi
+
 # This could be traditional "merge <msg> HEAD <commit>..."  and the
 # way we can tell it is to see if the second token is HEAD, but some
 # people might have misused the interface and used a committish that
diff --git a/git-pull.sh b/git-pull.sh
index a3665d7..ba0ca07 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -22,6 +22,9 @@ do
 	-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
+		;;
 	--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
 		no_commit=--no-commit ;;
 	--sq|--squ|--squa|--squas|--squash)
-- 
1.5.2.67.gbd3c2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-05-23 21:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-23 15:28 [PATCH] disable merge summaries if they are disabled Alex Riesen
2007-05-23 16:03 ` Alex Riesen
2007-05-23 18:22 ` Junio C Hamano
2007-05-23 19:58   ` Alex Riesen
2007-05-23 20:02     ` [PATCH] Add a configuration option to control diffstat after merge Alex Riesen
2007-05-23 20:18       ` Junio C Hamano
2007-05-23 20:43         ` Alex Riesen
2007-05-23 21:01           ` Alex Riesen
2007-05-23 20:03     ` [PATCH] disable merge summaries if they are disabled Junio C Hamano

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 NNTP newsgroup(s).