* [PATCH] stash show: use default pretty format
@ 2012-01-12 7:05 Tay Ray Chuan
2012-01-12 19:06 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Tay Ray Chuan @ 2012-01-12 7:05 UTC (permalink / raw
To: Git Mailing List; +Cc: Junio C Hamano
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] stash show: use default pretty format
2012-01-12 7:05 [PATCH] stash show: use default pretty format Tay Ray Chuan
@ 2012-01-12 19:06 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2012-01-12 19:06 UTC (permalink / raw
To: Tay Ray Chuan; +Cc: Git Mailing List
Tay Ray Chuan <rctay89@gmail.com> writes:
> 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.
A handful of issues:
- The stash entries, unlike the usual commits you store on branches and
inspect with "show", are designed to be quick escapes for emergency
interruption, and "--stat" is a good default to remind the user what
she was working on before she was interrupted _without_ scrolling the
top of the screen away by showing the full diff. Careful design
decisions far outweigh mechanical application of "consistency for the
sake of consistency".
- What does "pretty.format" has anything to do with "stash"?
- If it does, why doesn't the script read from it?
- How does this justify the UI regression for people who are used to the
good default "--stat" they have been seeing?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-12 19:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-12 7:05 [PATCH] stash show: use default pretty format Tay Ray Chuan
2012-01-12 19:06 ` Junio C Hamano
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).