* [PATCH] stash: Utilize config variable pager.stash.list in stash list command
@ 2011-08-16 11:47 Ingo Brückl
2011-08-17 9:04 ` Ingo Brückl
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Brückl @ 2011-08-16 11:47 UTC (permalink / raw)
To: git
Usually it is annoying that the pager is used for stash list output,
so the config variable pager.stash.list will be utilized now and is
a way to control stash list's behavior.
Signed-off-by: Ingo Brückl <ib@wupperonline.de>
---
git-stash.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh
index f4e6f05..29702ab 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -264,7 +264,8 @@ have_stash () {
list_stash () {
have_stash || return 0
- git log --format="%gd: %gs" -g "$@" $ref_stash --
+ test "$(git config --get pager.stash.list)" = "false" && no_pager=--no-pager
+ git $no_pager log --format="%gd: %gs" -g "$@" $ref_stash --
}
show_stash () {
--
1.7.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] stash: Utilize config variable pager.stash.list in stash list command
2011-08-16 11:47 [PATCH] stash: Utilize config variable pager.stash.list in stash list command Ingo Brückl
@ 2011-08-17 9:04 ` Ingo Brückl
2011-08-17 18:44 ` Junio C Hamano
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Brückl @ 2011-08-17 9:04 UTC (permalink / raw)
To: git
Usually it is annoying that the pager is used for stash list output,
so the config variable pager.stash.list will be utilized now and is
a way to control stash list's behavior.
Signed-off-by: Ingo Brückl <ib@wupperonline.de>
---
This is the 2nd attempt, now checking for true and false.
git-stash.sh | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh
index f4e6f05..3712a17 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -264,7 +264,10 @@ have_stash () {
list_stash () {
have_stash || return 0
- git log --format="%gd: %gs" -g "$@" $ref_stash --
+ l_config=$(git config --get pager.stash.list)
+ test "$l_config" = "true" && p_option=--paginate
+ test "$l_config" = "false" && p_option=--no-pager
+ git $p_option log --format="%gd: %gs" -g "$@" $ref_stash --
}
show_stash () {
--
1.7.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] stash: Utilize config variable pager.stash.list in stash list command
2011-08-17 9:04 ` Ingo Brückl
@ 2011-08-17 18:44 ` Junio C Hamano
2011-08-18 4:26 ` Jeff King
0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2011-08-17 18:44 UTC (permalink / raw)
To: Ingo Brückl; +Cc: git
At least "pager.stash.list" should be spelled as "pager.stashList" or
something. It is not like there are multitude of arbigrary choices that
may match "pager.*.list" pattern.
Also a variable can be set to false by setting it to 0, no, etc., so you
need to inspect it with "git config --bool" to get the canonical version
of its value.
What's so difficult to say "git stash list | less" or even "git -p stash list"?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] stash: Utilize config variable pager.stash.list in stash list command
2011-08-17 18:44 ` Junio C Hamano
@ 2011-08-18 4:26 ` Jeff King
2011-08-18 7:55 ` Ingo Brückl
0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2011-08-18 4:26 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Ingo Brückl, git
On Wed, Aug 17, 2011 at 11:44:32AM -0700, Junio C Hamano wrote:
> At least "pager.stash.list" should be spelled as "pager.stashList" or
> something. It is not like there are multitude of arbigrary choices that
> may match "pager.*.list" pattern.
The pager code would then assume that was for a command "stashlist". It
probably doesn't matter in practice, but I think it's a little nicer to
keep the namespace properly separated unless there is a good reason not
to.
There are other places where something like this might be handy, too.
For example, auto-pagination of "git branch" or "git tag -l" (but you
wouldn't want to paginate "git branch foo").
> Also a variable can be set to false by setting it to 0, no, etc., so
> you need to inspect it with "git config --bool" to get the canonical
> version of its value.
>
> What's so difficult to say "git stash list | less" or even "git -p
> stash list"?
Couldn't one make the same argument about git's entire use of the pager?
Anyway, I think his problem is not "I want a pager but I am too lazy to
type it", but rather that "git stash list" will auto-paginate by
default, because it is chaining to "log", which auto-paginates. You can
turn it off with "--no-pager", but pager.stash seems to have no effect.
-Peff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] stash: Utilize config variable pager.stash.list in stash list command
2011-08-18 4:26 ` Jeff King
@ 2011-08-18 7:55 ` Ingo Brückl
0 siblings, 0 replies; 5+ messages in thread
From: Ingo Brückl @ 2011-08-18 7:55 UTC (permalink / raw)
To: git
Jeff King wrote on Wed, 17 Aug 2011 21:26:37 -0700:
> On Wed, Aug 17, 2011 at 11:44:32AM -0700, Junio C Hamano wrote:
>> What's so difficult to say "git stash list | less" or even "git -p
>> stash list"?
> Anyway, I think his problem is not "I want a pager but I am too lazy to
> type it", but rather that "git stash list" will auto-paginate by
> default, because it is chaining to "log", which auto-paginates. You can
> turn it off with "--no-pager", but pager.stash seems to have no effect.
I'd like to mention that in this particular case it is ok that stash
auto-paginates, it only is annoying that "stash list" does. And, Junio,
it is totally ok to say "git -p stash list" then, because this is exactely
what I'd do.
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-08-18 7:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-16 11:47 [PATCH] stash: Utilize config variable pager.stash.list in stash list command Ingo Brückl
2011-08-17 9:04 ` Ingo Brückl
2011-08-17 18:44 ` Junio C Hamano
2011-08-18 4:26 ` Jeff King
2011-08-18 7:55 ` Ingo Brückl
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.