{"thread":{"id":"20949","subject":"[PATCH 1/4] bash: rename __git_find_subcommand() to __git_find_on_cmdline()","startedAt":"2009-09-15T10:21:43Z","lastAt":"2009-09-24T12:23:15Z","messageCount":7,"participants":["SZEDER Gábor","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"123215","messageId":"e927e4d3bfe50d93e5e6d65c46821158332b37f9.1253009868.git.szeder@ira.uka.de","threadId":"20949","inReplyTo":null,"subject":"[PATCH 1/4] bash: rename __git_find_subcommand() to __git_find_on_cmdline()","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2009-09-15T10:21:43Z","receivedAt":"2009-09-15T10:21:43Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"__git_find_subcommand() was originally meant to check whether\nsubcommands are already present on the command line.  But the code is\ngeneral enough to be used for checking the presence of command line\noptions as well, and the next commit will use it for that purpose, so\nlet's give it a more general name.\n\nSigned-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n contrib/completion/git-completion.bash |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex f47c519..c539385 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -619,8 +619,8 @@ __git_aliased_command ()\n \tdone\n }\n \n-# __git_find_subcommand requires 1 argument\n-__git_find_subcommand ()\n+# __git_find_on_cmdline requires 1 argument\n+__git_find_on_cmdline ()\n {\n \tlocal word subcommand c=1\n \n@@ -739,7 +739,7 @@ _git_bisect ()\n \t__git_has_doubledash && return\n \n \tlocal subcommands=\"start bad good skip reset visualize replay log run\"\n-\tlocal subcommand=\"$(__git_find_subcommand \"$subcommands\")\"\n+\tlocal subcommand=\"$(__git_find_on_cmdline \"$subcommands\")\"\n \tif [ -z \"$subcommand\" ]; then\n \t\t__gitcomp \"$subcommands\"\n \t\treturn\n@@ -1751,7 +1751,7 @@ _git_config ()\n _git_remote ()\n {\n \tlocal subcommands=\"add rename rm show prune update set-head\"\n-\tlocal subcommand=\"$(__git_find_subcommand \"$subcommands\")\"\n+\tlocal subcommand=\"$(__git_find_on_cmdline \"$subcommands\")\"\n \tif [ -z \"$subcommand\" ]; then\n \t\t__gitcomp \"$subcommands\"\n \t\treturn\n@@ -1879,7 +1879,7 @@ _git_show_branch ()\n _git_stash ()\n {\n \tlocal subcommands='save list show apply clear drop pop create branch'\n-\tlocal subcommand=\"$(__git_find_subcommand \"$subcommands\")\"\n+\tlocal subcommand=\"$(__git_find_on_cmdline \"$subcommands\")\"\n \tif [ -z \"$subcommand\" ]; then\n \t\t__gitcomp \"$subcommands\"\n \telse\n@@ -1910,7 +1910,7 @@ _git_submodule ()\n \t__git_has_doubledash && return\n \n \tlocal subcommands=\"add status init update summary foreach sync\"\n-\tif [ -z \"$(__git_find_subcommand \"$subcommands\")\" ]; then\n+\tif [ -z \"$(__git_find_on_cmdline \"$subcommands\")\" ]; then\n \t\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n \t\tcase \"$cur\" in\n \t\t--*)\n@@ -1932,7 +1932,7 @@ _git_svn ()\n \t\tproplist show-ignore show-externals branch tag blame\n \t\tmigrate\n \t\t\"\n-\tlocal subcommand=\"$(__git_find_subcommand \"$subcommands\")\"\n+\tlocal subcommand=\"$(__git_find_on_cmdline \"$subcommands\")\"\n \tif [ -z \"$subcommand\" ]; then\n \t\t__gitcomp \"$subcommands\"\n \telse\n-- \n1.6.5.rc1.92.gee3c1\n"},{"id":"123217","messageId":"0d125e60b97ab58ad51fef170fd36b707a271a10.1253009868.git.szeder@ira.uka.de","threadId":"20949","inReplyTo":"e927e4d3bfe50d93e5e6d65c46821158332b37f9.1253009868.git.szeder@ira.uka.de","subject":"[PATCH 2/4] bash: update 'git stash' completion","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2009-09-15T10:21:44Z","receivedAt":"2009-09-15T10:21:44Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"This update adds 'git stash (apply|pop) --quiet' and all options known\nto 'git stash save', and handles the DWIMery from 3c2eb80f (stash:\nsimplify defaulting to \"save\" and reject unknown options, 2009-08-18).\nCare is taken to avoid offering subcommands in the DWIM case.\n\nSigned-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n contrib/completion/git-completion.bash |   20 ++++++++++++++++----\n 1 files changed, 16 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex c539385..2529cec 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1878,18 +1878,30 @@ _git_show_branch ()\n \n _git_stash ()\n {\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tlocal save_opts='--keep-index --no-keep-index --quiet --patch'\n \tlocal subcommands='save list show apply clear drop pop create branch'\n \tlocal subcommand=\"$(__git_find_on_cmdline \"$subcommands\")\"\n \tif [ -z \"$subcommand\" ]; then\n-\t\t__gitcomp \"$subcommands\"\n+\t\tcase \"$cur\" in\n+\t\t--*)\n+\t\t\t__gitcomp \"$save_opts\"\n+\t\t\t;;\n+\t\t*)\n+\t\t\tif [ -z \"$(__git_find_on_cmdline \"$save_opts\")\" ]; then\n+\t\t\t\t__gitcomp \"$subcommands\"\n+\t\t\telse\n+\t\t\t\tCOMPREPLY=()\n+\t\t\tfi\n+\t\t\t;;\n+\t\tesac\n \telse\n-\t\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n \t\tcase \"$subcommand,$cur\" in\n \t\tsave,--*)\n-\t\t\t__gitcomp \"--keep-index\"\n+\t\t\t__gitcomp \"$save_opts\"\n \t\t\t;;\n \t\tapply,--*|pop,--*)\n-\t\t\t__gitcomp \"--index\"\n+\t\t\t__gitcomp \"--index --quiet\"\n \t\t\t;;\n \t\tshow,--*|drop,--*|branch,--*)\n \t\t\tCOMPREPLY=()\n-- \n1.6.5.rc1.92.gee3c1\n"},{"id":"123216","messageId":"ccf129a01115027ee7438ac47f1bc35631a1b2bb.1253009868.git.szeder@ira.uka.de","threadId":"20949","inReplyTo":"0d125e60b97ab58ad51fef170fd36b707a271a10.1253009868.git.szeder@ira.uka.de","subject":"[PATCH 3/4] bash: teach 'git reset --patch'","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2009-09-15T10:21:45Z","receivedAt":"2009-09-15T10:21:45Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n contrib/completion/git-completion.bash |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 2529cec..8c268a1 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1782,7 +1782,7 @@ _git_reset ()\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n \tcase \"$cur\" in\n \t--*)\n-\t\t__gitcomp \"--merge --mixed --hard --soft\"\n+\t\t__gitcomp \"--merge --mixed --hard --soft --patch\"\n \t\treturn\n \t\t;;\n \tesac\n-- \n1.6.5.rc1.92.gee3c1\n"},{"id":"123218","messageId":"7c8c4f6a4c581bcba101b8ca467d241738aa376e.1253009868.git.szeder@ira.uka.de","threadId":"20949","inReplyTo":"ccf129a01115027ee7438ac47f1bc35631a1b2bb.1253009868.git.szeder@ira.uka.de","subject":"[PATCH 4/4] bash: teach 'git checkout' options","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2009-09-15T10:21:46Z","receivedAt":"2009-09-15T10:21:46Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n contrib/completion/git-completion.bash |   13 ++++++++++++-\n 1 files changed, 12 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 8c268a1..8e3cdbd 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -809,7 +809,18 @@ _git_checkout ()\n {\n \t__git_has_doubledash && return\n \n-\t__gitcomp \"$(__git_refs)\"\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--*)\n+\t\t__gitcomp \"\n+\t\t\t--quiet --ours --theirs --track --no-track --merge\n+\t\t\t--conflict= --patch\n+\t\t\t\"\n+\t\t;;\n+\t*)\n+\t\t__gitcomp \"$(__git_refs)\"\n+\t\t;;\n+\tesac\n }\n \n _git_cherry ()\n-- \n1.6.5.rc1.92.gee3c1\n"},{"id":"123633","messageId":"20090922152846.GQ14660@spearce.org","threadId":"20949","inReplyTo":"7c8c4f6a4c581bcba101b8ca467d241738aa376e.1253009868.git.szeder@ira.uka.de","subject":"Re: [PATCH 4/4] bash: teach 'git checkout' options","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-09-22T15:28:46Z","receivedAt":"2009-09-22T15:28:46Z","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> @@ -809,7 +809,18 @@ _git_checkout ()\n>  {\n>  \t__git_has_doubledash && return\n>  \n> -\t__gitcomp \"$(__git_refs)\"\n> +\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n> +\tcase \"$cur\" in\n> +\t--*)\n> +\t\t__gitcomp \"\n> +\t\t\t--quiet --ours --theirs --track --no-track --merge\n> +\t\t\t--conflict= --patch\n\nIf we are completing long options, shouldn't we also complete the\nsupported values for --conflict?  According to the docs, this is\n'merge' and 'diff3'.\n\n-- \nShawn.\n"},{"id":"123634","messageId":"20090922152916.GR14660@spearce.org","threadId":"20949","inReplyTo":"ccf129a01115027ee7438ac47f1bc35631a1b2bb.1253009868.git.szeder@ira.uka.de","subject":"Re: [PATCH 3/4] bash: teach 'git reset --patch'","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-09-22T15:29:16Z","receivedAt":"2009-09-22T15:29:16Z","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> Signed-off-by: SZEDER G??bor <szeder@ira.uka.de>\n> ---\n>  contrib/completion/git-completion.bash |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n\n1-3 of this series are:\n\nTrivially-acked-by: Shawn O. Pearce <spearce@spearce.org>\n \n-- \nShawn.\n"},{"id":"123732","messageId":"1253794995-9093-1-git-send-email-szeder@ira.uka.de","threadId":"20949","inReplyTo":"20090922152846.GQ14660@spearce.org","subject":"[PATCHv2] bash: teach 'git checkout' options","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2009-09-24T12:23:15Z","receivedAt":"2009-09-24T12:23:15Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n contrib/completion/git-completion.bash |   16 +++++++++++++++-\n 1 files changed, 15 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 8c268a1..a08e471 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -809,7 +809,21 @@ _git_checkout ()\n {\n \t__git_has_doubledash && return\n \n-\t__gitcomp \"$(__git_refs)\"\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--conflict=*)\n+\t\t__gitcomp \"diff3 merge\" \"\" \"${cur##--conflict=}\"\n+\t\t;;\n+\t--*)\n+\t\t__gitcomp \"\n+\t\t\t--quiet --ours --theirs --track --no-track --merge\n+\t\t\t--conflict= --patch\n+\t\t\t\"\n+\t\t;;\n+\t*)\n+\t\t__gitcomp \"$(__git_refs)\"\n+\t\t;;\n+\tesac\n }\n \n _git_cherry ()\n-- \n1.6.5.rc2.85.gd02ad\n"}]}