{"thread":{"id":"17264","subject":"[StGit PATCH 1/2] Modify bash completion to support help, version, and copyright.","startedAt":"2009-01-20T00:46:12Z","lastAt":"2009-01-23T01:35:04Z","messageCount":7,"participants":["ted@tedpavlic.com","Ted Pavlic","Karl Hasselström"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"101197","messageId":"1232412373-10836-1-git-send-email-ted@tedpavlic.com","threadId":"17264","inReplyTo":null,"subject":"[StGit PATCH 1/2] Modify bash completion to support help, version, and copyright.","fromName":"","fromEmail":"ted@tedpavlic.com","sentAt":"2009-01-20T00:46:12Z","receivedAt":"2009-01-20T00:46:12Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"From: Ted Pavlic <ted@tedpavlic.com>\n\n\"stg <tab>\" lists all commands, including \"help\", \"version\", and\n\"copyright\".\n\n\"stg he<tab>\" completes \"stg help \"\n\"stg ver<tab>\" completes \"stg version \"\n\"stg copy<tab>\" completes \"stg copyright \"\n\n\"stg help <tab>\" lists all commands /other than/ help, version, and\ncopyright.\n\n\"stg version <tab>\" goes directly to shell completion.\n\"stg copyright <tab>\" goes directly to shell completion.\n\nSigned-off-by: Ted Pavlic <ted@tedpavlic.com>\n---\n stgit/completion.py |    8 +++++++-\n 1 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/completion.py b/stgit/completion.py\nindex affc8c6..b3fd282 100644\n--- a/stgit/completion.py\n+++ b/stgit/completion.py\n@@ -111,13 +111,19 @@ def main_switch(commands):\n         ('# Complete name of subcommand if the user has not finished'\n          ' typing it yet.'),\n         'if test $c -eq $COMP_CWORD -a -z \"$command\"; then', [\n-            ('COMPREPLY=($(compgen -W \"$_stg_commands\" --'\n+            ('COMPREPLY=($(compgen -W \"help version copyright $_stg_commands\" --'\n              ' \"${COMP_WORDS[COMP_CWORD]}\"))'),\n             'return'],\n         'fi',\n         '',\n         '# Complete arguments to subcommands.',\n         'case \"$command\" in', [\n+            'help) ', [\n+            ('COMPREPLY=($(compgen -W \"$_stg_commands\" --'\n+             ' \"${COMP_WORDS[COMP_CWORD]}\"))'),\n+            'return ;;'],\n+            'version) return ;;',\n+            'copyright) return ;;'], [\n             '%s) _stg_%s ;;' % (cmd, cmd)\n             for cmd in sorted(commands.iterkeys())],\n         'esac')\n-- \n1.6.1.87.g15624\n"},{"id":"101198","messageId":"1232412373-10836-2-git-send-email-ted@tedpavlic.com","threadId":"17264","inReplyTo":"1232412373-10836-1-git-send-email-ted@tedpavlic.com","subject":"[StGit PATCH 2/2] Make bash completion fail to bashdefault before default completion.","fromName":"","fromEmail":"ted@tedpavlic.com","sentAt":"2009-01-20T00:46:13Z","receivedAt":"2009-01-20T00:46:13Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"From: Ted Pavlic <ted@tedpavlic.com>\n\nIf \"-o bashdefault\" isn't possible, use old \"-o default\" only.\n\n(this patch inspired by similar mechanism in Mercurial bash completion\nscript)\n\nSigned-off-by: Ted Pavlic <ted@tedpavlic.com>\n---\n stgit/completion.py |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/completion.py b/stgit/completion.py\nindex b3fd282..56e81c2 100644\n--- a/stgit/completion.py\n+++ b/stgit/completion.py\n@@ -129,7 +129,8 @@ def main_switch(commands):\n         'esac')\n \n def install():\n-    return ['complete -o default -F _stg stg']\n+    return ['complete -o bashdefault -o default -F _stg stg 2>/dev/null \\\\', [\n+            'complete -o default -F _stg stg' ] ]\n \n def write_completion(f):\n     commands = stgit.commands.get_commands(allow_cached = False)\n-- \n1.6.1.87.g15624\n"},{"id":"101538","messageId":"4978A0F1.9080703@tedpavlic.com","threadId":"17264","inReplyTo":"1232412373-10836-2-git-send-email-ted@tedpavlic.com","subject":"Re: [StGit PATCH 2/2] Make bash completion fail to bashdefault before default completion.","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-01-22T16:38:09Z","receivedAt":"2009-01-22T16:38:09Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":">   def install():\n> -    return ['complete -o default -F _stg stg']\n> +    return ['complete -o bashdefault -o default -F _stg stg 2>/dev/null \\\\', [\n> +            'complete -o default -F _stg stg' ] ]\n\nOops -- that second \"complete\" should have two pipes in front of it...\n\n\n-- \nTed Pavlic <ted@tedpavlic.com>\n\n   Please visit my ALS association page:\n         http://web.alsa.org/goto/tedpavlic\n   My family appreciates your support in the fight to defeat ALS.\n"},{"id":"101542","messageId":"1232642662-12851-1-git-send-email-ted@tedpavlic.com","threadId":"17264","inReplyTo":"4978A0F1.9080703@tedpavlic.com","subject":"[StGit PATCH 2/2] Make bash completion fail to bashdefault before default completion.","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-01-22T16:44:22Z","receivedAt":"2009-01-22T16:44:22Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"If \"-o bashdefault\" isn't possible, use old \"-o default\" only.\n\n(this patch inspired by similar mechanism in Mercurial bash completion\nscript)\n\nSigned-off-by: Ted Pavlic <ted@tedpavlic.com>\n---\n\nThis patch corrects a bug in the previous one of the same name. In\nparticular, the second \"complete\" lacked the \"||\" in front of it needed\nfor proper operation. The first complete command should fail over to the\nsecond if \"bashdefault\" isn't available.\n\n stgit/completion.py |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/completion.py b/stgit/completion.py\nindex b3fd282..38f0670 100644\n--- a/stgit/completion.py\n+++ b/stgit/completion.py\n@@ -129,7 +129,8 @@ def main_switch(commands):\n         'esac')\n \n def install():\n-    return ['complete -o default -F _stg stg']\n+    return ['complete -o bashdefault -o default -F _stg stg 2>/dev/null \\\\', [\n+            '|| complete -o default -F _stg stg' ] ]\n \n def write_completion(f):\n     commands = stgit.commands.get_commands(allow_cached = False)\n-- \n1.6.1.213.g28da8\n"},{"id":"101578","messageId":"20090122232928.GA23456@diana.vm.bytemark.co.uk","threadId":"17264","inReplyTo":"1232412373-10836-2-git-send-email-ted@tedpavlic.com","subject":"kha/{stable,safe,experimental} updated","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2009-01-22T23:29:28Z","receivedAt":"2009-01-22T23:29:28Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Ted, Both of your patches look good, and work when I try them.\n(Excellent commit messages, by the way.) I've applied them and pushed\nthem out.\n\nCatalin, I have stuff for you in both kha/stable and kha/safe.\n\n\n                                 -+-\n\n\nThe following changes since commit 7cb253c05b509510177a1df4d5813861641968f6:\n  Karl Hasselström (1):\n        Fix typo\n\nare available in the git repository at:\n\n  git://repo.or.cz/stgit/kha.git stable\n\nKarl Hasselström (1):\n      Return None instead of crashing on undefined integer config items\n\nPete Wyckoff (1):\n      stgit.namelength is an integer\n\n stgit/config.py |    4 +++-\n stgit/utils.py  |    2 +-\n 2 files changed, 4 insertions(+), 2 deletions(-)\n\n\n                                 -+-\n\n\nThe following changes since commit d3b31eeac6c6fba9352188755164f556faf56e59:\n  Catalin Marinas (1):\n        Fix the patch argument parsing for the \"show\" command\n\nare available in the git repository at:\n\n  git://repo.or.cz/stgit/kha.git safe\n\nGustav Hållberg (7):\n      stgit.el: Consistently use symbols rather than strings for patch names\n      stgit.el: Make single file diff buffer read-only\n      stgit.el: Include stat summary in patch diff\n      stgit.el: Add message when there are no patches in the series\n      stgit.el: Indicate empty patches\n      stgit.el: Minor beautification\n      stgit.el: Add optional count argument to stgit-commit\n\nKarl Hasselström (2):\n      Return None instead of crashing on undefined integer config items\n      Merge branch 'stable'\n\nPete Wyckoff (1):\n      stgit.namelength is an integer\n\nTed Pavlic (2):\n      Modify bash completion to support help, version, and copyright.\n      Make bash completion fail to bashdefault before default completion.\n\n contrib/stgit.el    |  245 ++++++++++++++++++++++++++++-----------------------\n stgit/completion.py |   11 ++-\n stgit/config.py     |    4 +-\n stgit/utils.py      |    2 +-\n 4 files changed, 146 insertions(+), 116 deletions(-)\n\n\n                                 -+-\n\n\nThe following changes since commit e80d43bd9c8baf2bc9913c6c153914403f210872:\n  Ted Pavlic (1):\n        Make bash completion fail to bashdefault before default completion.\n\nare available in the git repository at:\n\n  git://repo.or.cz/stgit/kha.git experimental\n\nGustav Hållberg (1):\n      stgit.el: (EXPERIMENTAL) Show files modified in work tree\n\nKarl Hasselström (2):\n      Read several objects at once with git cat-file --batch\n      Diff several trees at once with git diff-tree --stdin\n\n INSTALL          |    5 +-\n contrib/stgit.el |  272 ++++++++++++++++++++++++++++++++++--------------------\n stgit/lib/git.py |   79 +++++++++++++++-\n stgit/run.py     |   19 ++++\n 4 files changed, 266 insertions(+), 109 deletions(-)\n\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"101584","messageId":"1232670372-20000-1-git-send-email-ted@tedpavlic.com","threadId":"17264","inReplyTo":"20090122232928.GA23456@diana.vm.bytemark.co.uk","subject":"[kha/safe PATCH] completion bugfix: Place double pipes in front of alternate command.","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-01-23T00:26:12Z","receivedAt":"2009-01-23T00:26:12Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"Signed-off-by: Ted Pavlic <ted@tedpavlic.com>\n---\n\nThis is a patch against \n\n    git://repo.or.cz/stgit/kha.git stable\n\nUnfortunately, the previous \"[StGit PATCH 2/2]\" had a small bug in it. A\nbugfix was posted, but it didn't get picked up in kha/safe. This commit\nshould be applied against kha/safe to fix the problem.\n\nAlternatively, the patch provided in\n\n    <1232642662-12851-1-git-send-email-ted@tedpavlic.com>\n\nis the proper patch to stgit/master.\n\nSorry for the extra bother.\n\n stgit/completion.py |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/completion.py b/stgit/completion.py\nindex 56e81c2..38f0670 100644\n--- a/stgit/completion.py\n+++ b/stgit/completion.py\n@@ -130,7 +130,7 @@ def main_switch(commands):\n \n def install():\n     return ['complete -o bashdefault -o default -F _stg stg 2>/dev/null \\\\', [\n-            'complete -o default -F _stg stg' ] ]\n+            '|| complete -o default -F _stg stg' ] ]\n \n def write_completion(f):\n     commands = stgit.commands.get_commands(allow_cached = False)\n-- \n1.6.1.213.g28da8\n"},{"id":"101596","messageId":"20090123013504.GA24829@diana.vm.bytemark.co.uk","threadId":"17264","inReplyTo":"1232670372-20000-1-git-send-email-ted@tedpavlic.com","subject":"Re: [kha/safe PATCH] completion bugfix: Place double pipes in front of alternate command.","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2009-01-23T01:35:04Z","receivedAt":"2009-01-23T01:35:04Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2009-01-22 19:26:12 -0500, Ted Pavlic wrote:\n\n> -            'complete -o default -F _stg stg' ] ]\n> +            '|| complete -o default -F _stg stg' ] ]\n\nThanks, I've edited the patch and pushed it out again.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}