{"thread":{"id":"6664","subject":"[PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.","startedAt":"2007-02-04T07:38:17Z","lastAt":"2007-02-05T09:19:28Z","messageCount":6,"participants":["Shawn O. Pearce","Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"33540","messageId":"20070204073817.GA17603@spearce.org","threadId":"6664","inReplyTo":null,"subject":"[PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-04T07:38:17Z","receivedAt":"2007-02-04T07:38:17Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"The short options (-l, -f, -d) for git-branch are rather silly to\ninclude in the completion generation as these options must be fully\ntyped out by the user and most users already know what the options\nare anyway, so including them in the suggested completions does\nnot offer huge value.  (The same goes for git-checkout and git-diff.)\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 83c69ec..971fefb 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -359,7 +359,7 @@ _git_apply ()\n _git_branch ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tCOMPREPLY=($(compgen -W \"-l -f -d -D $(__git_refs)\" -- \"$cur\"))\n+\tCOMPREPLY=($(compgen -W \"$(__git_refs)\" -- \"$cur\"))\n }\n \n _git_cat_file ()\n@@ -381,7 +381,7 @@ _git_cat_file ()\n _git_checkout ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tCOMPREPLY=($(compgen -W \"-l -b $(__git_refs)\" -- \"$cur\"))\n+\tCOMPREPLY=($(compgen -W \"$(__git_refs)\" -- \"$cur\"))\n }\n \n _git_cherry_pick ()\n@@ -421,7 +421,7 @@ _git_diff ()\n _git_diff_tree ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tCOMPREPLY=($(compgen -W \"-r -p -M $(__git_refs)\" -- \"$cur\"))\n+\tCOMPREPLY=($(compgen -W \"$(__git_refs)\" -- \"$cur\"))\n }\n \n _git_fetch ()\n-- \n1.5.0.rc3.22.g5057\n"},{"id":"33561","messageId":"eq4ccg$9ae$1@sea.gmane.org","threadId":"6664","inReplyTo":"20070204073817.GA17603@spearce.org","subject":"Re: [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-02-04T10:27:50Z","receivedAt":"2007-02-04T10:27:50Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"[Cc: git@vger.kernel.org]\n\nShawn O. Pearce wrote:\n\n> The short options (-l, -f, -d) for git-branch are rather silly to\n> include in the completion generation as these options must be fully\n> typed out by the user and most users already know what the options\n> are anyway, so including them in the suggested completions does\n> not offer huge value.  (The same goes for git-checkout and git-diff.)\n\nNot true. It is nice to have on \"git branch -\" TAB TAB list of all \n(well, all included in completion) short options to git-branch.\n\nSo I'd vote NAK.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"33565","messageId":"7vr6t6rycz.fsf@assigned-by-dhcp.cox.net","threadId":"6664","inReplyTo":"eq4ccg$9ae$1@sea.gmane.org","subject":"Re: [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-04T10:49:48Z","receivedAt":"2007-02-04T10:49:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> [Cc: git@vger.kernel.org]\n>\n> Shawn O. Pearce wrote:\n>\n>> The short options (-l, -f, -d) for git-branch are rather silly to\n>> include in the completion generation as these options must be fully\n>> typed out by the user and most users already know what the options\n>> are anyway, so including them in the suggested completions does\n>> not offer huge value.  (The same goes for git-checkout and git-diff.)\n>\n> Not true. It is nice to have on \"git branch -\" TAB TAB list of all \n> (well, all included in completion) short options to git-branch.\n>\n> So I'd vote NAK.\n\nAh, sorry, but it's already done.\n\nI tried \"git branch <TAB>\" and saw hundreds of possibilities\noffered, and thought mixing -d/-l and friends are useless.  I\ndidn't think of the possibility of saying \"git branch -<TAB>\".\n\nPresumably it was trying to suggest the <start-point> argument\nbut that does not make much sense actually either.\n"},{"id":"33601","messageId":"20070205024704.GB12917@spearce.org","threadId":"6664","inReplyTo":"7vr6t6rycz.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-05T02:47:04Z","receivedAt":"2007-02-05T02:47:04Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> Jakub Narebski <jnareb@gmail.com> writes:\n> > Shawn O. Pearce wrote:\n> >> The short options (-l, -f, -d) for git-branch are rather silly to\n> >> include in the completion generation as these options must be fully\n> >> typed out by the user and most users already know what the options\n> >> are anyway, so including them in the suggested completions does\n> >> not offer huge value.  (The same goes for git-checkout and git-diff.)\n> >\n> > Not true. It is nice to have on \"git branch -\" TAB TAB list of all \n> > (well, all included in completion) short options to git-branch.\n> >\n> > So I'd vote NAK.\n> \n> Ah, sorry, but it's already done.\n> \n> I tried \"git branch <TAB>\" and saw hundreds of possibilities\n> offered, and thought mixing -d/-l and friends are useless.  I\n> didn't think of the possibility of saying \"git branch -<TAB>\".\n> \n> Presumably it was trying to suggest the <start-point> argument\n> but that does not make much sense actually either.\n\nYeah.  The completion behind git-branch is pretty stupid.  Completing\nthe first argument from the existing set of branch names is stupid,\nunless we are using -m/-M/-d/-D/-f, as we'd otherwise refuse to do\nthe operation.  But we certainly do want completion on the second\nargument.\n\nI could be smarter about it and scan backwards looking for the mode\nin use and control completion based on that, but its just weird.\nBesides, I sometimes like completing the new branch name from the\nexisting set, as often I want to make the new branch name using\na leading prefix of another existing name.  Completing part of it\nsaves a few keystrokes.\n\n\nCompleting single character options is rather useless in my mind.\nThe bash completion is always out of date with respect to the\nactual set of supported options, and by definition they are a\nsingle character.  Hitting '-<tab><tab>' to identify the list of\nsupported options gives *no* detail about what the options do,\nand I still have to enter the option letter to complete it.\n\nCompleting `git am --w<tab>hitespace=s<tab>trip ` with just 6\nkeystrokes on the other hand is very informative (whitespace,\nstrip!) and saves many keystrokes.  That's why long options are\nsupported, for at least the more commonly accessed ones.\n\n-- \nShawn.\n"},{"id":"33615","messageId":"200702051016.16785.jnareb@gmail.com","threadId":"6664","inReplyTo":"20070205024704.GB12917@spearce.org","subject":"Re: [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-02-05T09:16:16Z","receivedAt":"2007-02-05T09:16:16Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Shawn O. Pearce wrote:\n\n> Completing single character options is rather useless in my mind.\n> The bash completion is always out of date with respect to the\n> actual set of supported options, and by definition they are a\n> single character.  Hitting '-<tab><tab>' to identify the list of\n> supported options gives *no* detail about what the options do,\n> and I still have to enter the option letter to complete it.\n> \n> Completing `git am --w<tab>hitespace=s<tab>trip ` with just 6\n> keystrokes on the other hand is very informative (whitespace,\n> strip!) and saves many keystrokes.  That's why long options are\n> supported, for at least the more commonly accessed ones.\n\nIt would be nice to have long option for each git command single \ncharacter (short) option, for example --patch as long option to \ngit-diff-tree -p option, etc.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"33617","messageId":"20070205091928.GA14234@spearce.org","threadId":"6664","inReplyTo":"200702051016.16785.jnareb@gmail.com","subject":"Re: [PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-05T09:19:28Z","receivedAt":"2007-02-05T09:19:28Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> wrote:\n> It would be nice to have long option for each git command single \n> character (short) option, for example --patch as long option to \n> git-diff-tree -p option, etc.\n\nSure.  And I'd support them when possible in the bash completion.\n\nBut I think that sort of change to git should wait for a real\ncommand line option parser.  What we have now makes things a\ntad painful.\n\n-- \nShawn.\n"}]}