{"thread":{"id":"39135","subject":"Re: [PATCH] completion: Support exclude prefix, ^<rev>","startedAt":"2015-04-22T13:03:27Z","lastAt":"2015-04-22T13:03:27Z","messageCount":1,"participants":["SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"259796","messageId":"20150422150327.Horde.JQeFwEt1H0b2m6uCwo2Grw1@webmail.informatik.kit.edu","threadId":"39135","inReplyTo":null,"subject":"Re: [PATCH] completion: Support exclude prefix, ^<rev>","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2015-04-22T13:03:27Z","receivedAt":"2015-04-22T13:03:27Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Hi,\n\nQuoting Trygve Aaberge <trygveaa@gmail.com>:\n\n> When using the exclude pattern, ^<rev>, the completion did not work.\n> This enables completion after ^ in the same way that completion after ..\n> is done.\n\nInteresting, thinking back I can't recall I've ever needed multiple  \nexclude patterns on the command line, and a single exclude is well  \nserved by the rev1..rev2 notion.\nOf course that doesn't mean that nobody might need it, and since it's  \neasy to implement, I'm for it.\n\n> Signed-off-by: Trygve Aaberge <trygveaa@gmail.com>\n> ---\n> contrib/completion/git-completion.bash | 4 ++++\n> 1 file changed, 4 insertions(+)\n>\n> diff --git a/contrib/completion/git-completion.bash  \n> b/contrib/completion/git-completion.bash\n> index 8cfee95..3036dac 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -496,6 +496,10 @@ __git_complete_revlist_file ()\n> \t\tcur_=\"${cur_#*..}\"\n> \t\t__gitcomp_nl \"$(__git_refs)\" \"$pfx\" \"$cur_\"\n> \t\t;;\n> +\t^*)\n> +\t\tcur_=\"${cur_#^}\"\n> +\t\t__gitcomp_nl \"$(__git_refs)\" \"^\" \"$cur_\"\n> +\t\t;;\n\nThis is good, but considering the other cases I suggest making this  \nthe very first case.  That way we would not complete e.g. refs after  \n'^rev..<TAB>', which would lead to a \"bad revision\" error when the  \ncommand is executed, or tracked paths after '^rev:<TAB>', which I  \nthink doesn't make sense, though doesn't lead to error.\n\n> \t*)\n> \t\t__gitcomp_nl \"$(__git_refs)\"\n> \t\t;;\n> --\n> 2.2.2\n"}]}