[PATCH] stash: Utilize config variable pager.stash.list in stash list command

Subsystems: the rest

DORMANTno replies

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

[PATCH] stash: Utilize config variable pager.stash.list in stash list command

From: Ingo Brückl <hidden>
Date: 2016-06-15 22:51:49

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 <redacted>
---
 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

Re: [PATCH] stash: Utilize config variable pager.stash.list in stash list command

From: Ingo Brückl <hidden>
Date: 2016-06-15 22:51:49

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help