{"thread":{"id":"28121","subject":"[PATCH] stash: Utilize config variable pager.stash.list in stash list command","startedAt":"2011-08-16T11:47:09Z","lastAt":"2011-08-18T07:55:37Z","messageCount":5,"participants":["Ingo Brückl","Junio C Hamano","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"173600","messageId":"4e4a58c2.48d6f6ce.bm001@wupperonline.de","threadId":"28121","inReplyTo":null,"subject":"[PATCH] stash: Utilize config variable pager.stash.list in stash list command","fromName":"Ingo Brückl","fromEmail":"ib@wupperonline.de","sentAt":"2011-08-16T11:47:09Z","receivedAt":"2011-08-16T11:47:09Z","isPatch":true,"sender":{"key":"ib@wupperonline.de","avatar":"https://avatars.githubusercontent.com/u/123327?v=4"},"body":"Usually it is annoying that the pager is used for stash list output,\nso the config variable pager.stash.list will be utilized now and is\na way to control stash list's behavior.\n\nSigned-off-by: Ingo Brückl <ib@wupperonline.de>\n---\n git-stash.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex f4e6f05..29702ab 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -264,7 +264,8 @@ have_stash () {\n\n list_stash () {\n \thave_stash || return 0\n-\tgit log --format=\"%gd: %gs\" -g \"$@\" $ref_stash --\n+\ttest \"$(git config --get pager.stash.list)\" = \"false\" && no_pager=--no-pager\n+\tgit $no_pager log --format=\"%gd: %gs\" -g \"$@\" $ref_stash --\n }\n\n show_stash () {\n--\n1.7.6\n"},{"id":"173666","messageId":"4e4b8418.068889fb.bm001@wupperonline.de","threadId":"28121","inReplyTo":"4e4a58c2.48d6f6ce.bm001@wupperonline.de","subject":"Re: [PATCH] stash: Utilize config variable pager.stash.list in stash list command","fromName":"Ingo Brückl","fromEmail":"ib@wupperonline.de","sentAt":"2011-08-17T09:04:23Z","receivedAt":"2011-08-17T09:04:23Z","isPatch":true,"sender":{"key":"ib@wupperonline.de","avatar":"https://avatars.githubusercontent.com/u/123327?v=4"},"body":"Usually it is annoying that the pager is used for stash list output,\nso the config variable pager.stash.list will be utilized now and is\na way to control stash list's behavior.\n\nSigned-off-by: Ingo Brückl <ib@wupperonline.de>\n---\n This is the 2nd attempt, now checking for true and false.\n\n git-stash.sh |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex f4e6f05..3712a17 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -264,7 +264,10 @@ have_stash () {\n\n list_stash () {\n \thave_stash || return 0\n-\tgit log --format=\"%gd: %gs\" -g \"$@\" $ref_stash --\n+\tl_config=$(git config --get pager.stash.list)\n+\ttest \"$l_config\" = \"true\" && p_option=--paginate\n+\ttest \"$l_config\" = \"false\" && p_option=--no-pager\n+\tgit $p_option log --format=\"%gd: %gs\" -g \"$@\" $ref_stash --\n }\n\n show_stash () {\n--\n1.7.6\n"},{"id":"173685","messageId":"7vd3g3ev3j.fsf@alter.siamese.dyndns.org","threadId":"28121","inReplyTo":"4e4b8418.068889fb.bm001@wupperonline.de","subject":"Re: [PATCH] stash: Utilize config variable pager.stash.list in stash list command","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-17T18:44:32Z","receivedAt":"2011-08-17T18:44:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"At least \"pager.stash.list\" should be spelled as \"pager.stashList\" or\nsomething. It is not like there are multitude of arbigrary choices that\nmay match \"pager.*.list\" pattern.\n\nAlso a variable can be set to false by setting it to 0, no, etc., so you\nneed to inspect it with \"git config --bool\" to get the canonical version\nof its value.\n\nWhat's so difficult to say \"git stash list | less\" or even \"git -p stash list\"?\n"},{"id":"173714","messageId":"20110818042620.GA19045@sigill.intra.peff.net","threadId":"28121","inReplyTo":"7vd3g3ev3j.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] stash: Utilize config variable pager.stash.list in stash list command","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-08-18T04:26:37Z","receivedAt":"2011-08-18T04:26:37Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 17, 2011 at 11:44:32AM -0700, Junio C Hamano wrote:\n\n> At least \"pager.stash.list\" should be spelled as \"pager.stashList\" or\n> something. It is not like there are multitude of arbigrary choices that\n> may match \"pager.*.list\" pattern.\n\nThe pager code would then assume that was for a command \"stashlist\". It\nprobably doesn't matter in practice, but I think it's a little nicer to\nkeep the namespace properly separated unless there is a good reason not\nto.\n\nThere are other places where something like this might be handy, too.\nFor example, auto-pagination of \"git branch\" or \"git tag -l\" (but you\nwouldn't want to paginate \"git branch foo\").\n\n> Also a variable can be set to false by setting it to 0, no, etc., so\n> you need to inspect it with \"git config --bool\" to get the canonical\n> version of its value.\n> \n> What's so difficult to say \"git stash list | less\" or even \"git -p\n> stash list\"?\n\nCouldn't one make the same argument about git's entire use of the pager?\n\nAnyway, I think his problem is not \"I want a pager but I am too lazy to\ntype it\", but rather that \"git stash list\" will auto-paginate by\ndefault, because it is chaining to \"log\", which auto-paginates. You can\nturn it off with \"--no-pager\", but pager.stash seems to have no effect.\n\n-Peff\n"},{"id":"173739","messageId":"4e4cc57e.51253792.bm000@wupperonline.de","threadId":"28121","inReplyTo":"20110818042620.GA19045@sigill.intra.peff.net","subject":"Re: [PATCH] stash: Utilize config variable pager.stash.list in stash list command","fromName":"Ingo Brückl","fromEmail":"ib@wupperonline.de","sentAt":"2011-08-18T07:55:37Z","receivedAt":"2011-08-18T07:55:37Z","isPatch":true,"sender":{"key":"ib@wupperonline.de","avatar":"https://avatars.githubusercontent.com/u/123327?v=4"},"body":"Jeff King wrote on Wed, 17 Aug 2011 21:26:37 -0700:\n\n> On Wed, Aug 17, 2011 at 11:44:32AM -0700, Junio C Hamano wrote:\n\n>> What's so difficult to say \"git stash list | less\" or even \"git -p\n>> stash list\"?\n\n> Anyway, I think his problem is not \"I want a pager but I am too lazy to\n> type it\", but rather that \"git stash list\" will auto-paginate by\n> default, because it is chaining to \"log\", which auto-paginates. You can\n> turn it off with \"--no-pager\", but pager.stash seems to have no effect.\n\nI'd like to mention that in this particular case it is ok that stash\nauto-paginates, it only is annoying that \"stash list\" does. And, Junio,\nit is totally ok to say \"git -p stash list\" then, because this is exactely\nwhat I'd do.\n\nIngo\n"}]}