Re: Add a "git show" command to show a commit

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: Add a "git show" command to show a commit

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:18

Linus Torvalds [off-list ref] writes:
It's basically just "git-diff-tree" with pretty flags and a pager.
Isn't this "git whatchanged -n1 --cc --always"?
It tries to have the same logic as "git diff" for the flags. 
Except that --cc does not make much sense without being -p, so
the logic to do --name-status and friends are pretty much
wasted, no?

Re: Add a "git show" command to show a commit

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:18


On Sun, 5 Feb 2006, Junio C Hamano wrote:
Isn't this "git whatchanged -n1 --cc --always"?
Getting closer, yes.

Especially these days that you can write "-1" instead of "--max-count=1", 
and if we make "--cc" the default for "git-whatchanged", I guess we could 
just drop this.
Except that --cc does not make much sense without being -p, so
the logic to do --name-status and friends are pretty much
wasted, no?
You're right. The "--cc" should be in the default flags (instead of -p), 
not unconditionally on the command line.

			Linus

Re: Add a "git show" command to show a commit

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:18


On Sun, 5 Feb 2006, Linus Torvalds wrote:
You're right. The "--cc" should be in the default flags (instead of -p), 
not unconditionally on the command line.
In that vein, for "git diff":

		Linus

----
diff --git a/git-diff.sh b/git-diff.sh
index 4812ae4..7b3dbe3 100755
--- a/git-diff.sh
+++ b/git-diff.sh
@@ -22,13 +22,13 @@ case "$rev" in
 	esac
 esac
 
-# If we do not have --name-status, --name-only nor -r, default to -p.
+# If we do not have --name-status, --name-only nor -r, default to --cc.
 # If we do not have -B nor -C, default to -M.
 case " $flags " in
 *" '--name-status' "* | *" '--name-only' "* | *" '-r' "* )
 	;;
 *)
-	flags="$flags'-p' " ;;
+	flags="$flags'--cc' " ;;
 esac
 case " $flags " in
 *" '-"[BCM]* | *" '--find-copies-harder' "*)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help