{"thread":{"id":"54316","subject":"[PATCH] git-completion.bash: stash-show: add --patch-with-stat","startedAt":"2020-09-28T11:13:16Z","lastAt":"2020-09-30T21:56:56Z","messageCount":6,"participants":["Robert Karszniewicz","Junio C Hamano","Denton Liu"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"406527","messageId":"20200928110517.24915-1-avoidr@posteo.de","threadId":"54316","inReplyTo":null,"subject":"[PATCH] git-completion.bash: stash-show: add --patch-with-stat","fromName":"Robert Karszniewicz","fromEmail":"avoidr@posteo.de","sentAt":"2020-09-28T11:05:17Z","receivedAt":"2020-09-28T11:13:16Z","isPatch":true,"sender":{"key":"avoidr@posteo.de","avatar":null},"body":"Signed-off-by: Robert Karszniewicz <avoidr@posteo.de>\n---\n contrib/completion/git-completion.bash | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 8be4a0316e..d98c731667 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -3016,7 +3016,10 @@ _git_stash ()\n \t\tlist,--*)\n \t\t\t__gitcomp \"--name-status --oneline --patch-with-stat\"\n \t\t\t;;\n-\t\tshow,--*|branch,--*)\n+\t\tshow,--*)\n+\t\t\t__gitcomp \"--patch-with-stat\"\n+\t\t\t;;\n+\t\tbranch,--*)\n \t\t\t;;\n \t\tbranch,*)\n \t\t\tif [ $cword -eq 3 ]; then\n-- \n2.28.0\n\n"},{"id":"406552","messageId":"xmqqh7rhn3nk.fsf@gitster.c.googlers.com","threadId":"54316","inReplyTo":"20200928110517.24915-1-avoidr@posteo.de","subject":"Re: [PATCH] git-completion.bash: stash-show: add --patch-with-stat","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-28T18:43:11Z","receivedAt":"2020-09-28T18:43:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robert Karszniewicz <avoidr@posteo.de> writes:\n\n> Signed-off-by: Robert Karszniewicz <avoidr@posteo.de>\n> ---\n>  contrib/completion/git-completion.bash | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n>\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 8be4a0316e..d98c731667 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -3016,7 +3016,10 @@ _git_stash ()\n>  \t\tlist,--*)\n>  \t\t\t__gitcomp \"--name-status --oneline --patch-with-stat\"\n>  \t\t\t;;\n> -\t\tshow,--*|branch,--*)\n> +\t\tshow,--*)\n> +\t\t\t__gitcomp \"--patch-with-stat\"\n> +\t\t\t;;\n\nWhy is --patch-with-stat so special?  \n\nWithout completion support for \"--patch\" and \"--stat\", typing\n\"--<TAB>\" after \"git stash show\" and seeing only \"--patch-with-stat\"\n(which has been made obsolete-but-still-kept synonym immediately\nafter the other two were invented in 2005) would make a rather\nsurprising experience to the end users.  For \"show\" alone, it may\nmake a lot of sense to complete \"git stash show -<TAB>\" and offer\n\"-p\".\n\nIn any case, it might make more sense to do this instead, and then\nrethink what options make sense to these subcommands of \"git stash\".\nI do not think patch-with-stat should be among them.\n\n-  \t\tlist,--*)\n+  \t\tlist,--* | show,--*)\n  \t\t\t__gitcomp \"--name-status --oneline --patch-with-stat\"\n\nThanks.\n"},{"id":"406620","messageId":"20200929062555.GA45164@generichostname","threadId":"54316","inReplyTo":"xmqqh7rhn3nk.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] git-completion.bash: stash-show: add --patch-with-stat","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2020-09-29T06:25:55Z","receivedAt":"2020-09-29T06:25:59Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Hi Junio,\n\nOn Mon, Sep 28, 2020 at 11:43:11AM -0700, Junio C Hamano wrote:\n> In any case, it might make more sense to do this instead, and then\n> rethink what options make sense to these subcommands of \"git stash\".\n> I do not think patch-with-stat should be among them.\n\nPerhaps it would make sense to add --patch and --no-patch to\n$__git_diff_common_options and then use that list for `git stash show`\nsince it's documented that all of the diff options are valid.\n\nThanks,\nDenton\n"},{"id":"406645","messageId":"20200929213154.GA18321@HP","threadId":"54316","inReplyTo":"xmqqh7rhn3nk.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] git-completion.bash: stash-show: add --patch-with-stat","fromName":"Robert Karszniewicz","fromEmail":"avoidr@posteo.de","sentAt":"2020-09-29T21:31:54Z","receivedAt":"2020-09-29T21:32:06Z","isPatch":true,"sender":{"key":"avoidr@posteo.de","avatar":null},"body":"On Mon, Sep 28, 2020 at 11:43:11AM -0700, Junio C Hamano wrote:\n> Robert Karszniewicz <avoidr@posteo.de> writes:\n> \n> > Signed-off-by: Robert Karszniewicz <avoidr@posteo.de>\n> > ---\n> >  contrib/completion/git-completion.bash | 5 ++++-\n> >  1 file changed, 4 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> > index 8be4a0316e..d98c731667 100644\n> > --- a/contrib/completion/git-completion.bash\n> > +++ b/contrib/completion/git-completion.bash\n> > @@ -3016,7 +3016,10 @@ _git_stash ()\n> >  \t\tlist,--*)\n> >  \t\t\t__gitcomp \"--name-status --oneline --patch-with-stat\"\n> >  \t\t\t;;\n> > -\t\tshow,--*|branch,--*)\n> > +\t\tshow,--*)\n> > +\t\t\t__gitcomp \"--patch-with-stat\"\n> > +\t\t\t;;\n> \n> Why is --patch-with-stat so special?  \n> \n> Without completion support for \"--patch\" and \"--stat\", typing\n> \"--<TAB>\" after \"git stash show\" and seeing only \"--patch-with-stat\"\n> (which has been made obsolete-but-still-kept synonym immediately\n> after the other two were invented in 2005) would make a rather\n\nOh, I didn't know --patch-with-stat was obsoleted. It was recently added\nto `stash-list`, too. I can as well use \"--patch --stat\".\n\n> surprising experience to the end users.  For \"show\" alone, it may\n> make a lot of sense to complete \"git stash show -<TAB>\" and offer\n> \"-p\".\n\nDoes git complete short options at all? I only see long options\ncompleted. (I'm also very new to bash-completion)\n\n> \n> In any case, it might make more sense to do this instead, and then\n> rethink what options make sense to these subcommands of \"git stash\".\n> I do not think patch-with-stat should be among them.\n\nSo shall I do a v2 as per your suggestion and replace\n\"--patch-with-stat\" with \"--patch --stat\"?\n\n> \n> -  \t\tlist,--*)\n> +  \t\tlist,--* | show,--*)\n>   \t\t\t__gitcomp \"--name-status --oneline --patch-with-stat\"\n> \n> Thanks.\n\nThank you.\n"},{"id":"406696","messageId":"xmqqo8lngjze.fsf@gitster.c.googlers.com","threadId":"54316","inReplyTo":"20200929213154.GA18321@HP","subject":"Re: [PATCH] git-completion.bash: stash-show: add --patch-with-stat","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-30T19:09:09Z","receivedAt":"2020-09-30T19:09:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robert Karszniewicz <avoidr@posteo.de> writes:\n\n>> surprising experience to the end users.  For \"show\" alone, it may\n>> make a lot of sense to complete \"git stash show -<TAB>\" and offer\n>> \"-p\".\n>\n> Does git complete short options at all? I only see long options\n> completed. (I'm also very new to bash-completion)\n\nI wouldn't personally recommend it, but I did see a patch that added\nsupport for one short option completion quite recently.  As long as\n\"--<TAB>\" gets completed to often-used options, among which \"--patch\"\nand \"--stat\" are included, it would be OK not to react to \"-<TAB>\".\n\n>> In any case, it might make more sense to do this instead, and then\n>> rethink what options make sense to these subcommands of \"git stash\".\n>> I do not think patch-with-stat should be among them.\n>\n> So shall I do a v2 as per your suggestion and replace\n> \"--patch-with-stat\" with \"--patch --stat\"?\n\nI think Denton Liu offered a different suggestion; I didn't look at\nand compare which direction is the better one myself, but an\napproach that keeps the number of manually-maintained list of\noptions low is almost always a good approach.\n\nThanks.\n"},{"id":"406716","messageId":"20200930215647.GA19843@HP","threadId":"54316","inReplyTo":"xmqqo8lngjze.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] git-completion.bash: stash-show: add --patch-with-stat","fromName":"Robert Karszniewicz","fromEmail":"avoidr@posteo.de","sentAt":"2020-09-30T21:56:47Z","receivedAt":"2020-09-30T21:56:56Z","isPatch":true,"sender":{"key":"avoidr@posteo.de","avatar":null},"body":"On Wed, Sep 30, 2020 at 12:09:09PM -0700, Junio C Hamano wrote:\n> Robert Karszniewicz <avoidr@posteo.de> writes:\n> > So shall I do a v2 as per your suggestion and replace\n> > \"--patch-with-stat\" with \"--patch --stat\"?\n> \n> I think Denton Liu offered a different suggestion; I didn't look at\n> and compare which direction is the better one myself, but an\n> approach that keeps the number of manually-maintained list of\n> options low is almost always a good approach.\n\nOk, I understand, then. Will take a look at it.\n\nThank you.\n"}]}