{"thread":{"id":"30454","subject":"[RFC/PATCH v4 0/6] completion: __git_complete and other stuff","startedAt":"2012-05-07T01:23:14Z","lastAt":"2012-05-08T12:50:30Z","messageCount":18,"participants":["Felipe Contreras","SZEDER Gábor","Junio C Hamano"],"isPatch":true,"patchVersion":4,"patchTotal":6},"messages":[{"id":"190953","messageId":"1336353800-17323-1-git-send-email-felipe.contreras@gmail.com","threadId":"30454","inReplyTo":null,"subject":"[RFC/PATCH v4 0/6] completion: __git_complete and other stuff","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-05-07T01:23:14Z","receivedAt":"2012-05-07T01:23:14Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nIn order to simplify the discussion I've cleaned up my patches related to\n_GIT_complete, aliasing stuff, and such.\n\nI'm only intending the firat patch for inclusion for now.\n\nCheers.\n\nFelipe Contreras (6):\n  completion: add new __git_complete helper\n  tests: add more bash completion tests\n  completion: simplify _git_bundle\n  completion: simplify command stuff\n  completion: calculate argument position properly\n  completion: add public _GIT_complete helper\n\n contrib/completion/git-completion.bash |  103 ++++++++++++++++----------------\n t/t9902-completion.sh                  |   85 +++++++++++++++++++++++++-\n 2 files changed, 135 insertions(+), 53 deletions(-)\n\n-- \n1.7.10\n"},{"id":"190954","messageId":"1336353800-17323-2-git-send-email-felipe.contreras@gmail.com","threadId":"30454","inReplyTo":"1336353800-17323-1-git-send-email-felipe.contreras@gmail.com","subject":"[RFC/PATCH v4 1/6] completion: add new __git_complete helper","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-05-07T01:23:15Z","receivedAt":"2012-05-07T01:23:15Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"This simplifies the completions, and would make it easier to define\naliases in the future.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\nSince v3:\n\n * Get rid of typeset and subshell\n\nSince v2:\n\n * Rename to _GIT_complete to follow bash completion \"guidelines\"\n * Get rid of foo_wrap name\n\nSince v1:\n\n * Remove stuff related to aliases fixes; should work on top of master\n\n contrib/completion/git-completion.bash |   69 +++++++++++++++-----------------\n t/t9902-completion.sh                  |    2 +-\n 2 files changed, 33 insertions(+), 38 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 9f56ec7..4098902 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2603,21 +2603,6 @@ _git ()\n {\n \tlocal i c=1 command __git_dir\n \n-\tif [[ -n ${ZSH_VERSION-} ]]; then\n-\t\temulate -L bash\n-\t\tsetopt KSH_TYPESET\n-\n-\t\t# workaround zsh's bug that leaves 'words' as a special\n-\t\t# variable in versions < 4.3.12\n-\t\ttypeset -h words\n-\n-\t\t# workaround zsh's bug that quotes spaces in the COMPREPLY\n-\t\t# array if IFS doesn't contain spaces.\n-\t\ttypeset -h IFS\n-\tfi\n-\n-\tlocal cur words cword prev\n-\t_get_comp_words_by_ref -n =: cur words cword prev\n \twhile [ $c -lt $cword ]; do\n \t\ti=\"${words[c]}\"\n \t\tcase \"$i\" in\n@@ -2667,22 +2652,6 @@ _git ()\n \n _gitk ()\n {\n-\tif [[ -n ${ZSH_VERSION-} ]]; then\n-\t\temulate -L bash\n-\t\tsetopt KSH_TYPESET\n-\n-\t\t# workaround zsh's bug that leaves 'words' as a special\n-\t\t# variable in versions < 4.3.12\n-\t\ttypeset -h words\n-\n-\t\t# workaround zsh's bug that quotes spaces in the COMPREPLY\n-\t\t# array if IFS doesn't contain spaces.\n-\t\ttypeset -h IFS\n-\tfi\n-\n-\tlocal cur words cword prev\n-\t_get_comp_words_by_ref -n =: cur words cword prev\n-\n \t__git_has_doubledash && return\n \n \tlocal g=\"$(__gitdir)\"\n@@ -2703,16 +2672,42 @@ _gitk ()\n \t__git_complete_revlist\n }\n \n-complete -o bashdefault -o default -o nospace -F _git git 2>/dev/null \\\n-\t|| complete -o default -o nospace -F _git git\n-complete -o bashdefault -o default -o nospace -F _gitk gitk 2>/dev/null \\\n-\t|| complete -o default -o nospace -F _gitk gitk\n+__git_func_wrap ()\n+{\n+\tif [[ -n ${ZSH_VERSION-} ]]; then\n+\t\temulate -L bash\n+\t\tsetopt KSH_TYPESET\n+\n+\t\t# workaround zsh's bug that leaves 'words' as a special\n+\t\t# variable in versions < 4.3.12\n+\t\ttypeset -h words\n+\n+\t\t# workaround zsh's bug that quotes spaces in the COMPREPLY\n+\t\t# array if IFS doesn't contain spaces.\n+\t\ttypeset -h IFS\n+\tfi\n+\tlocal cur words cword prev\n+\t_get_comp_words_by_ref -n =: cur words cword prev\n+\t_$1\n+}\n+\n+# this is NOT a public function; use at your own risk\n+__git_complete ()\n+{\n+\tlocal name=\"${2-$1}\"\n+\tlocal wrapper=\"_${name}_wrap\"\n+\teval \"$wrapper () { __git_func_wrap $name ; }\"\n+\tcomplete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \\\n+\t\t|| complete -o default -o nospace -F $wrapper $1\n+}\n+\n+__git_complete git\n+__git_complete gitk\n \n # The following are necessary only for Cygwin, and only are needed\n # when the user has tab-completed the executable name and consequently\n # included the '.exe' suffix.\n #\n if [ Cygwin = \"$(uname -o 2>/dev/null)\" ]; then\n-complete -o bashdefault -o default -o nospace -F _git git.exe 2>/dev/null \\\n-\t|| complete -o default -o nospace -F _git git.exe\n+__git_complete git.exe git\n fi\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex 5bda6b6..331a5b9 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -63,7 +63,7 @@ run_completion ()\n \tlocal _cword\n \t_words=( $1 )\n \t(( _cword = ${#_words[@]} - 1 ))\n-\t_git && print_comp\n+\t_git_wrap && print_comp\n }\n \n test_completion ()\n-- \n1.7.10\n"},{"id":"190955","messageId":"1336353800-17323-3-git-send-email-felipe.contreras@gmail.com","threadId":"30454","inReplyTo":"1336353800-17323-1-git-send-email-felipe.contreras@gmail.com","subject":"[RFC/PATCH v4 2/6] tests: add more bash completion tests","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-05-07T01:23:16Z","receivedAt":"2012-05-07T01:23:16Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"These tests try to excercise code that deals with 'words' and 'cword'.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n\n t/t9902-completion.sh |   55 +++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 55 insertions(+)\n\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex 331a5b9..bb66848 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -158,6 +158,22 @@ test_expect_success '__gitcomp - suffix' '\n \ttest_cmp expected out\n '\n \n+setup_repository ()\n+{\n+\tmkdir \"$1\" && (\n+\tcd \"$1\" &&\n+\tgit init &&\n+\ttest_tick &&\n+\tgit commit --allow-empty -m \"Initial\"\n+\t)\n+}\n+\n+test_expect_success 'prepare' '\n+\tsetup_repository one &&\n+\tgit clone one test &&\n+\tcd test\n+'\n+\n test_expect_success 'basic' '\n \trun_completion \"git \\\"\\\"\" &&\n \t# built-in\n@@ -240,4 +256,43 @@ test_expect_success 'general options plus command' '\n \ttest_completion \"git --no-replace-objects check\" \"checkout \"\n '\n \n+test_expect_success 'remote or refspec' '\n+\ttest_completion \"git fetch o\" \"origin \" &&\n+\ttest_completion \"git fetch origin m\" \"master:master \" &&\n+\ttest_completion \"git pull o\" \"origin \" &&\n+\ttest_completion \"git pull origin m\" \"master \" &&\n+\ttest_completion \"git push o\" \"origin \" &&\n+\ttest_completion \"git push origin m\" \"master \"\n+'\n+\n+test_expect_success 'subcomands' '\n+\ttest_completion \"git bisect st\" \"start \"\n+'\n+\n+test_expect_success 'has double dash' '\n+\ttest_completion \"git add -- foo\" \"\"\n+'\n+\n+test_expect_success 'config' '\n+\tgit config --file=foo color.ui auto &&\n+\ttest_completion \"git config --file=foo --get c\" \"color.ui \"\n+'\n+\n+test_expect_success 'other' '\n+\tcat >expected <<-\\EOF &&\n+\torigin/HEAD \n+\torigin/master \n+\tEOF\n+\ttest_completion \"git branch -r o\" &&\n+\ttest_completion \"git bundle cr\" \"create \" &&\n+\n+\techo foobar > tags &&\n+\ttest_completion \"git grep f\" \"foobar \" &&\n+\n+\ttest_completion \"git notes --ref m\" \"master \" &&\n+\n+\tgit tag v0.1 &&\n+\ttest_completion \"git tag -d v\" \"v0.1 \"\n+'\n+\n test_done\n-- \n1.7.10\n"},{"id":"190956","messageId":"1336353800-17323-4-git-send-email-felipe.contreras@gmail.com","threadId":"30454","inReplyTo":"1336353800-17323-1-git-send-email-felipe.contreras@gmail.com","subject":"[RFC/PATCH v4 3/6] completion: simplify _git_bundle","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-05-07T01:23:17Z","receivedAt":"2012-05-07T01:23:17Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-completion.bash |    8 +++++---\n 1 file changed, 5 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 4098902..8de0358 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1142,16 +1142,18 @@ _git_branch ()\n \n _git_bundle ()\n {\n-\tlocal cmd=\"${words[2]}\"\n+\tlocal subcommands='create list-heads verify unbundle'\n+\tlocal subcommand=\"$(__git_find_on_cmdline \"$subcommands\")\"\n+\n \tcase \"$cword\" in\n \t2)\n-\t\t__gitcomp \"create list-heads verify unbundle\"\n+\t\t__gitcomp \"$subcommands\"\n \t\t;;\n \t3)\n \t\t# looking for a file\n \t\t;;\n \t*)\n-\t\tcase \"$cmd\" in\n+\t\tcase \"$subcommand\" in\n \t\t\tcreate)\n \t\t\t\t__git_complete_revlist\n \t\t\t;;\n-- \n1.7.10\n"},{"id":"190958","messageId":"1336353800-17323-5-git-send-email-felipe.contreras@gmail.com","threadId":"30454","inReplyTo":"1336353800-17323-1-git-send-email-felipe.contreras@gmail.com","subject":"[RFC/PATCH v4 4/6] completion: simplify command stuff","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-05-07T01:23:18Z","receivedAt":"2012-05-07T01:23:18Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"No need to recalculate it.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-completion.bash |   14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 8de0358..e648d7c 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -723,7 +723,7 @@ __git_complete_revlist ()\n \n __git_complete_remote_or_refspec ()\n {\n-\tlocal cur_=\"$cur\" cmd=\"${words[1]}\"\n+\tlocal cur_=\"$cur\"\n \tlocal i c=2 remote=\"\" pfx=\"\" lhs=1 no_complete_refspec=0\n \tif [ \"$cmd\" = \"remote\" ]; then\n \t\t((c++))\n@@ -2603,22 +2603,22 @@ _git_whatchanged ()\n \n _git ()\n {\n-\tlocal i c=1 command __git_dir\n+\tlocal i c=1 cmd __git_dir\n \n \twhile [ $c -lt $cword ]; do\n \t\ti=\"${words[c]}\"\n \t\tcase \"$i\" in\n \t\t--git-dir=*) __git_dir=\"${i#--git-dir=}\" ;;\n \t\t--bare)      __git_dir=\".\" ;;\n-\t\t--help) command=\"help\"; break ;;\n+\t\t--help) cmd=\"help\"; break ;;\n \t\t-c) c=$((++c)) ;;\n \t\t-*) ;;\n-\t\t*) command=\"$i\"; break ;;\n+\t\t*) cmd=\"$i\"; break ;;\n \t\tesac\n \t\t((c++))\n \tdone\n \n-\tif [ -z \"$command\" ]; then\n+\tif [ -z \"$cmd\" ]; then\n \t\tcase \"$cur\" in\n \t\t--*)   __gitcomp \"\n \t\t\t--paginate\n@@ -2642,10 +2642,10 @@ _git ()\n \t\treturn\n \tfi\n \n-\tlocal completion_func=\"_git_${command//-/_}\"\n+\tlocal completion_func=\"_git_${cmd//-/_}\"\n \tdeclare -f $completion_func >/dev/null && $completion_func && return\n \n-\tlocal expansion=$(__git_aliased_command \"$command\")\n+\tlocal expansion=$(__git_aliased_command \"$cmd\")\n \tif [ -n \"$expansion\" ]; then\n \t\tcompletion_func=\"_git_${expansion//-/_}\"\n \t\tdeclare -f $completion_func >/dev/null && $completion_func\n-- \n1.7.10\n"},{"id":"190959","messageId":"1336353800-17323-6-git-send-email-felipe.contreras@gmail.com","threadId":"30454","inReplyTo":"1336353800-17323-1-git-send-email-felipe.contreras@gmail.com","subject":"[RFC/PATCH v4 5/6] completion: calculate argument position properly","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-05-07T01:23:19Z","receivedAt":"2012-05-07T01:23:19Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Positions are currently hard-coded, which means completions in the form\nof 'git --foo bar' fail, because positions have been shifted.\n\nThis fixes the issue that was spotted in the mailing list regarding\ncertain aliases[1].\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/185184\n\nCc: SZEDER Gábor <szeder@ira.uka.de>\nCc: Scott Bronson <bronson@rinspin.com>\nCc: Nathan Broadbent <nathan.f77@gmail.com>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-completion.bash |   16 +++++++++-------\n t/t9902-completion.sh                  |   21 +++++++++++++++++++++\n 2 files changed, 30 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex e648d7c..049110e 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -724,7 +724,8 @@ __git_complete_revlist ()\n __git_complete_remote_or_refspec ()\n {\n \tlocal cur_=\"$cur\"\n-\tlocal i c=2 remote=\"\" pfx=\"\" lhs=1 no_complete_refspec=0\n+\tlocal i c=$cmd_pos remote=\"\" pfx=\"\" lhs=1 no_complete_refspec=0\n+\n \tif [ \"$cmd\" = \"remote\" ]; then\n \t\t((c++))\n \tfi\n@@ -1144,12 +1145,11 @@ _git_bundle ()\n {\n \tlocal subcommands='create list-heads verify unbundle'\n \tlocal subcommand=\"$(__git_find_on_cmdline \"$subcommands\")\"\n-\n-\tcase \"$cword\" in\n-\t2)\n+\tcase $(( cword - cmd_pos )) in\n+\t0)\n \t\t__gitcomp \"$subcommands\"\n \t\t;;\n-\t3)\n+\t1)\n \t\t# looking for a file\n \t\t;;\n \t*)\n@@ -1449,7 +1449,7 @@ _git_grep ()\n \tesac\n \n \tcase \"$cword,$prev\" in\n-\t2,*|*,-*)\n+\t$cmd_pos,*|*,-*)\n \t\tif test -r tags; then\n \t\t\t__gitcomp_nl \"$(__git_match_ctag \"$cur\" tags)\"\n \t\t\treturn\n@@ -2603,7 +2603,7 @@ _git_whatchanged ()\n \n _git ()\n {\n-\tlocal i c=1 cmd __git_dir\n+\tlocal i c=1 cmd cmd_pos __git_dir\n \n \twhile [ $c -lt $cword ]; do\n \t\ti=\"${words[c]}\"\n@@ -2642,6 +2642,8 @@ _git ()\n \t\treturn\n \tfi\n \n+\t(( cmd_pos = c + 1 ))\n+\n \tlocal completion_func=\"_git_${cmd//-/_}\"\n \tdeclare -f $completion_func >/dev/null && $completion_func && return\n \ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex bb66848..6904594 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -295,4 +295,25 @@ test_expect_success 'other' '\n \ttest_completion \"git tag -d v\" \"v0.1 \"\n '\n \n+test_expect_success 'global options extra checks' '\n+\ttest_completion \"git --no-pager fetch o\" \"origin \" &&\n+\ttest_completion \"git --no-pager fetch origin m\" \"master:master \" &&\n+\ttest_completion \"git --no-pager pull o\" \"origin \" &&\n+\ttest_completion \"git --no-pager pull origin m\" \"master \" &&\n+\ttest_completion \"git --no-pager push o\" \"origin \" &&\n+\ttest_completion \"git --no-pager push origin m\" \"master \" &&\n+\ttest_completion \"git --no-pager bisect st\" \"start \" &&\n+\ttest_completion \"git --no-pager add -- foo\" \"\" &&\n+\ttest_completion \"git --no-pager config --file=foo --get c\" \"color.ui \" &&\n+\tcat >expected <<-\\EOF &&\n+\torigin/HEAD \n+\torigin/master \n+\tEOF\n+\ttest_completion \"git --no-pager branch -r o\" &&\n+\ttest_completion \"git --no-pager bundle cr\" \"create \" &&\n+\ttest_completion \"git --no-pager grep f\" \"foobar \" &&\n+\ttest_completion \"git --no-pager notes --ref m\" \"master \" &&\n+\ttest_completion \"git --no-pager tag -d v\" \"v0.1 \"\n+'\n+\n test_done\n-- \n1.7.10\n"},{"id":"190957","messageId":"1336353800-17323-7-git-send-email-felipe.contreras@gmail.com","threadId":"30454","inReplyTo":"1336353800-17323-1-git-send-email-felipe.contreras@gmail.com","subject":"[RFC/PATCH v4 6/6] completion: add public _GIT_complete helper","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-05-07T01:23:20Z","receivedAt":"2012-05-07T01:23:20Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"So that users can easily define aliases, such as:\n\n _GIT_complete gf git_fetch\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-completion.bash |   10 +++++-----\n t/t9902-completion.sh                  |    9 ++++++++-\n 2 files changed, 13 insertions(+), 6 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 049110e..2b7ef02 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2678,6 +2678,7 @@ _gitk ()\n \n __git_func_wrap ()\n {\n+\tlocal cmd=\"${1#git_}\" cmd_pos=1\n \tif [[ -n ${ZSH_VERSION-} ]]; then\n \t\temulate -L bash\n \t\tsetopt KSH_TYPESET\n@@ -2695,8 +2696,7 @@ __git_func_wrap ()\n \t_$1\n }\n \n-# this is NOT a public function; use at your own risk\n-__git_complete ()\n+_GIT_complete ()\n {\n \tlocal name=\"${2-$1}\"\n \tlocal wrapper=\"_${name}_wrap\"\n@@ -2705,13 +2705,13 @@ __git_complete ()\n \t\t|| complete -o default -o nospace -F $wrapper $1\n }\n \n-__git_complete git\n-__git_complete gitk\n+_GIT_complete git\n+_GIT_complete gitk\n \n # The following are necessary only for Cygwin, and only are needed\n # when the user has tab-completed the executable name and consequently\n # included the '.exe' suffix.\n #\n if [ Cygwin = \"$(uname -o 2>/dev/null)\" ]; then\n-__git_complete git.exe git\n+_GIT_complete git.exe git\n fi\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex 6904594..2037452 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -63,7 +63,7 @@ run_completion ()\n \tlocal _cword\n \t_words=( $1 )\n \t(( _cword = ${#_words[@]} - 1 ))\n-\t_git_wrap && print_comp\n+\t${comp_wrap-_git_wrap} && print_comp\n }\n \n test_completion ()\n@@ -316,4 +316,11 @@ test_expect_success 'global options extra checks' '\n \ttest_completion \"git --no-pager tag -d v\" \"v0.1 \"\n '\n \n+test_expect_success 'aliases' '\n+\tlocal comp_wrap=_git_fetch_wrap &&\n+\t_GIT_complete gf git_fetch &&\n+\ttest_completion \"gf o\" \"origin \" &&\n+\ttest_completion \"gf origin m\" \"master:master \"\n+'\n+\n test_done\n-- \n1.7.10\n"},{"id":"190960","messageId":"CAMP44s3Bscm0T_=-g-wRc9kkZYZjGHGaP6hPi8598=Oh=skjxw@mail.gmail.com","threadId":"30454","inReplyTo":"1336353800-17323-6-git-send-email-felipe.contreras@gmail.com","subject":"Re: [RFC/PATCH v4 5/6] completion: calculate argument position properly","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-05-07T01:27:31Z","receivedAt":"2012-05-07T01:27:31Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, May 7, 2012 at 3:23 AM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n\n> @@ -2642,6 +2642,8 @@ _git ()\n>                return\n>        fi\n>\n> +       (( cmd_pos = c + 1 ))\n\nActually, I would prefer cmd_pos=$((c + 1)).\n\n-- \nFelipe Contreras\n"},{"id":"190979","messageId":"20120507095145.GP2164@goldbirke","threadId":"30454","inReplyTo":"1336353800-17323-2-git-send-email-felipe.contreras@gmail.com","subject":"Re: [RFC/PATCH v4 1/6] completion: add new __git_complete helper","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2012-05-07T09:51:45Z","receivedAt":"2012-05-07T09:51:45Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Hi,\n\nOn Mon, May 07, 2012 at 03:23:15AM +0200, Felipe Contreras wrote:\n> +__git_func_wrap ()\n> +{\n> +\tif [[ -n ${ZSH_VERSION-} ]]; then\n> +\t\temulate -L bash\n> +\t\tsetopt KSH_TYPESET\n> +\n> +\t\t# workaround zsh's bug that leaves 'words' as a special\n> +\t\t# variable in versions < 4.3.12\n> +\t\ttypeset -h words\n> +\n> +\t\t# workaround zsh's bug that quotes spaces in the COMPREPLY\n> +\t\t# array if IFS doesn't contain spaces.\n> +\t\ttypeset -h IFS\n> +\tfi\n> +\tlocal cur words cword prev\n> +\t_get_comp_words_by_ref -n =: cur words cword prev\n> +\t_$1\n> +}\n> +\n> +# this is NOT a public function; use at your own risk\n> +__git_complete ()\n> +{\n> +\tlocal name=\"${2-$1}\"\n\nPlease add the underscore prefix here right away, so we don't need\nthat \"_$1\" above in __git_func_wrap().\n\nThere is still no documentation about the parameters of\n__git_complete(), so...\n\nIt seems to set up completion for the command given as first argument\nto invoke the completion function given as second argument, right?\nBut the completion function argument is optional, and if it's not\nspecified, its name is derived from the command name by adding an\nunderscore prefix (in __git_func_wrap()).  So, in case of 'git', $name\nbecomes 'git', hence the completion function to be invoked is _git().\nSo far so good.\n\n> +\tlocal wrapper=\"_${name}_wrap\"\n\nBut then the wrapper function becomes _git_wrap().  Uh, oh.\n\n> +\teval \"$wrapper () { __git_func_wrap $name ; }\"\n\n... because this would then define the function _git_wrap(), which is\nnot good, because that's supposed to be the completion function for\nthe 'git wrap' command.\n\nThat's exactly why I wrote\n\n  local wrapper=\"__git_wrap_$1\"\n\nin my earlier post, and it was not an unnecessary change that could be\nsimplified away.\n\n\n> +\tcomplete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \\\n> +\t\t|| complete -o default -o nospace -F $wrapper $1\n> +}\n> +\n> +__git_complete git\n> +__git_complete gitk\n>  \n>  # The following are necessary only for Cygwin, and only are needed\n>  # when the user has tab-completed the executable name and consequently\n>  # included the '.exe' suffix.\n>  #\n>  if [ Cygwin = \"$(uname -o 2>/dev/null)\" ]; then\n> -complete -o bashdefault -o default -o nospace -F _git git.exe 2>/dev/null \\\n> -\t|| complete -o default -o nospace -F _git git.exe\n> +__git_complete git.exe git\n>  fi\n> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\n> index 5bda6b6..331a5b9 100755\n> --- a/t/t9902-completion.sh\n> +++ b/t/t9902-completion.sh\n> @@ -63,7 +63,7 @@ run_completion ()\n>  \tlocal _cword\n>  \t_words=( $1 )\n>  \t(( _cword = ${#_words[@]} - 1 ))\n> -\t_git && print_comp\n> +\t_git_wrap && print_comp\n>  }\n>  \n>  test_completion ()\n> -- \n> 1.7.10\n> \n"},{"id":"190982","messageId":"20120507100858.GQ2164@goldbirke","threadId":"30454","inReplyTo":"1336353800-17323-5-git-send-email-felipe.contreras@gmail.com","subject":"Re: [RFC/PATCH v4 4/6] completion: simplify command stuff","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2012-05-07T10:08:58Z","receivedAt":"2012-05-07T10:08:58Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Hi,\n\nOn Mon, May 07, 2012 at 03:23:18AM +0200, Felipe Contreras wrote:\n> No need to recalculate it.\n> \n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  contrib/completion/git-completion.bash |   14 +++++++-------\n>  1 file changed, 7 insertions(+), 7 deletions(-)\n\nThis seems to be the same patch you sent earlier as 7/12 in the first\nround.  I had a few comments back then, see\n\n  http://thread.gmane.org/gmane.comp.version-control.git/194958/focus=195276\n\nBut this $cmd variable will be only used in\n__git_complete_remote_or_refspec(), so perhaps your idea later in that\nthread about invoking it from _git_fetch() as\n\n  __git_complete_remote_or_refspec \"fetch\"\n\nwould be better.  That would only require one modification in its four\ncallers, but neither in _git() in this patch nor in __git_complete()\nlater in the series to set $cmd.\n\n\nBest,\nGábor\n\n\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 8de0358..e648d7c 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -723,7 +723,7 @@ __git_complete_revlist ()\n>  \n>  __git_complete_remote_or_refspec ()\n>  {\n> -\tlocal cur_=\"$cur\" cmd=\"${words[1]}\"\n> +\tlocal cur_=\"$cur\"\n>  \tlocal i c=2 remote=\"\" pfx=\"\" lhs=1 no_complete_refspec=0\n>  \tif [ \"$cmd\" = \"remote\" ]; then\n>  \t\t((c++))\n> @@ -2603,22 +2603,22 @@ _git_whatchanged ()\n>  \n>  _git ()\n>  {\n> -\tlocal i c=1 command __git_dir\n> +\tlocal i c=1 cmd __git_dir\n>  \n>  \twhile [ $c -lt $cword ]; do\n>  \t\ti=\"${words[c]}\"\n>  \t\tcase \"$i\" in\n>  \t\t--git-dir=*) __git_dir=\"${i#--git-dir=}\" ;;\n>  \t\t--bare)      __git_dir=\".\" ;;\n> -\t\t--help) command=\"help\"; break ;;\n> +\t\t--help) cmd=\"help\"; break ;;\n>  \t\t-c) c=$((++c)) ;;\n>  \t\t-*) ;;\n> -\t\t*) command=\"$i\"; break ;;\n> +\t\t*) cmd=\"$i\"; break ;;\n>  \t\tesac\n>  \t\t((c++))\n>  \tdone\n>  \n> -\tif [ -z \"$command\" ]; then\n> +\tif [ -z \"$cmd\" ]; then\n>  \t\tcase \"$cur\" in\n>  \t\t--*)   __gitcomp \"\n>  \t\t\t--paginate\n> @@ -2642,10 +2642,10 @@ _git ()\n>  \t\treturn\n>  \tfi\n>  \n> -\tlocal completion_func=\"_git_${command//-/_}\"\n> +\tlocal completion_func=\"_git_${cmd//-/_}\"\n>  \tdeclare -f $completion_func >/dev/null && $completion_func && return\n>  \n> -\tlocal expansion=$(__git_aliased_command \"$command\")\n> +\tlocal expansion=$(__git_aliased_command \"$cmd\")\n>  \tif [ -n \"$expansion\" ]; then\n>  \t\tcompletion_func=\"_git_${expansion//-/_}\"\n>  \t\tdeclare -f $completion_func >/dev/null && $completion_func\n> -- \n> 1.7.10\n> \n"},{"id":"191021","messageId":"7vfwbb6czu.fsf@alter.siamese.dyndns.org","threadId":"30454","inReplyTo":"1336353800-17323-2-git-send-email-felipe.contreras@gmail.com","subject":"Re: [RFC/PATCH v4 1/6] completion: add new __git_complete helper","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-05-07T18:51:33Z","receivedAt":"2012-05-07T18:51:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n\n> +# this is NOT a public function; use at your own risk\n> +__git_complete ()\n\nThe comment is enough to scare away people who might use it and then come\nback to complain when this changes its implementation detail, but saying\n\"This is not X\" without saying \"This does Y\" does not help those who want\nto contribute updates to git-completion script.  Is there a short and\nsweet description of what this is for and/or what this does?\n\n> +{\n> +\tlocal name=\"${2-$1}\"\n> +\tlocal wrapper=\"_${name}_wrap\"\n> +\teval \"$wrapper () { __git_func_wrap $name ; }\"\n> +\tcomplete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \\\n> +\t\t|| complete -o default -o nospace -F $wrapper $1\n> +}\n> +\n> +__git_complete git\n> +__git_complete gitk\n>  \n>  # The following are necessary only for Cygwin, and only are needed\n>  # when the user has tab-completed the executable name and consequently\n>  # included the '.exe' suffix.\n>  #\n>  if [ Cygwin = \"$(uname -o 2>/dev/null)\" ]; then\n> -complete -o bashdefault -o default -o nospace -F _git git.exe 2>/dev/null \\\n> -\t|| complete -o default -o nospace -F _git git.exe\n> +__git_complete git.exe git\n>  fi\n> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\n> index 5bda6b6..331a5b9 100755\n> --- a/t/t9902-completion.sh\n> +++ b/t/t9902-completion.sh\n> @@ -63,7 +63,7 @@ run_completion ()\n>  \tlocal _cword\n>  \t_words=( $1 )\n>  \t(( _cword = ${#_words[@]} - 1 ))\n> -\t_git && print_comp\n> +\t_git_wrap && print_comp\n>  }\n>  \n>  test_completion ()\n"},{"id":"191022","messageId":"7vbolz6cs9.fsf@alter.siamese.dyndns.org","threadId":"30454","inReplyTo":"1336353800-17323-7-git-send-email-felipe.contreras@gmail.com","subject":"Re: [RFC/PATCH v4 6/6] completion: add public _GIT_complete helper","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-05-07T18:56:06Z","receivedAt":"2012-05-07T18:56:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> So that users can easily define aliases, such as:\n>\n>  _GIT_complete gf git_fetch\n>\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  contrib/completion/git-completion.bash |   10 +++++-----\n>  t/t9902-completion.sh                  |    9 ++++++++-\n>  2 files changed, 13 insertions(+), 6 deletions(-)\n>\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 049110e..2b7ef02 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -2678,6 +2678,7 @@ _gitk ()\n>  \n>  __git_func_wrap ()\n>  {\n> +\tlocal cmd=\"${1#git_}\" cmd_pos=1\n>  \tif [[ -n ${ZSH_VERSION-} ]]; then\n>  \t\temulate -L bash\n>  \t\tsetopt KSH_TYPESET\n> @@ -2695,8 +2696,7 @@ __git_func_wrap ()\n>  \t_$1\n>  }\n>  \n> -# this is NOT a public function; use at your own risk\n> -__git_complete ()\n> +_GIT_complete ()\n\nIf it is now a public function, please have some description as to how to\nuse it for people who find this in the tarball extract.\n\nI am guessing that\n\n\t_GIT_complete frotz git_fetch\n\nis a way to declare that 'git frotz' wants the same kind of completion as\n'git fetch' command, but I am not sure, as if it were the case it strikes\nme somewhat odd that it is not \"_GIT_complete frotz fetch\".\n"},{"id":"191024","messageId":"7v7gwn6cmv.fsf@alter.siamese.dyndns.org","threadId":"30454","inReplyTo":"CAMP44s3Bscm0T_=-g-wRc9kkZYZjGHGaP6hPi8598=Oh=skjxw@mail.gmail.com","subject":"Re: [RFC/PATCH v4 5/6] completion: calculate argument position properly","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-05-07T18:59:20Z","receivedAt":"2012-05-07T18:59:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Mon, May 7, 2012 at 3:23 AM, Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n>\n>> @@ -2642,6 +2642,8 @@ _git ()\n>>                return\n>>        fi\n>>\n>> +       (( cmd_pos = c + 1 ))\n>\n> Actually, I would prefer cmd_pos=$((c + 1)).\n\nYeah, that would feel more natural.\n\nTogether with 4/6, I am guessing that you are using $cmd and $cmd_pos as a\nglobal variable to pass state to/from helper functions.  Are they properly\ndocumented in code (if not, please do so)?\n"},{"id":"191031","messageId":"CAMP44s15BbH2-kVQCO9s9ZEQLDTLcNRUw=4XiTmHoABa06kwUQ@mail.gmail.com","threadId":"30454","inReplyTo":"7vfwbb6czu.fsf@alter.siamese.dyndns.org","subject":"Re: [RFC/PATCH v4 1/6] completion: add new __git_complete helper","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-05-07T20:53:40Z","receivedAt":"2012-05-07T20:53:40Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, May 7, 2012 at 8:51 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>\n>> +# this is NOT a public function; use at your own risk\n>> +__git_complete ()\n>\n> The comment is enough to scare away people who might use it and then come\n> back to complain when this changes its implementation detail, but saying\n> \"This is not X\" without saying \"This does Y\" does not help those who want\n> to contribute updates to git-completion script.  Is there a short and\n> sweet description of what this is for and/or what this does?\n\nNo. And this patch is not meant to help those people; I don't even\nneed this, it's not my itch, I just did it because other people\ncomplained. Those people would have to scratch their own itch if they\nwant some description of __git_complete (), I only want to reorganize\nthe code and already did more than my fair share.\n\n-- \nFelipe Contreras\n"},{"id":"191032","messageId":"CAMP44s2H1Fn-wY9bBnsjVUgE5ZRM4q-kOAtSHTm=tb1ku2xCvA@mail.gmail.com","threadId":"30454","inReplyTo":"7vbolz6cs9.fsf@alter.siamese.dyndns.org","subject":"Re: [RFC/PATCH v4 6/6] completion: add public _GIT_complete helper","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-05-07T20:57:08Z","receivedAt":"2012-05-07T20:57:08Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, May 7, 2012 at 8:56 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> So that users can easily define aliases, such as:\n>>\n>>  _GIT_complete gf git_fetch\n>>\n>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>> ---\n>>  contrib/completion/git-completion.bash |   10 +++++-----\n>>  t/t9902-completion.sh                  |    9 ++++++++-\n>>  2 files changed, 13 insertions(+), 6 deletions(-)\n>>\n>> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n>> index 049110e..2b7ef02 100755\n>> --- a/contrib/completion/git-completion.bash\n>> +++ b/contrib/completion/git-completion.bash\n>> @@ -2678,6 +2678,7 @@ _gitk ()\n>>\n>>  __git_func_wrap ()\n>>  {\n>> +     local cmd=\"${1#git_}\" cmd_pos=1\n>>       if [[ -n ${ZSH_VERSION-} ]]; then\n>>               emulate -L bash\n>>               setopt KSH_TYPESET\n>> @@ -2695,8 +2696,7 @@ __git_func_wrap ()\n>>       _$1\n>>  }\n>>\n>> -# this is NOT a public function; use at your own risk\n>> -__git_complete ()\n>> +_GIT_complete ()\n>\n> If it is now a public function, please have some description as to how to\n> use it for people who find this in the tarball extract.\n\nThis is RFC, I'm not planning to push for this, I truly have given up on it.\n\n> I am guessing that\n>\n>        _GIT_complete frotz git_fetch\n>\n> is a way to declare that 'git frotz' wants the same kind of completion as\n> 'git fetch' command, but I am not sure, as if it were the case it strikes\n> me somewhat odd that it is not \"_GIT_complete frotz fetch\".\n\nYeah, I think that would be nicer, but one would need to take into\nconsideration the git/gitk cases.\n\nHopefully somebody else would pick this up and go through the eternal\nnitpicking.\n\nCheers.\n\n-- \nFelipe Contreras\n"},{"id":"191033","messageId":"CAMP44s3rC6bT3rjrBFdnywwsp5NrXt54L5L-7oKZ=bNFKccq+w@mail.gmail.com","threadId":"30454","inReplyTo":"7v7gwn6cmv.fsf@alter.siamese.dyndns.org","subject":"Re: [RFC/PATCH v4 5/6] completion: calculate argument position properly","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-05-07T21:01:12Z","receivedAt":"2012-05-07T21:01:12Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, May 7, 2012 at 8:59 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> On Mon, May 7, 2012 at 3:23 AM, Felipe Contreras\n>> <felipe.contreras@gmail.com> wrote:\n>>\n>>> @@ -2642,6 +2642,8 @@ _git ()\n>>>                return\n>>>        fi\n>>>\n>>> +       (( cmd_pos = c + 1 ))\n>>\n>> Actually, I would prefer cmd_pos=$((c + 1)).\n>\n> Yeah, that would feel more natural.\n>\n> Together with 4/6, I am guessing that you are using $cmd and $cmd_pos as a\n> global variable to pass state to/from helper functions.  Are they properly\n> documented in code (if not, please do so)?\n\nLike cur, prev, words, and cwords? Wait a second... they are not\ndocumented anywhere. I'm also not going to work on this... not my\nitch.\n\n-- \nFelipe Contreras\n"},{"id":"191045","messageId":"7v8vh34q1w.fsf@alter.siamese.dyndns.org","threadId":"30454","inReplyTo":"CAMP44s3rC6bT3rjrBFdnywwsp5NrXt54L5L-7oKZ=bNFKccq+w@mail.gmail.com","subject":"Re: [RFC/PATCH v4 5/6] completion: calculate argument position properly","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-05-07T21:52:27Z","receivedAt":"2012-05-07T21:52:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n>> Together with 4/6, I am guessing that you are using $cmd and $cmd_pos\n>> as a global variable to pass state to/from helper functions. Are they\n>> properly documented in code (if not, please do so)?\n>\n> Like cur, prev, words, and cwords? Wait a second... they are not\n> documented anywhere. I'm also not going to work on this... not my\n> itch.\n\nThe usual thing to do is to clean up after other people's mess while you\nare mucking with the vicinity of them anyway, especially if you are making\nthings worse by adding another.\n\nAnd I am fully aware that it may not be your itch---otherwise I wouldn't\nhave asked.  I would have said \"This needs to be fixed (or else)\".\n\nWhy is it that everybody on the list, who is working together well in the\ncommunity, seems to have trouble only when interacting with you?  Please\nremember that it is not my itch to live with an unnecessarily abrasive\nbehaviour from you, either.\n"},{"id":"191084","messageId":"CAMP44s187xd-78SUBVnc5qrgqi+n5ft1cASM4qAgMguApF+0Wg@mail.gmail.com","threadId":"30454","inReplyTo":"7v8vh34q1w.fsf@alter.siamese.dyndns.org","subject":"Re: [RFC/PATCH v4 5/6] completion: calculate argument position properly","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-05-08T12:50:30Z","receivedAt":"2012-05-08T12:50:30Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, May 7, 2012 at 11:52 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>>> Together with 4/6, I am guessing that you are using $cmd and $cmd_pos\n>>> as a global variable to pass state to/from helper functions. Are they\n>>> properly documented in code (if not, please do so)?\n>>\n>> Like cur, prev, words, and cwords? Wait a second... they are not\n>> documented anywhere. I'm also not going to work on this... not my\n>> itch.\n>\n> The usual thing to do is to clean up after other people's mess while you\n> are mucking with the vicinity of them anyway, especially if you are making\n> things worse by adding another.\n\nPeople have different ideas of what is a mess. You think it's a mess,\nI don't. Why should I clean it up?\n\nOf course, you as a maintainer have all the right to reject my patches\nbecause they introduce more \"mess\", and if I want the patch in, I am\nforced to do what you say, but it just so happens that I don't care if\nthis goes in or not, so I have the right to don't do anything; it's my\nown free time.\n\n> And I am fully aware that it may not be your itch---otherwise I wouldn't\n> have asked.  I would have said \"This needs to be fixed (or else)\".\n>\n> Why is it that everybody on the list, who is working together well in the\n> community, seems to have trouble only when interacting with you?  Please\n> remember that it is not my itch to live with an unnecessarily abrasive\n> behaviour from you, either.\n\nWhy am I being abrasive here? The only reason I sent these patches\nwas, as I said, to simplify the discussion about what would make\n'alias gf' work, I did not, and I do not intent to propose these\npatches for inclusion (as I know the pain (for me) that would entail).\n\nIf you would rather have me send no patches at all rather than to show\nwhat I have (in fact I cleaned them quite a lot) and stop there, I can\ndo that; less work for me.\n\nTo be honest, I don't see what's the problem in sending partial stuff;\nin a collaborative effort somebody else that actually has this itch\nwould pick these and finish the job; nothing wrong with that. Why\nshould it be me who finish the job? And why am I problematic if I\ndon't want to?\n\nAs I said, I only care about the first patch.\n\nCheers.\n\n-- \nFelipe Contreras\n"}]}