{"thread":{"id":"47268","subject":"[PATCH] bash completion: Add --autostash and --no-autostash to pull","startedAt":"2017-11-21T14:39:38Z","lastAt":"2017-11-24T18:09:29Z","messageCount":2,"participants":["Albert Astals Cid","SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"333096","messageId":"94455771.5s97AYBuGd@yoga","threadId":"47268","inReplyTo":null,"subject":"[PATCH] bash completion: Add --autostash and --no-autostash to pull","fromName":"Albert Astals Cid","fromEmail":"albert.astals.cid@kdab.com","sentAt":"2017-11-21T14:39:28Z","receivedAt":"2017-11-21T14:39:38Z","isPatch":true,"sender":{"key":"albert.astals.cid@kdab.com","avatar":"https://avatars.githubusercontent.com/u/29123807?v=4"},"body":"Ideally we should only autocomplete if pull has --rebase since\nthey only work with it but could not figure out how to do that\nand the error message of doing git pull --autostash points out\nthat you need --rebase so i guess it's good enough\n\nSigned-off-by: Albert Astals Cid <albert.astals.cid@kdab.com>\n---\n contrib/completion/git-completion.bash | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-\ncompletion.bash\nindex 539d7f84f..7ded58f38 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1923,6 +1923,7 @@ _git_pull ()\n \t--*)\n \t\t__gitcomp \"\n \t\t\t--rebase --no-rebase\n+\t\t\t--autostash --no-autostash\n \t\t\t$__git_merge_options\n \t\t\t$__git_fetch_options\n \t\t\"\n-- \n2.15.0\n\n\n"},{"id":"333451","messageId":"20171124180902.31253-1-szeder.dev@gmail.com","threadId":"47268","inReplyTo":"94455771.5s97AYBuGd@yoga","subject":"Re: [PATCH] bash completion: Add --autostash and --no-autostash to pull","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2017-11-24T18:09:02Z","receivedAt":"2017-11-24T18:09:29Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"> Ideally we should only autocomplete if pull has --rebase since\n> they only work with it but could not figure out how to do that\n> and the error message of doing git pull --autostash points out\n> that you need --rebase so i guess it's good enough\n\nYou could use the completion script's __git_find_on_cmdline() helper\nfunction to easily check whether the '--rebase' option is already\npresent on the command line.\n\nHaving said that, I don't think we should go there, it feels that's\ntrying to be overly and unnecessarily clever.  After all, the order of\ncommand line options doesn't matter, and 'git pull --autostash\n--rebase' is a perfectly legit command.\n\n\n> Signed-off-by: Albert Astals Cid <albert.astals.cid@kdab.com>\n> ---\n>  contrib/completion/git-completion.bash | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-\n> completion.bash\n> index 539d7f84f..7ded58f38 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1923,6 +1923,7 @@ _git_pull ()\n>  \t--*)\n>  \t\t__gitcomp \"\n>  \t\t\t--rebase --no-rebase\n> +\t\t\t--autostash --no-autostash\n>  \t\t\t$__git_merge_options\n>  \t\t\t$__git_fetch_options\n>  \t\t\"\n> -- \n> 2.15.0\n> \n> \n> \n"}]}