git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tay Ray Chuan <rctay89@gmail.com>
To: "Git Mailing List" <git@vger.kernel.org>
Cc: "Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH] stash show: use default pretty format
Date: Thu, 12 Jan 2012 15:05:53 +0800	[thread overview]
Message-ID: <1326351953-3724-1-git-send-email-rctay89@gmail.com> (raw)

By default (ie. when stash show is invoked without any arguments), the
diff stat of the stashed changes is displayed. Let git-diff decide the
default pretty format to use.

This gives git more consistency, as users who have set their
pretty.format config would naturally expect `git-stash show` to display
the diff in the same pretty format as the other diff-producing procelain
like git-log and git-show.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 git-stash.sh     |    2 +-
 t/t3903-stash.sh |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-stash.sh b/git-stash.sh
index fe4ab28..a0db3de 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -271,7 +271,7 @@ list_stash () {
 show_stash () {
 	assert_stash_like "$@"
 
-	git diff ${FLAGS:---stat} $b_commit $w_commit
+	git diff ${FLAGS} $b_commit $w_commit
 }
 
 #
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index dbe2ac1..7a18af8 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -446,7 +446,7 @@ test_expect_success 'stash show - stashes on stack, stash-like argument' '
 	 file |    1 +
 	 1 files changed, 1 insertions(+), 0 deletions(-)
 	EOF
-	git stash show ${STASH_ID} >actual &&
+	git stash show --stat ${STASH_ID} >actual &&
 	test_cmp expected actual
 '
 
@@ -484,7 +484,7 @@ test_expect_success 'stash show - no stashes on stack, stash-like argument' '
 	 file |    1 +
 	 1 files changed, 1 insertions(+), 0 deletions(-)
 	EOF
-	git stash show ${STASH_ID} >actual &&
+	git stash show --stat ${STASH_ID} >actual &&
 	test_cmp expected actual
 '
 
-- 
1.7.9.rc0.132.ge406

             reply	other threads:[~2012-01-12  7:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12  7:05 Tay Ray Chuan [this message]
2012-01-12 19:06 ` [PATCH] stash show: use default pretty format Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1326351953-3724-1-git-send-email-rctay89@gmail.com \
    --to=rctay89@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).