{"thread":{"id":"16498","subject":"[PATCH] bash: remove dashed command leftovers","startedAt":"2008-11-27T13:35:38Z","lastAt":"2008-11-27T21:24:30Z","messageCount":2,"participants":["SZEDER Gábor","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"96620","messageId":"1227792938-4006-1-git-send-email-szeder@ira.uka.de","threadId":"16498","inReplyTo":null,"subject":"[PATCH] bash: remove dashed command leftovers","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2008-11-27T13:35:38Z","receivedAt":"2008-11-27T13:35:38Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Commit 5a625b07 (bash: remove fetch, push, pull dashed form leftovers,\n2008-10-03) did that already, but there were still some git-cmd left\nhere and there.\n\nSigned-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n contrib/completion/git-completion.bash |   41 ++++++-------------------------\n 1 files changed, 8 insertions(+), 33 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 35e8ff7..0ee071b 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -635,21 +635,12 @@ _git_branch ()\n \n _git_bundle ()\n {\n-\tlocal mycword=\"$COMP_CWORD\"\n-\tcase \"${COMP_WORDS[0]}\" in\n-\tgit)\n-\t\tlocal cmd=\"${COMP_WORDS[2]}\"\n-\t\tmycword=\"$((mycword-1))\"\n-\t\t;;\n-\tgit-bundle*)\n-\t\tlocal cmd=\"${COMP_WORDS[1]}\"\n-\t\t;;\n-\tesac\n-\tcase \"$mycword\" in\n-\t1)\n+\tlocal cmd=\"${COMP_WORDS[2]}\"\n+\tcase \"$COMP_CWORD\" in\n+\t2)\n \t\t__gitcomp \"create list-heads verify unbundle\"\n \t\t;;\n-\t2)\n+\t3)\n \t\t# looking for a file\n \t\t;;\n \t*)\n@@ -797,12 +788,7 @@ _git_fetch ()\n \t\t\t__gitcomp \"$(__git_refs)\" \"$pfx\" \"${cur#*:}\"\n \t\t\t;;\n \t\t*)\n-\t\t\tlocal remote\n-\t\t\tcase \"${COMP_WORDS[0]}\" in\n-\t\t\tgit-fetch) remote=\"${COMP_WORDS[1]}\" ;;\n-\t\t\tgit)       remote=\"${COMP_WORDS[2]}\" ;;\n-\t\t\tesac\n-\t\t\t__gitcomp \"$(__git_refs2 \"$remote\")\"\n+\t\t\t__gitcomp \"$(__git_refs2 \"${COMP_WORDS[2]}\")\"\n \t\t\t;;\n \t\tesac\n \tfi\n@@ -1049,12 +1035,7 @@ _git_pull ()\n \tif [ \"$COMP_CWORD\" = 2 ]; then\n \t\t__gitcomp \"$(__git_remotes)\"\n \telse\n-\t\tlocal remote\n-\t\tcase \"${COMP_WORDS[0]}\" in\n-\t\tgit-pull)  remote=\"${COMP_WORDS[1]}\" ;;\n-\t\tgit)       remote=\"${COMP_WORDS[2]}\" ;;\n-\t\tesac\n-\t\t__gitcomp \"$(__git_refs \"$remote\")\"\n+\t\t__gitcomp \"$(__git_refs \"${COMP_WORDS[2]}\")\"\n \tfi\n }\n \n@@ -1067,19 +1048,13 @@ _git_push ()\n \telse\n \t\tcase \"$cur\" in\n \t\t*:*)\n-\t\t\tlocal remote\n-\t\t\tcase \"${COMP_WORDS[0]}\" in\n-\t\t\tgit-push)  remote=\"${COMP_WORDS[1]}\" ;;\n-\t\t\tgit)       remote=\"${COMP_WORDS[2]}\" ;;\n-\t\t\tesac\n-\n \t\t\tlocal pfx=\"\"\n \t\t\tcase \"$COMP_WORDBREAKS\" in\n \t\t\t*:*) : great ;;\n \t\t\t*)   pfx=\"${cur%%:*}:\" ;;\n \t\t\tesac\n \n-\t\t\t__gitcomp \"$(__git_refs \"$remote\")\" \"$pfx\" \"${cur#*:}\"\n+\t\t\t__gitcomp \"$(__git_refs \"${COMP_WORDS[2]}\")\" \"$pfx\" \"${cur#*:}\"\n \t\t\t;;\n \t\t+*)\n \t\t\t__gitcomp \"$(__git_refs)\" + \"${cur#+}\"\n@@ -1584,7 +1559,7 @@ _git_tag ()\n \t-m|-F)\n \t\tCOMPREPLY=()\n \t\t;;\n-\t-*|tag|git-tag)\n+\t-*|tag)\n \t\tif [ $f = 1 ]; then\n \t\t\t__gitcomp \"$(__git_tags)\"\n \t\telse\n-- \n1.6.0.4.814.gfe502\n"},{"id":"96647","messageId":"20081127212430.GA23984@spearce.org","threadId":"16498","inReplyTo":"1227792938-4006-1-git-send-email-szeder@ira.uka.de","subject":"Re: [PATCH] bash: remove dashed command leftovers","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-11-27T21:24:30Z","receivedAt":"2008-11-27T21:24:30Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"SZEDER GGGbor <szeder@ira.uka.de> wrote:\n> Commit 5a625b07 (bash: remove fetch, push, pull dashed form leftovers,\n> 2008-10-03) did that already, but there were still some git-cmd left\n> here and there.\n> \n> Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>\n\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n\nI really appreciate you taking the time to clean up existing code.\nIts never fun, but it really helps to keep it from rotting.\n\n> ---\n>  contrib/completion/git-completion.bash |   41 ++++++-------------------------\n>  1 files changed, 8 insertions(+), 33 deletions(-)\n\n-- \nShawn.\n"}]}