{"thread":{"id":"43067","subject":"[PATCH 10/10] Support bash completion of refs/remote.","startedAt":"2006-11-27T08:41:01Z","lastAt":"2006-11-27T20:49:13Z","messageCount":19,"participants":["Shawn O. Pearce","Jakub Narebski","Nicolas Vilz","Junio C Hamano","Shawn Pearce","Sean"],"isPatch":true,"patchVersion":1,"patchTotal":10},"messages":[{"id":"297675","messageId":"20061127084101.GB19745@spearce.org","threadId":"43067","inReplyTo":"de7beb117fb963e68e1085b773593be326ffd495.1164616814.git.spearce@spearce.org","subject":"[PATCH 2/10] Hide plumbing/transport commands from bash completion.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T08:41:01Z","receivedAt":"2006-11-27T08:41:01Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Users generally are not going to need to invoke plumbing-level commands\nfrom within one line shell commands.  If they are invoking these commands\nthen it is likely that they are glueing them together into a shell script\nto perform an action, in which case bash completion for these commands is\nof relatively little use.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |   62 +++++++++++++++++++++++++++++---\n 1 files changed, 57 insertions(+), 5 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 28bd0e3..b55431f 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -125,6 +125,58 @@ __git_complete_file ()\n \tesac\n }\n \n+__git_commands ()\n+{\n+\tlocal i IFS=\" \"$'\\n'\n+\tfor i in $(git help -a|egrep '^ ')\n+\tdo\n+\t\tcase $i in\n+\t\tcheck-ref-format) : plumbing;;\n+\t\tcommit-tree)      : plumbing;;\n+\t\tconvert-objects)  : plumbing;;\n+\t\tcvsserver)        : daemon;;\n+\t\tdaemon)           : daemon;;\n+\t\tfetch-pack)       : plumbing;;\n+\t\thash-object)      : plumbing;;\n+\t\thttp-*)           : transport;;\n+\t\tindex-pack)       : plumbing;;\n+\t\tlocal-fetch)      : plumbing;;\n+\t\tmailinfo)         : plumbing;;\n+\t\tmailsplit)        : plumbing;;\n+\t\tmerge-*)          : plumbing;;\n+\t\tmktree)           : plumbing;;\n+\t\tmktag)            : plumbing;;\n+\t\tpack-objects)     : plumbing;;\n+\t\tpack-redundant)   : plumbing;;\n+\t\tpack-refs)        : plumbing;;\n+\t\tparse-remote)     : plumbing;;\n+\t\tpatch-id)         : plumbing;;\n+\t\tpeek-remote)      : plumbing;;\n+\t\tread-tree)        : plumbing;;\n+\t\treceive-pack)     : plumbing;;\n+\t\trerere)           : plumbing;;\n+\t\trev-list)         : plumbing;;\n+\t\trev-parse)        : plumbing;;\n+\t\trunstatus)        : plumbing;;\n+\t\tsh-setup)         : internal;;\n+\t\tshell)            : daemon;;\n+\t\tsend-pack)        : plumbing;;\n+\t\tshow-index)       : plumbing;;\n+\t\tssh-*)            : transport;;\n+\t\tstripspace)       : plumbing;;\n+\t\tsymbolic-ref)     : plumbing;;\n+\t\tunpack-file)      : plumbing;;\n+\t\tunpack-objects)   : plumbing;;\n+\t\tupdate-ref)       : plumbing;;\n+\t\tupdate-server-info) : daemon;;\n+\t\tupload-archive)   : plumbing;;\n+\t\tupload-pack)      : plumbing;;\n+\t\twrite-tree)       : plumbing;;\n+\t\t*) echo $i;;\n+\t\tesac\n+\tdone\n+}\n+\n __git_aliases ()\n {\n \tlocal i IFS=$'\\n'\n@@ -355,11 +407,11 @@ _git ()\n \tdone\n \n \tif [ $c -eq $COMP_CWORD -a -z \"$command\" ]; then\n-\t\tCOMPREPLY=($(compgen \\\n-\t\t\t-W \"--git-dir= --version \\\n-\t\t\t\t$(git help -a|egrep '^ ') \\\n-\t\t\t    $(__git_aliases)\" \\\n-\t\t\t-- \"${COMP_WORDS[COMP_CWORD]}\"))\n+\t\tCOMPREPLY=($(compgen -W \"\n+\t\t\t--git-dir= --version --exec-path\n+\t\t\t$(__git_commands)\n+\t\t\t$(__git_aliases)\n+\t\t\t\" -- \"${COMP_WORDS[COMP_CWORD]}\"))\n \t\treturn;\n \tfi\n \n-- \n1.4.4.1.ge3fb\n"},{"id":"296100","messageId":"20061127084112.GC19745@spearce.org","threadId":"43067","inReplyTo":"de7beb117fb963e68e1085b773593be326ffd495.1164616814.git.spearce@spearce.org","subject":"[PATCH 3/10] Teach bash how to complete options for git-name-rev.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T08:41:12Z","receivedAt":"2006-11-27T08:41:12Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex b55431f..1dfb592 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -326,6 +326,12 @@ _git_merge_base ()\n \tCOMPREPLY=($(compgen -W \"$(__git_refs)\" -- \"$cur\"))\n }\n \n+_git_name_rev ()\n+{\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tCOMPREPLY=($(compgen -W \"--tags --all --stdin\" -- \"$cur\"))\n+}\n+\n _git_pull ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n@@ -430,6 +436,7 @@ _git ()\n \tls-tree)     _git_ls_tree ;;\n \tmerge)       _git_merge;;\n \tmerge-base)  _git_merge_base ;;\n+\tname-rev)    _git_name_rev ;;\n \tpull)        _git_pull ;;\n \tpush)        _git_push ;;\n \treset)       _git_reset ;;\n@@ -459,6 +466,7 @@ complete -o default            -F _git_ls_remote git-ls-remote\n complete -o default -o nospace -F _git_ls_tree git-ls-tree\n complete -o default            -F _git_merge git-merge\n complete -o default            -F _git_merge_base git-merge-base\n+complete -o default            -F _git_name_rev git-name-rev\n complete -o default -o nospace -F _git_pull git-pull\n complete -o default -o nospace -F _git_push git-push\n complete -o default            -F _git_reset git-reset\n@@ -479,6 +487,7 @@ complete -o default -o nospace -F _git_diff_tree git-diff-tree.exe\n complete -o default -o nospace -F _git_log git-log.exe\n complete -o default -o nospace -F _git_ls_tree git-ls-tree.exe\n complete -o default            -F _git_merge_base git-merge-base.exe\n+complete -o default            -F _git_name_rev git-name-rev.exe\n complete -o default -o nospace -F _git_push git-push.exe\n complete -o default -o nospace -F _git_log git-show-branch.exe\n complete -o default -o nospace -F _git_log git-whatchanged.exe\n-- \n1.4.4.1.ge3fb\n"},{"id":"295060","messageId":"20061127084128.GD19745@spearce.org","threadId":"43067","inReplyTo":"de7beb117fb963e68e1085b773593be326ffd495.1164616814.git.spearce@spearce.org","subject":"[PATCH 4/10] Add current branch in PS1 support to git-completion.bash.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T08:41:28Z","receivedAt":"2006-11-27T08:41:28Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Many users want to display the current branch name of the current git\nrepository as part of their PS1 prompt, much as their PS1 prompt might\nalso display the current working directory name.\n\nWe don't force our own PS1 onto the user.  Instead we let them craft\ntheir own PS1 string and offer them the function __git_ps1 which they\ncan invoke to obtain either \"\" (when not in a git repository) or\n\"(%s)\" where %s is the name of the current branch, as read from HEAD,\nwith the leading refs/heads/ removed.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |   19 +++++++++++++++++++\n 1 files changed, 19 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 1dfb592..a740d05 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -18,12 +18,31 @@\n #    2) Added the following line to your .bashrc:\n #        source ~/.git-completion.sh\n #\n+#    3) Consider changing your PS1 to also show the current branch:\n+#        PS1='[\\u@\\h \\W$(__git_ps1 \" (%s)\")]\\$ '\n+#\n+#       The argument to __git_ps1 will be displayed only if you\n+#       are currently in a git repository.  The %s token will be\n+#       the name of the current branch.\n+#\n \n __gitdir ()\n {\n \techo \"${__git_dir:-$(git rev-parse --git-dir 2>/dev/null)}\"\n }\n \n+__git_ps1 ()\n+{\n+\tlocal b=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n+\tif [ -n \"$b\" ]; then\n+\t\tif [ -n \"$1\" ]; then\n+\t\t\tprintf \"$1\" \"${b##refs/heads/}\"\n+\t\telse\n+\t\t\tprintf \" (%s)\" \"${b##refs/heads/}\"\n+\t\tfi\n+\tfi\n+}\n+\n __git_refs ()\n {\n \tlocal cmd i is_hash=y dir=\"${1:-$(__gitdir)}\"\n-- \n1.4.4.1.ge3fb\n"},{"id":"296192","messageId":"20061127084143.GE19745@spearce.org","threadId":"43067","inReplyTo":"de7beb117fb963e68e1085b773593be326ffd495.1164616814.git.spearce@spearce.org","subject":"[PATCH 5/10] Teach bash how to complete git-format-patch.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T08:41:43Z","receivedAt":"2006-11-27T08:41:43Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Provide completion for currently known long options supported by\ngit-format-patch as well as the revision list specification argument,\nwhich is generally either a refname or in the form a..b.\n\nSince _git_log was the only code that knew how to complete a..b, but\nwe want to start adding option support to _git_log also refactor the\na..b completion logic out into its own function.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |   60 +++++++++++++++++++++++--------\n 1 files changed, 44 insertions(+), 16 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex a740d05..729e5a9 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -144,6 +144,26 @@ __git_complete_file ()\n \tesac\n }\n \n+__git_complete_revlist ()\n+{\n+\tlocal pfx cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t*...*)\n+\t\tpfx=\"${cur%...*}...\"\n+\t\tcur=\"${cur#*...}\"\n+\t\tCOMPREPLY=($(compgen -P \"$pfx\" -W \"$(__git_refs)\" -- \"$cur\"))\n+\t\t;;\n+\t*..*)\n+\t\tpfx=\"${cur%..*}..\"\n+\t\tcur=\"${cur#*..}\"\n+\t\tCOMPREPLY=($(compgen -P \"$pfx\" -W \"$(__git_refs)\" -- \"$cur\"))\n+\t\t;;\n+\t*)\n+\t\tCOMPREPLY=($(compgen -W \"$(__git_refs)\" -- \"$cur\"))\n+\t\t;;\n+\tesac\n+}\n+\n __git_commands ()\n {\n \tlocal i IFS=\" \"$'\\n'\n@@ -290,6 +310,26 @@ _git_fetch ()\n \tesac\n }\n \n+_git_format_patch ()\n+{\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--*)\n+\t\tCOMPREPLY=($(compgen -W \"\n+\t\t\t--stdout --attach --thread\n+\t\t\t--output-directory\n+\t\t\t--numbered --start-number\n+\t\t\t--keep-subject\n+\t\t\t--signoff\n+\t\t\t--in-repy-to=\n+\t\t\t--full-index --binary\n+\t\t\t\" -- \"$cur\"))\n+\t\treturn\n+\t\t;;\n+\tesac\n+\t__git_complete_revlist\n+}\n+\n _git_ls_remote ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n@@ -303,22 +343,7 @@ _git_ls_tree ()\n \n _git_log ()\n {\n-\tlocal pfx cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tcase \"$cur\" in\n-\t*...*)\n-\t\tpfx=\"${cur%...*}...\"\n-\t\tcur=\"${cur#*...}\"\n-\t\tCOMPREPLY=($(compgen -P \"$pfx\" -W \"$(__git_refs)\" -- \"$cur\"))\n-\t\t;;\n-\t*..*)\n-\t\tpfx=\"${cur%..*}..\"\n-\t\tcur=\"${cur#*..}\"\n-\t\tCOMPREPLY=($(compgen -P \"$pfx\" -W \"$(__git_refs)\" -- \"$cur\"))\n-\t\t;;\n-\t*)\n-\t\tCOMPREPLY=($(compgen -W \"$(__git_refs)\" -- \"$cur\"))\n-\t\t;;\n-\tesac\n+\t__git_complete_revlist\n }\n \n _git_merge ()\n@@ -450,6 +475,7 @@ _git ()\n \tdiff)        _git_diff ;;\n \tdiff-tree)   _git_diff_tree ;;\n \tfetch)       _git_fetch ;;\n+\tformat-patch) _git_format_patch ;;\n \tlog)         _git_log ;;\n \tls-remote)   _git_ls_remote ;;\n \tls-tree)     _git_ls_tree ;;\n@@ -480,6 +506,7 @@ complete -o default            -F _git_checkout git-checkout\n complete -o default -o nospace -F _git_diff git-diff\n complete -o default            -F _git_diff_tree git-diff-tree\n complete -o default -o nospace -F _git_fetch git-fetch\n+complete -o default -o nospace -F _git_format_patch git-format-patch\n complete -o default -o nospace -F _git_log git-log\n complete -o default            -F _git_ls_remote git-ls-remote\n complete -o default -o nospace -F _git_ls_tree git-ls-tree\n@@ -503,6 +530,7 @@ complete -o default            -F _git_branch git-branch.exe\n complete -o default -o nospace -F _git_cat_file git-cat-file.exe\n complete -o default -o nospace -F _git_diff git-diff.exe\n complete -o default -o nospace -F _git_diff_tree git-diff-tree.exe\n+complete -o default -o nospace -F _git_format_patch git-format-patch.exe\n complete -o default -o nospace -F _git_log git-log.exe\n complete -o default -o nospace -F _git_ls_tree git-ls-tree.exe\n complete -o default            -F _git_merge_base git-merge-base.exe\n-- \n1.4.4.1.ge3fb\n"},{"id":"298480","messageId":"20061127084159.GF19745@spearce.org","threadId":"43067","inReplyTo":"de7beb117fb963e68e1085b773593be326ffd495.1164616814.git.spearce@spearce.org","subject":"[PATCH 6/10] Teach bash how to complete git-cherry-pick.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T08:41:59Z","receivedAt":"2006-11-27T08:41:59Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |   17 +++++++++++++++++\n 1 files changed, 17 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 729e5a9..02a60a0 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -269,6 +269,21 @@ _git_checkout ()\n \tCOMPREPLY=($(compgen -W \"-l -b $(__git_refs)\" -- \"$cur\"))\n }\n \n+_git_cherry_pick ()\n+{\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--*)\n+\t\tCOMPREPLY=($(compgen -W \"\n+\t\t\t--edit --no-commit\n+\t\t\t\" -- \"$cur\"))\n+\t\t;;\n+\t*)\n+\t\tCOMPREPLY=($(compgen -W \"$(__git_refs)\" -- \"$cur\"))\n+\t\t;;\n+\tesac\n+}\n+\n _git_diff ()\n {\n \t__git_complete_file\n@@ -472,6 +487,7 @@ _git ()\n \tbranch)      _git_branch ;;\n \tcat-file)    _git_cat_file ;;\n \tcheckout)    _git_checkout ;;\n+\tcherry-pick) _git_cherry_pick ;;\n \tdiff)        _git_diff ;;\n \tdiff-tree)   _git_diff_tree ;;\n \tfetch)       _git_fetch ;;\n@@ -503,6 +519,7 @@ complete -o default            -F _gitk gitk\n complete -o default            -F _git_branch git-branch\n complete -o default -o nospace -F _git_cat_file git-cat-file\n complete -o default            -F _git_checkout git-checkout\n+complete -o default            -F _git_cherry_pick git-cherry-pick\n complete -o default -o nospace -F _git_diff git-diff\n complete -o default            -F _git_diff_tree git-diff-tree\n complete -o default -o nospace -F _git_fetch git-fetch\n-- \n1.4.4.1.ge3fb\n"},{"id":"293909","messageId":"20061127084207.GG19745@spearce.org","threadId":"43067","inReplyTo":"de7beb117fb963e68e1085b773593be326ffd495.1164616814.git.spearce@spearce.org","subject":"[PATCH 7/10] Teach bash how to complete git-rebase.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T08:42:07Z","receivedAt":"2006-11-27T08:42:07Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"As git-rebase is a popular command bash should know how to complete\nreference names and its long options.  We only support completions\nwhich make sense given the current state of the repository, that\nway users don't get shown --continue/--skip/--abort on the first\nexecution.\n\nAlso added support for long option --strategy to git-merge, as I\nmissed that option earlier and just noticed it while implementing\ngit-rebase.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |   38 ++++++++++++++++++++++++++-----\n 1 files changed, 32 insertions(+), 6 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 02a60a0..a61b6b9 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -367,16 +367,16 @@ _git_merge ()\n \tcase \"$cur\" in\n \t--*)\n \t\tCOMPREPLY=($(compgen -W \"\n-\t\t\t--no-commit --no-summary --squash\n+\t\t\t--no-commit --no-summary --squash --strategy\n \t\t\t\" -- \"$cur\"))\n \t\treturn\n \tesac\n-\tif [ $COMP_CWORD -gt 1 -a X-s = \"X${COMP_WORDS[COMP_CWORD-1]}\" ]\n-\tthen\n+\tcase \"${COMP_WORDS[COMP_CWORD-1]}\" in\n+\t-s|--strategy)\n \t\tCOMPREPLY=($(compgen -W \"$(__git_merge_strategies)\" -- \"$cur\"))\n-\telse\n-\t\tCOMPREPLY=($(compgen -W \"$(__git_refs)\" -- \"$cur\"))\n-\tfi\n+\t\treturn\n+\tesac\n+\tCOMPREPLY=($(compgen -W \"$(__git_refs)\" -- \"$cur\"))\n }\n \n _git_merge_base ()\n@@ -443,6 +443,30 @@ _git_push ()\n \tesac\n }\n \n+_git_rebase ()\n+{\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tif [ -d .dotest ]; then\n+\t\tCOMPREPLY=($(compgen -W \"\n+\t\t\t--continue --skip --abort\n+\t\t\t\" -- \"$cur\"))\n+\t\treturn\n+\tfi\n+\tcase \"$cur\" in\n+\t--*)\n+\t\tCOMPREPLY=($(compgen -W \"\n+\t\t\t--onto --merge --strategy\n+\t\t\t\" -- \"$cur\"))\n+\t\treturn\n+\tesac\n+\tcase \"${COMP_WORDS[COMP_CWORD-1]}\" in\n+\t-s|--strategy)\n+\t\tCOMPREPLY=($(compgen -W \"$(__git_merge_strategies)\" -- \"$cur\"))\n+\t\treturn\n+\tesac\n+\tCOMPREPLY=($(compgen -W \"$(__git_refs)\" -- \"$cur\"))\n+}\n+\n _git_reset ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n@@ -500,6 +524,7 @@ _git ()\n \tname-rev)    _git_name_rev ;;\n \tpull)        _git_pull ;;\n \tpush)        _git_push ;;\n+\trebase)      _git_rebase ;;\n \treset)       _git_reset ;;\n \tshow)        _git_show ;;\n \tshow-branch) _git_log ;;\n@@ -532,6 +557,7 @@ complete -o default            -F _git_merge_base git-merge-base\n complete -o default            -F _git_name_rev git-name-rev\n complete -o default -o nospace -F _git_pull git-pull\n complete -o default -o nospace -F _git_push git-push\n+complete -o default            -F _git_rebase git-rebase\n complete -o default            -F _git_reset git-reset\n complete -o default            -F _git_show git-show\n complete -o default -o nospace -F _git_log git-show-branch\n-- \n1.4.4.1.ge3fb\n"},{"id":"298291","messageId":"20061127084218.GH19745@spearce.org","threadId":"43067","inReplyTo":"de7beb117fb963e68e1085b773593be326ffd495.1164616814.git.spearce@spearce.org","subject":"[PATCH 8/10] Teach bash about git log/show/whatchanged options.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T08:42:18Z","receivedAt":"2006-11-27T08:42:18Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Typing out options to git log/show/whatchanged can take a while, but\nwe can easily complete them with bash.  So list the most common ones,\nespecially --pretty=online|short|medium|... so that users don't need\nto type everything out.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |   34 ++++++++++++++++++++++++-------\n 1 files changed, 26 insertions(+), 8 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex a61b6b9..8acfb09 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -358,6 +358,29 @@ _git_ls_tree ()\n \n _git_log ()\n {\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--pretty=*)\n+\t\tCOMPREPLY=($(compgen -W \"\n+\t\t\toneline short medium full fuller email raw\n+\t\t\t\" -- \"${cur##--pretty=}\"))\n+\t\treturn\n+\t\t;;\n+\t--*)\n+\t\tCOMPREPLY=($(compgen -W \"\n+\t\t\t--max-count= --max-age= --since= --after=\n+\t\t\t--min-age= --before= --until=\n+\t\t\t--root --not --topo-order --date-order\n+\t\t\t--no-merges\n+\t\t\t--abbrev-commit --abbrev=\n+\t\t\t--relative-date\n+\t\t\t--author= --committer= --grep=\n+\t\t\t--all-match\n+\t\t\t--pretty= --name-status --name-only\n+\t\t\t\" -- \"$cur\"))\n+\t\treturn\n+\t\t;;\n+\tesac\n \t__git_complete_revlist\n }\n \n@@ -474,12 +497,6 @@ _git_reset ()\n \tCOMPREPLY=($(compgen -W \"$opt $(__git_refs)\" -- \"$cur\"))\n }\n \n-_git_show ()\n-{\n-\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tCOMPREPLY=($(compgen -W \"$(__git_refs)\" -- \"$cur\"))\n-}\n-\n _git ()\n {\n \tlocal i c=1 command __git_dir\n@@ -526,7 +543,7 @@ _git ()\n \tpush)        _git_push ;;\n \trebase)      _git_rebase ;;\n \treset)       _git_reset ;;\n-\tshow)        _git_show ;;\n+\tshow)        _git_log ;;\n \tshow-branch) _git_log ;;\n \twhatchanged) _git_log ;;\n \t*)           COMPREPLY=() ;;\n@@ -559,7 +576,7 @@ complete -o default -o nospace -F _git_pull git-pull\n complete -o default -o nospace -F _git_push git-push\n complete -o default            -F _git_rebase git-rebase\n complete -o default            -F _git_reset git-reset\n-complete -o default            -F _git_show git-show\n+complete -o default            -F _git_log git-show\n complete -o default -o nospace -F _git_log git-show-branch\n complete -o default -o nospace -F _git_log git-whatchanged\n \n@@ -579,6 +596,7 @@ complete -o default -o nospace -F _git_ls_tree git-ls-tree.exe\n complete -o default            -F _git_merge_base git-merge-base.exe\n complete -o default            -F _git_name_rev git-name-rev.exe\n complete -o default -o nospace -F _git_push git-push.exe\n+complete -o default -o nospace -F _git_log git-show.exe\n complete -o default -o nospace -F _git_log git-show-branch.exe\n complete -o default -o nospace -F _git_log git-whatchanged.exe\n fi\n-- \n1.4.4.1.ge3fb\n"},{"id":"293972","messageId":"20061127084228.GI19745@spearce.org","threadId":"43067","inReplyTo":"de7beb117fb963e68e1085b773593be326ffd495.1164616814.git.spearce@spearce.org","subject":"[PATCH 9/10] Allow completion of --committer and --author arguments to git log.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T08:42:28Z","receivedAt":"2006-11-27T08:42:28Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"This is just a cute hack, but we can (easily) complete the parameter\nto --author or --committer in bash by asking for all possible authors\nor committers in this project from git log and offering them up as\nvalid choices.\n\nWe replace spaces with dots as this prevents names with spaces from\nappearing as two parameters rather than one, yet it still matches the\nspace in the field.\n\nCurrently my Mac OS X system takes ~5 seconds to compute the completions\nfor --author on git.git and ~4 seconds to compute the completions for\n--committer on same.  I imagine it would take longer on more active\nprojects, but its a good way to see if the name you are entering is\ngoing to be unique or not.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |   20 ++++++++++++++++++++\n 1 files changed, 20 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 8acfb09..b456a3b 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -360,6 +360,26 @@ _git_log ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n \tcase \"$cur\" in\n+\t--committer=*)\n+\t\tCOMPREPLY=($(compgen -W \"$(git log --pretty=raw --all \\\n+\t\t\t| sed -n -e \"/^committer /{\n+\t\t\t\ts/^committer //\n+\t\t\t\ts/ <.*//\n+\t\t\t\ts/ /./g\n+\t\t\t\tp\n+\t\t\t}\")\" -- \"${cur##--committer=}\"))\n+\t\treturn\n+\t\t;;\n+\t--author=*)\n+\t\tCOMPREPLY=($(compgen -W \"$(git log --pretty=raw --all \\\n+\t\t\t| sed -n -e \"/^author /{\n+\t\t\t\ts/^author //\n+\t\t\t\ts/ <.*//\n+\t\t\t\ts/ /./g\n+\t\t\t\tp\n+\t\t\t}\")\" -- \"${cur##--author=}\"))\n+\t\treturn\n+\t\t;;\n \t--pretty=*)\n \t\tCOMPREPLY=($(compgen -W \"\n \t\t\toneline short medium full fuller email raw\n-- \n1.4.4.1.ge3fb\n"},{"id":"293804","messageId":"20061127084232.GJ19745@spearce.org","threadId":"43067","inReplyTo":"de7beb117fb963e68e1085b773593be326ffd495.1164616814.git.spearce@spearce.org","subject":"[PATCH 10/10] Support bash completion of refs/remote.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T08:42:32Z","receivedAt":"2006-11-27T08:42:32Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Now that people are really likely to start using separate remotes\n(due to the default in git-clone changing) we should support ref\ncompletion for these refs in as many commands as possible.\n\nWhile we are working on this routine we should use for-each-ref\nto obtain a list of local refs, as this should run faster than\npeek-remote as it does not need to dereference tag objects in\norder to produce the list of refs back to us.  It should also\nbe more friendly to users of StGIT as we won't generate a list\nof the StGIT metadata refs.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |   18 ++++++++++++++----\n 1 files changed, 14 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex b456a3b..df67f8e 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -47,16 +47,26 @@ __git_refs ()\n {\n \tlocal cmd i is_hash=y dir=\"${1:-$(__gitdir)}\"\n \tif [ -d \"$dir\" ]; then\n-\t\tcmd=git-peek-remote\n-\telse\n-\t\tcmd=git-ls-remote\n+\t\tif [ -e \"$dir/HEAD\" ]; then echo HEAD; fi\n+\t\tfor i in $(git --git-dir=\"$dir\" \\\n+\t\t\tfor-each-ref --format='%(refname)' \\\n+\t\t\trefs/tags refs/heads refs/remotes); do\n+\t\t\tcase \"$i\" in\n+\t\t\t\trefs/tags/*)    echo \"${i#refs/tags/}\" ;;\n+\t\t\t\trefs/heads/*)   echo \"${i#refs/heads/}\" ;;\n+\t\t\t\trefs/remotes/*) echo \"${i#refs/remotes/}\" ;;\n+\t\t\t\t*)              echo \"$i\" ;;\n+\t\t\tesac\n+\t\tdone\n+\t\treturn\n \tfi\n-\tfor i in $($cmd \"$dir\" 2>/dev/null); do\n+\tfor i in $(git-ls-remote \"$dir\" 2>/dev/null); do\n \t\tcase \"$is_hash,$i\" in\n \t\ty,*) is_hash=n ;;\n \t\tn,*^{}) is_hash=y ;;\n \t\tn,refs/tags/*) is_hash=y; echo \"${i#refs/tags/}\" ;;\n \t\tn,refs/heads/*) is_hash=y; echo \"${i#refs/heads/}\" ;;\n+\t\tn,refs/remotes/*) is_hash=y; echo \"${i#refs/remotes/}\" ;;\n \t\tn,*) is_hash=y; echo \"$i\" ;;\n \t\tesac\n \tdone\n-- \n"},{"id":"294031","messageId":"eke8ok$1k5$1@sea.gmane.org","threadId":"43067","inReplyTo":"20061127084143.GE19745@spearce.org","subject":"Re: [PATCH 5/10] Teach bash how to complete git-format-patch.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-27T08:50:06Z","receivedAt":"2006-11-27T08:50:06Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Shawn O. Pearce wrote:\n\n> +                       --in-repy-to=\n\n--in-reply-to I think. And why his sole option has '='?\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"294376","messageId":"20061127102831.GA5428@fry.bender.fht","threadId":"43067","inReplyTo":"20061127084228.GI19745@spearce.org","subject":"Re: [PATCH 9/10] Allow completion of --committer and --author arguments to git log.","fromName":"Nicolas Vilz","fromEmail":"niv@iaglans.de","sentAt":"2006-11-27T10:28:32Z","receivedAt":"2006-11-27T10:28:32Z","isPatch":true,"sender":{"key":"niv@iaglans.de","avatar":"https://gravatar.com/avatar/e4d43a32d721241212d4edb1d2210327e28423c913071b4bfeeaa0ce15296110?d=mp&s=160"},"body":"On Mon, Nov 27, 2006 at 03:42:28AM -0500, Shawn O. Pearce wrote:\n> This is just a cute hack, but we can (easily) complete the parameter\n> to --author or --committer in bash by asking for all possible authors\n> or committers in this project from git log and offering them up as\n> valid choices.\n> \n> We replace spaces with dots as this prevents names with spaces from\n> appearing as two parameters rather than one, yet it still matches the\n> space in the field.\nis it hard to train bash-completion to use \"\" and spaces instead of \nreplacing spaces by dots? Besides, great feature, thank you for that... \nthat's very handy.\n\nSincerly\n"},{"id":"298007","messageId":"BAYC1-PASMTP02E79ADEE48804655B6FC8AEE60@CEZ.ICE","threadId":"43067","inReplyTo":"20061127084128.GD19745@spearce.org","subject":"Re: [PATCH 4/10] Add current branch in PS1 support to git-completion.bash.","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2006-11-27T15:31:11Z","receivedAt":"2006-11-27T15:31:11Z","isPatch":true,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Mon, 27 Nov 2006 03:41:28 -0500\n\"Shawn O. Pearce\" <spearce@spearce.org> wrote:\n\n> Many users want to display the current branch name of the current git\n> repository as part of their PS1 prompt, much as their PS1 prompt might\n> also display the current working directory name.\n> \n> We don't force our own PS1 onto the user.  Instead we let them craft\n> their own PS1 string and offer them the function __git_ps1 which they\n> can invoke to obtain either \"\" (when not in a git repository) or\n> \"(%s)\" where %s is the name of the current branch, as read from HEAD,\n> with the leading refs/heads/ removed.\n\nSuppose it doesn't hurt to include support for this in git completion\nscripts.  It doesn't look like __git_ps1 is a proper name though,\nperhaps __git_branch or __git_current_branch would be better?\n\n"},{"id":"295774","messageId":"20061127164655.GA6616@spearce.org","threadId":"43067","inReplyTo":"20061127102831.GA5428@fry.bender.fht","subject":"Re: [PATCH 9/10] Allow completion of --committer and --author arguments to git log.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T16:46:55Z","receivedAt":"2006-11-27T16:46:55Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Nicolas Vilz <niv@iaglans.de> wrote:\n> On Mon, Nov 27, 2006 at 03:42:28AM -0500, Shawn O. Pearce wrote:\n> > This is just a cute hack, but we can (easily) complete the parameter\n> > to --author or --committer in bash by asking for all possible authors\n> > or committers in this project from git log and offering them up as\n> > valid choices.\n> > \n> > We replace spaces with dots as this prevents names with spaces from\n> > appearing as two parameters rather than one, yet it still matches the\n> > space in the field.\n>\n> is it hard to train bash-completion to use \"\" and spaces instead of \n> replacing spaces by dots? Besides, great feature, thank you for that... \n> that's very handy.\n\nI tried.  Bash did not listen.  :-)\n\nI tried \"\", '', \\<sp>.  None of them carried into the completion.\nObviously I was doing something wrong, but right now I don't know\nwhat that was.  I spent 22 minutes on it and just caved in with\ndots when it worked and nothing else did.\n\n-- \n"},{"id":"297655","messageId":"20061127165122.GB6616@spearce.org","threadId":"43067","inReplyTo":"20061127103111.4835bffc.seanlkml@sympatico.ca","subject":"Re: [PATCH 4/10] Add current branch in PS1 support to git-completion.bash.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T16:51:23Z","receivedAt":"2006-11-27T16:51:23Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Sean <seanlkml@sympatico.ca> wrote:\n> On Mon, 27 Nov 2006 03:41:28 -0500\n> \"Shawn O. Pearce\" <spearce@spearce.org> wrote:\n> \n> > Many users want to display the current branch name of the current git\n> > repository as part of their PS1 prompt, much as their PS1 prompt might\n> > also display the current working directory name.\n> > \n> > We don't force our own PS1 onto the user.  Instead we let them craft\n> > their own PS1 string and offer them the function __git_ps1 which they\n> > can invoke to obtain either \"\" (when not in a git repository) or\n> > \"(%s)\" where %s is the name of the current branch, as read from HEAD,\n> > with the leading refs/heads/ removed.\n> \n> Suppose it doesn't hurt to include support for this in git completion\n> scripts.  It doesn't look like __git_ps1 is a proper name though,\n> perhaps __git_branch or __git_current_branch would be better?\n\nI actually started with the name __git_current_branch but changed\nmy mind on that and went with __git_ps1.\n\nMy rationale at the time was probably not correct (it was early this\nmorning) but I figured that the current branch name is \"master\"\nwhile __git_ps1 prints \" (master)\".  Therefore __git_ps1 is not\nreally printing the current branch, its printing the current branch\nand other stuff.  So I went with a name which implied its purpose.\n\n-- \n"},{"id":"295783","messageId":"BAYC1-PASMTP109DA8BB360DD64E76B7B0AEE60@CEZ.ICE","threadId":"43067","inReplyTo":"20061127165122.GB6616@spearce.org","subject":"Re: [PATCH 4/10] Add current branch in PS1 support to git-completion.bash.","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2006-11-27T17:26:53Z","receivedAt":"2006-11-27T17:26:53Z","isPatch":true,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Mon, 27 Nov 2006 11:51:23 -0500\nShawn Pearce <spearce@spearce.org> wrote:\n\n> I actually started with the name __git_current_branch but changed\n> my mind on that and went with __git_ps1.\n> \n> My rationale at the time was probably not correct (it was early this\n> morning) but I figured that the current branch name is \"master\"\n> while __git_ps1 prints \" (master)\".  Therefore __git_ps1 is not\n> really printing the current branch, its printing the current branch\n> and other stuff.  So I went with a name which implied its purpose.\n\nAhh, I had missed that, it makes some sense.  Although it goes a bit\nagainst the commit message that the user is free to construct whatever\nPS1 format they like (ie. they're stuck with parenthesis around the\nbranch name).\n\nJust thinking out loud, what about allowing __git_ps1 to take a\nformat string of its own?  It could parse options like  \"(\\b)\"\nto mean git branch surrounded by parenthesis.  But you could\nalso do \"[\\b]\" or \"!\\b\" if you preferred.\n\nThen adding additional options would be easy, like \"\\r\" for\nrepo relative path etc... and the user really could create just\nabout any git prompt they wanted.  Of course, if __git_ps1\nsees it's not in a git directory, it would always return an\nempty string.\n\nBut that's maybe all too complicated to be worthwhile.  It's\nsomething that could be considered for the git --show-ps1 option\nthough.\n\n"},{"id":"297559","messageId":"20061127173136.GD6616@spearce.org","threadId":"43067","inReplyTo":"20061127122653.3e801d7a.seanlkml@sympatico.ca","subject":"Re: [PATCH 4/10] Add current branch in PS1 support to git-completion.bash.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T17:31:36Z","receivedAt":"2006-11-27T17:31:36Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Sean <seanlkml@sympatico.ca> wrote:\n> On Mon, 27 Nov 2006 11:51:23 -0500\n> Shawn Pearce <spearce@spearce.org> wrote:\n> \n> > I actually started with the name __git_current_branch but changed\n> > my mind on that and went with __git_ps1.\n> > \n> > My rationale at the time was probably not correct (it was early this\n> > morning) but I figured that the current branch name is \"master\"\n> > while __git_ps1 prints \" (master)\".  Therefore __git_ps1 is not\n> > really printing the current branch, its printing the current branch\n> > and other stuff.  So I went with a name which implied its purpose.\n> \n> Ahh, I had missed that, it makes some sense.  Although it goes a bit\n> against the commit message that the user is free to construct whatever\n> PS1 format they like (ie. they're stuck with parenthesis around the\n> branch name).\n> \n> Just thinking out loud, what about allowing __git_ps1 to take a\n> format string of its own?  It could parse options like  \"(\\b)\"\n> to mean git branch surrounded by parenthesis.  But you could\n> also do \"[\\b]\" or \"!\\b\" if you preferred.\n\nI did that.  :-)\n\nIf you read the implementation of __git_ps1 the default format is\n\" (%s)\" but you can pass anything you want as the first parameter.\n \n-- \n"},{"id":"297866","messageId":"BAYC1-PASMTP11F1E3F750BA675B27EC9EAEE60@CEZ.ICE","threadId":"43067","inReplyTo":"20061127173136.GD6616@spearce.org","subject":"Re: [PATCH 4/10] Add current branch in PS1 support to git-completion.bash.","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2006-11-27T17:45:41Z","receivedAt":"2006-11-27T17:45:41Z","isPatch":true,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Mon, 27 Nov 2006 12:31:36 -0500\nShawn Pearce <spearce@spearce.org> wrote:\n\n> I did that.  :-)\n> \n> If you read the implementation of __git_ps1 the default format is\n> \" (%s)\" but you can pass anything you want as the first parameter.\n\nlol, you're good.  I'm back to thinking it's slightly misnamed though,\nas that %s can only ever mean branch.  But it's really a minor nit,\nsorry for the noise.  Good work.\n\n"},{"id":"294755","messageId":"7vy7pwfxp8.fsf@assigned-by-dhcp.cox.net","threadId":"43067","inReplyTo":"20061127084228.GI19745@spearce.org","subject":"Re: [PATCH 9/10] Allow completion of --committer and --author arguments to git log.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-27T20:20:51Z","receivedAt":"2006-11-27T20:20:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n> This is just a cute hack, but we can (easily) complete the parameter\n> to --author or --committer in bash by asking for all possible authors\n> or committers in this project from git log and offering them up as\n> valid choices.\n\nEasily but slowly ;-).  Try this in the kernel repository\n\n\tgit log --author=Andre<TAB>\n\nand watch the paint dry.  You might want to have an extra shell\nto run top before you hit the TAB key.\n\nIt indeed is cute, but I think most people would wonder if the\nterminal went dead, especially without any progress indicators.\n\n"},{"id":"297921","messageId":"20061127204913.GB7331@spearce.org","threadId":"43067","inReplyTo":"7vy7pwfxp8.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 9/10] Allow completion of --committer and --author arguments to git log.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T20:49:13Z","receivedAt":"2006-11-27T20:49:13Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> \"Shawn O. Pearce\" <spearce@spearce.org> writes:\n> \n> > This is just a cute hack, but we can (easily) complete the parameter\n> > to --author or --committer in bash by asking for all possible authors\n> > or committers in this project from git log and offering them up as\n> > valid choices.\n> \n> Easily but slowly ;-).  Try this in the kernel repository\n> \n> \tgit log --author=Andre<TAB>\n> \n> and watch the paint dry.  You might want to have an extra shell\n> to run top before you hit the TAB key.\n\nWhen I put that in there I was thinking about how slowly that would\nrun on the kernel repository.  But I think its useful for git commit\n--author, even if it is a tad turtleish.  I'm considering creating\na cache of names under .git/ and only dynamically generate the log\nentries which are newer than the cache head.  That way we're only\nwading through the most recent commits to build up the completion\nset.\n\nApparently the bottleneck is bash.  If I add in | sort | uniq to\nthe end of the sed then I can generate author completions in about 7\nseconds for the kernel repository.  Without them it is taking about\n30 seconds.  (Both approximate as I just counted it out in my head.)\n\nYou can also see this in top.  We spend a bit of time in both git\nand sed, then suddenly bash takes over for a while as it makes the\nresulting list unique.\n\nUsing perl (instead of sed | sort | uniq) appears to improve things\nslightly, but I'm getting some odd results that I don't have time\nto debug right now.\n\n> It indeed is cute, but I think most people would wonder if the\n> terminal went dead, especially without any progress indicators.\n\nYes.  And in completion support mode you cannot give progress.  :-(\n\n-- \n"}]}