{"thread":{"id":"34251","subject":"[PATCH 2/2] completion: learn about --man-path","startedAt":"2013-06-22T11:25:17Z","lastAt":"2013-06-30T22:59:32Z","messageCount":7,"participants":["John Keeping","SZEDER Gábor","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"221678","messageId":"adafd1a0c0d7d059d215d9fd1ea68579525efe6e.1371900318.git.john@keeping.me.uk","threadId":"34251","inReplyTo":null,"subject":"[PATCH 1/2] completion: handle unstuck form of base git options","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-06-22T11:25:17Z","receivedAt":"2013-06-22T11:25:17Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"git-completion.bash's parsing of the command name relies on everything\npreceding it starting with '-' unless it is the \"-c\" option.  This\nallows users to use the stuck form of \"--work-tree=<path>\" and\n\"--namespace=<path>\" but not the unstuck forms \"--work-tree <path>\" and\n\"--namespace <path>\".  Fix this.\n\nSimilarly, the completion only handles the stuck form \"--git-dir=<path>\"\nand not \"--git-dir <path>\", so fix this as well.\n\nSigned-off-by: John Keeping <john@keeping.me.uk>\n---\n contrib/completion/git-completion.bash | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 6c3bafe..8fbf941 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2492,9 +2492,10 @@ __git_main ()\n \t\ti=\"${words[c]}\"\n \t\tcase \"$i\" in\n \t\t--git-dir=*) __git_dir=\"${i#--git-dir=}\" ;;\n+\t\t--git-dir)   ((c++)) ; __git_dir=\"${words[c]}\" ;;\n \t\t--bare)      __git_dir=\".\" ;;\n \t\t--help) command=\"help\"; break ;;\n-\t\t-c) c=$((++c)) ;;\n+\t\t-c|--work-tree|--namespace) ((c++)) ;;\n \t\t-*) ;;\n \t\t*) command=\"$i\"; break ;;\n \t\tesac\n-- \n1.8.3.1.676.gaae6535\n"},{"id":"221677","messageId":"bc83f64cf17851022e0344b3eb693beda1bdd8b6.1371900318.git.john@keeping.me.uk","threadId":"34251","inReplyTo":"adafd1a0c0d7d059d215d9fd1ea68579525efe6e.1371900318.git.john@keeping.me.uk","subject":"[PATCH 2/2] completion: learn about --man-path","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-06-22T11:25:18Z","receivedAt":"2013-06-22T11:25:18Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"Signed-off-by: John Keeping <john@keeping.me.uk>\n---\n contrib/completion/git-completion.bash | 2 ++\n t/t9902-completion.sh                  | 1 +\n 2 files changed, 3 insertions(+)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 8fbf941..c3290af 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2513,11 +2513,13 @@ __git_main ()\n \t\t\t--exec-path\n \t\t\t--exec-path=\n \t\t\t--html-path\n+\t\t\t--man-path\n \t\t\t--info-path\n \t\t\t--work-tree=\n \t\t\t--namespace=\n \t\t\t--no-replace-objects\n \t\t\t--help\n+\t\t\t-c\n \t\t\t\"\n \t\t\t;;\n \t\t*)     __git_compute_porcelain_commands\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex 81a1657..14d605a 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -231,6 +231,7 @@ test_expect_success 'double dash \"git\" itself' '\n \t--exec-path Z\n \t--exec-path=\n \t--html-path Z\n+\t--man-path Z\n \t--info-path Z\n \t--work-tree=\n \t--namespace=\n-- \n1.8.3.1.676.gaae6535\n"},{"id":"221683","messageId":"20130622123033.GI20052@goldbirke","threadId":"34251","inReplyTo":"adafd1a0c0d7d059d215d9fd1ea68579525efe6e.1371900318.git.john@keeping.me.uk","subject":"Re: [PATCH 1/2] completion: handle unstuck form of base git options","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2013-06-22T12:30:33Z","receivedAt":"2013-06-22T12:30:33Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Hi,\n\nOn Sat, Jun 22, 2013 at 12:25:17PM +0100, John Keeping wrote:\n> git-completion.bash's parsing of the command name relies on everything\n> preceding it starting with '-' unless it is the \"-c\" option.  This\n> allows users to use the stuck form of \"--work-tree=<path>\" and\n> \"--namespace=<path>\" but not the unstuck forms \"--work-tree <path>\" and\n> \"--namespace <path>\".  Fix this.\n\nI never use these commands, so I looked up what --namespace means.\nWhile doing so I noticed that --exec-path takes a path just like these\noptions, so that option should be handled similarly as well.\n\nOtherwise it makes sense.\n\n\nGábor\n\n\n> Similarly, the completion only handles the stuck form \"--git-dir=<path>\"\n> and not \"--git-dir <path>\", so fix this as well.\n> \n> Signed-off-by: John Keeping <john@keeping.me.uk>\n> ---\n>  contrib/completion/git-completion.bash | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 6c3bafe..8fbf941 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -2492,9 +2492,10 @@ __git_main ()\n>  \t\ti=\"${words[c]}\"\n>  \t\tcase \"$i\" in\n>  \t\t--git-dir=*) __git_dir=\"${i#--git-dir=}\" ;;\n> +\t\t--git-dir)   ((c++)) ; __git_dir=\"${words[c]}\" ;;\n>  \t\t--bare)      __git_dir=\".\" ;;\n>  \t\t--help) command=\"help\"; break ;;\n> -\t\t-c) c=$((++c)) ;;\n> +\t\t-c|--work-tree|--namespace) ((c++)) ;;\n>  \t\t-*) ;;\n>  \t\t*) command=\"$i\"; break ;;\n>  \t\tesac\n> -- \n> 1.8.3.1.676.gaae6535\n> \n"},{"id":"221684","messageId":"20130622123533.GJ20052@goldbirke","threadId":"34251","inReplyTo":"20130622123033.GI20052@goldbirke","subject":"Re: [PATCH 1/2] completion: handle unstuck form of base git options","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2013-06-22T12:35:33Z","receivedAt":"2013-06-22T12:35:33Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sat, Jun 22, 2013 at 02:30:33PM +0200, SZEDER Gábor wrote:\n> Hi,\n> \n> On Sat, Jun 22, 2013 at 12:25:17PM +0100, John Keeping wrote:\n> > git-completion.bash's parsing of the command name relies on everything\n> > preceding it starting with '-' unless it is the \"-c\" option.  This\n> > allows users to use the stuck form of \"--work-tree=<path>\" and\n> > \"--namespace=<path>\" but not the unstuck forms \"--work-tree <path>\" and\n> > \"--namespace <path>\".  Fix this.\n> \n> I never use these commands, so I looked up what --namespace means.\n> While doing so I noticed that --exec-path takes a path just like these\n> options, so that option should be handled similarly as well.\n\nNever mind, I misunderstood the docs: --exec-path either takes a path\nas --exec-path=<path> or it doesn't take one at all, but there is no\n'--exec-path <path>'.\n\n\nGábor\n"},{"id":"222156","messageId":"20130628082017.GE2232@serenity.lan","threadId":"34251","inReplyTo":"adafd1a0c0d7d059d215d9fd1ea68579525efe6e.1371900318.git.john@keeping.me.uk","subject":"Re: [PATCH 1/2] completion: handle unstuck form of base git options","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-06-28T08:20:17Z","receivedAt":"2013-06-28T08:20:17Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"Hi Junio, I don't think you've picked this up.  Are you expecting a\nre-roll or did it just get lost in the noise?\n\nOn Sat, Jun 22, 2013 at 12:25:17PM +0100, John Keeping wrote:\n> git-completion.bash's parsing of the command name relies on everything\n> preceding it starting with '-' unless it is the \"-c\" option.  This\n> allows users to use the stuck form of \"--work-tree=<path>\" and\n> \"--namespace=<path>\" but not the unstuck forms \"--work-tree <path>\" and\n> \"--namespace <path>\".  Fix this.\n> \n> Similarly, the completion only handles the stuck form \"--git-dir=<path>\"\n> and not \"--git-dir <path>\", so fix this as well.\n> \n> Signed-off-by: John Keeping <john@keeping.me.uk>\n> ---\n>  contrib/completion/git-completion.bash | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 6c3bafe..8fbf941 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -2492,9 +2492,10 @@ __git_main ()\n>  \t\ti=\"${words[c]}\"\n>  \t\tcase \"$i\" in\n>  \t\t--git-dir=*) __git_dir=\"${i#--git-dir=}\" ;;\n> +\t\t--git-dir)   ((c++)) ; __git_dir=\"${words[c]}\" ;;\n>  \t\t--bare)      __git_dir=\".\" ;;\n>  \t\t--help) command=\"help\"; break ;;\n> -\t\t-c) c=$((++c)) ;;\n> +\t\t-c|--work-tree|--namespace) ((c++)) ;;\n>  \t\t-*) ;;\n>  \t\t*) command=\"$i\"; break ;;\n>  \t\tesac\n> -- \n> 1.8.3.1.676.gaae6535\n> \n"},{"id":"222251","messageId":"20130630114106.GE2294@goldbirke","threadId":"34251","inReplyTo":"bc83f64cf17851022e0344b3eb693beda1bdd8b6.1371900318.git.john@keeping.me.uk","subject":"Re: [PATCH 2/2] completion: learn about --man-path","fromName":"SZEDER Gábor","fromEmail":"szeder@fzi.de","sentAt":"2013-06-30T11:41:06Z","receivedAt":"2013-06-30T11:41:06Z","isPatch":true,"sender":{"key":"szeder@fzi.de","avatar":null},"body":"Hi,\n\nOn Sat, Jun 22, 2013 at 12:25:18PM +0100, John Keeping wrote:\n> Signed-off-by: John Keeping <john@keeping.me.uk>\n> ---\n>  contrib/completion/git-completion.bash | 2 ++\n>  t/t9902-completion.sh                  | 1 +\n>  2 files changed, 3 insertions(+)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 8fbf941..c3290af 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -2513,11 +2513,13 @@ __git_main ()\n>  \t\t\t--exec-path\n>  \t\t\t--exec-path=\n>  \t\t\t--html-path\n> +\t\t\t--man-path\n>  \t\t\t--info-path\n>  \t\t\t--work-tree=\n>  \t\t\t--namespace=\n>  \t\t\t--no-replace-objects\n>  \t\t\t--help\n> +\t\t\t-c\n\nThere are a couple of issues with this '-c' here:\n\n- We normally offer only --long-options in the completion script.\n- The log message doesn't mention it.\n- And finally the most important: it will never be offered for\n  completion.  This is the condition of this case branch:\n\n                case \"$cur\" in\n                --*)   __gitcomp \"\n\n  i.e. this case branch is executed only when the current word on the\n  command line begins with '--', but then '-c' will never match.\n\nWithout the '-c' part it's \"obviously correct\" and together with patch\n1/2 is\n\nAcked-by: SZEDER Gábor <szeder@ira.uka.de>\n\n\n>  \t\t\t\"\n>  \t\t\t;;\n>  \t\t*)     __git_compute_porcelain_commands\n> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\n> index 81a1657..14d605a 100755\n> --- a/t/t9902-completion.sh\n> +++ b/t/t9902-completion.sh\n> @@ -231,6 +231,7 @@ test_expect_success 'double dash \"git\" itself' '\n>  \t--exec-path Z\n>  \t--exec-path=\n>  \t--html-path Z\n> +\t--man-path Z\n>  \t--info-path Z\n>  \t--work-tree=\n>  \t--namespace=\n> -- \n> 1.8.3.1.676.gaae6535\n> \n> \n"},{"id":"222265","messageId":"7vsizzi4rv.fsf@alter.siamese.dyndns.org","threadId":"34251","inReplyTo":"20130630114106.GE2294@goldbirke","subject":"Re: [PATCH 2/2] completion: learn about --man-path","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-30T22:59:32Z","receivedAt":"2013-06-30T22:59:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"SZEDER Gábor <szeder@fzi.de> writes:\n\n> Without the '-c' part it's \"obviously correct\" and together with patch\n> 1/2 is\n>\n> Acked-by: SZEDER Gábor <szeder@ira.uka.de>\n\nThanks, both.  Will queue.\n"}]}