{"thread":{"id":"22418","subject":"[PATCH] bash: support 'git notes' and its subcommands","startedAt":"2010-01-28T01:05:55Z","lastAt":"2010-01-28T10:02:24Z","messageCount":5,"participants":["SZEDER Gábor","Shawn O. Pearce","Johan Herland"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"132853","messageId":"1264640755-22447-1-git-send-email-szeder@ira.uka.de","threadId":"22418","inReplyTo":null,"subject":"[PATCH] bash: support 'git notes' and its subcommands","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2010-01-28T01:05:55Z","receivedAt":"2010-01-28T01:05:55Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"... and it will offer refs unless after -m or -F, because these two\noptions require a non-ref argument.\n\nSigned-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n contrib/completion/git-completion.bash |   19 +++++++++++++++++++\n 1 files changed, 19 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 9651720..8b56c34 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1306,6 +1306,24 @@ _git_name_rev ()\n \t__gitcomp \"--tags --all --stdin\"\n }\n \n+_git_notes ()\n+{\n+\tlocal subcommands=\"edit show\"\n+\tif [ -z \"$(__git_find_on_cmdline \"$subcommands\")\" ]; then\n+\t\t__gitcomp \"$subcommands\"\n+\t\treturn\n+\tfi\n+\n+\tcase \"${COMP_WORDS[COMP_CWORD-1]}\" in\n+\t-m|-F)\n+\t\tCOMPREPLY=()\n+\t\t;;\n+\t*)\n+\t\t__gitcomp \"$(__git_refs)\"\n+\t\t;;\n+\tesac\n+}\n+\n _git_pull ()\n {\n \t__git_complete_strategy && return\n@@ -2218,6 +2236,7 @@ _git ()\n \tmerge-base)  _git_merge_base ;;\n \tmv)          _git_mv ;;\n \tname-rev)    _git_name_rev ;;\n+\tnotes)       _git_notes ;;\n \tpull)        _git_pull ;;\n \tpush)        _git_push ;;\n \trebase)      _git_rebase ;;\n-- \n1.7.0.rc0.28.g3ad3d5\n"},{"id":"132855","messageId":"20100128012102.GL5452@spearce.org","threadId":"22418","inReplyTo":"1264640755-22447-1-git-send-email-szeder@ira.uka.de","subject":"Re: [PATCH] bash: support 'git notes' and its subcommands","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2010-01-28T01:21:02Z","receivedAt":"2010-01-28T01:21:02Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"SZEDER G??bor <szeder@ira.uka.de> wrote:\n> ... and it will offer refs unless after -m or -F, because these two\n> options require a non-ref argument.\n> \n> Signed-off-by: SZEDER G??bor <szeder@ira.uka.de>\n> ---\n>  contrib/completion/git-completion.bash |   19 +++++++++++++++++++\n>  1 files changed, 19 insertions(+), 0 deletions(-)\n\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n \n-- \nShawn.\n"},{"id":"132856","messageId":"201001280223.35625.johan@herland.net","threadId":"22418","inReplyTo":"1264640755-22447-1-git-send-email-szeder@ira.uka.de","subject":"Re: [PATCH] bash: support 'git notes' and its subcommands","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2010-01-28T01:23:35Z","receivedAt":"2010-01-28T01:23:35Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Thursday 28 January 2010, SZEDER Gábor wrote:\n> ... and it will offer refs unless after -m or -F, because these two\n> options require a non-ref argument.\n\nMaybe-NAK.\n\nThe patch is probably good in itself, and the intent is certainly good, but \nwe're currently discussing deprecating the -m/-F options to \"git notes edit\" \n(see http://article.gmane.org/gmane.comp.version-control.git/138215), and if \nthat's where we go, there's no point \"encouraging\" their use by adding bash-\ncompletions for them...\n\n\n...Johan\n\n> \n> Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>\n> ---\n>  contrib/completion/git-completion.bash |   19 +++++++++++++++++++\n>  1 files changed, 19 insertions(+), 0 deletions(-)\n> \n> diff --git a/contrib/completion/git-completion.bash\n>  b/contrib/completion/git-completion.bash index 9651720..8b56c34 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1306,6 +1306,24 @@ _git_name_rev ()\n>  \t__gitcomp \"--tags --all --stdin\"\n>  }\n> \n> +_git_notes ()\n> +{\n> +\tlocal subcommands=\"edit show\"\n> +\tif [ -z \"$(__git_find_on_cmdline \"$subcommands\")\" ]; then\n> +\t\t__gitcomp \"$subcommands\"\n> +\t\treturn\n> +\tfi\n> +\n> +\tcase \"${COMP_WORDS[COMP_CWORD-1]}\" in\n> +\t-m|-F)\n> +\t\tCOMPREPLY=()\n> +\t\t;;\n> +\t*)\n> +\t\t__gitcomp \"$(__git_refs)\"\n> +\t\t;;\n> +\tesac\n> +}\n> +\n>  _git_pull ()\n>  {\n>  \t__git_complete_strategy && return\n> @@ -2218,6 +2236,7 @@ _git ()\n>  \tmerge-base)  _git_merge_base ;;\n>  \tmv)          _git_mv ;;\n>  \tname-rev)    _git_name_rev ;;\n> +\tnotes)       _git_notes ;;\n>  \tpull)        _git_pull ;;\n>  \tpush)        _git_push ;;\n>  \trebase)      _git_rebase ;;\n> \n\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"132862","messageId":"20100128033039.GB15202@neumann","threadId":"22418","inReplyTo":"201001280223.35625.johan@herland.net","subject":"Re: [PATCH] bash: support 'git notes' and its subcommands","fromName":"SZEDER Gábor","fromEmail":"szeder@fzi.de","sentAt":"2010-01-28T03:30:39Z","receivedAt":"2010-01-28T03:30:39Z","isPatch":true,"sender":{"key":"szeder@fzi.de","avatar":null},"body":"Hi Johan,\n\n\nOn Thu, Jan 28, 2010 at 02:23:35AM +0100, Johan Herland wrote:\n> On Thursday 28 January 2010, SZEDER Gábor wrote:\n> > ... and it will offer refs unless after -m or -F, because these two\n> > options require a non-ref argument.\n> \n> Maybe-NAK.\n> \n> The patch is probably good in itself, and the intent is certainly good, but \n> we're currently discussing deprecating the -m/-F options to \"git notes edit\" \n> (see http://article.gmane.org/gmane.comp.version-control.git/138215), and if \n> that's where we go, there's no point \"encouraging\" their use by adding bash-\n> completions for them...\n\n-m and -F are not encouraged, because they are not offered (short\noptions in general are never offered by the completion script).\nHowever, their presence or absence is taken into account to offer\nsomething sensible: refs after 'git notes edit <TAB>', files after\n'git notes edit -F <TAB>'.  Note, that I chose 'edit' here, because\ncurrently it's the only subcommand taking '-F', but it will actually\nwork the same way with the upcoming 'add' and 'append' subcommands.\n\n\nBest,\nGábor\n\n\n[btw, Shawn, could you have a look at\nhttp://article.gmane.org/gmane.comp.version-control.git/137754 ?]\n"},{"id":"132879","messageId":"201001281102.24195.johan@herland.net","threadId":"22418","inReplyTo":"20100128033039.GB15202@neumann","subject":"Re: [PATCH] bash: support 'git notes' and its subcommands","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2010-01-28T10:02:24Z","receivedAt":"2010-01-28T10:02:24Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Thursday 28 January 2010, SZEDER Gábor wrote:\n> Hi Johan,\n> \n> On Thu, Jan 28, 2010 at 02:23:35AM +0100, Johan Herland wrote:\n> > On Thursday 28 January 2010, SZEDER Gábor wrote:\n> > > ... and it will offer refs unless after -m or -F, because these two\n> > > options require a non-ref argument.\n> >\n> > Maybe-NAK.\n> >\n> > The patch is probably good in itself, and the intent is certainly good,\n> > but we're currently discussing deprecating the -m/-F options to \"git\n> > notes edit\" (see\n> > http://article.gmane.org/gmane.comp.version-control.git/138215), and if\n> > that's where we go, there's no point \"encouraging\" their use by adding\n> > bash- completions for them...\n> \n> -m and -F are not encouraged, because they are not offered (short\n> options in general are never offered by the completion script).\n> However, their presence or absence is taken into account to offer\n> something sensible: refs after 'git notes edit <TAB>', files after\n> 'git notes edit -F <TAB>'.  Note, that I chose 'edit' here, because\n> currently it's the only subcommand taking '-F', but it will actually\n> work the same way with the upcoming 'add' and 'append' subcommands.\n\nAh, ok, then. I revoke my NAK.\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"}]}