{"thread":{"id":"17727","subject":"[PATCH 1/4] completion: For consistency, changed \"git rev-parse\" to __gitdir calls.","startedAt":"2009-02-11T18:03:22Z","lastAt":"2009-02-20T17:18:35Z","messageCount":21,"participants":["Ted Pavlic","Shawn O. Pearce","Junio C Hamano","Jeff King","Thomas Rast"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"104230","messageId":"1234375406-27099-1-git-send-email-ted@tedpavlic.com","threadId":"17727","inReplyTo":null,"subject":"[PATCH 0/4] completion: Fixes and better non-work-tree support","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-11T18:03:22Z","receivedAt":"2009-02-11T18:03:22Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"The first patch has already been Acked by spearce.\n\nThe second patch uses a consistent \"if...\" convention throughout the\ncompletion script.\n\nThe third patch improves how the __git_ps1 works when (a) the CWD is a\ngit dir and (b) when the CWD has a .git but no .git/HEAD.\n\nThe fourth patch fixes unbound variable errors by replacing $__vars with\n${__var-}s.\n\nTed Pavlic (4):\n  completion: For consistency, changed \"git rev-parse\" to __gitdir\n    calls.\n  completion: Use consistent if [...] convention. No test.\n  completion: Better __git_ps1 support when not in working directory\n  completion: More fixes to prevent unbound variable errors.\n\n contrib/completion/git-completion.bash |   75 ++++++++++++++++----------------\n 1 files changed, 37 insertions(+), 38 deletions(-)\n"},{"id":"104228","messageId":"1234375406-27099-2-git-send-email-ted@tedpavlic.com","threadId":"17727","inReplyTo":"1234375406-27099-1-git-send-email-ted@tedpavlic.com","subject":"[PATCH 1/4] completion: For consistency, changed \"git rev-parse\" to __gitdir calls.","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-11T18:03:23Z","receivedAt":"2009-02-11T18:03:23Z","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>\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex f44f63c..6bbe09a 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -80,7 +80,7 @@ __gitdir ()\n # returns text to add to bash PS1 prompt (includes branch name)\n __git_ps1 ()\n {\n-\tlocal g=\"$(git rev-parse --git-dir 2>/dev/null)\"\n+\tlocal g=\"$(__gitdir)\"\n \tif [ -n \"$g\" ]; then\n \t\tlocal r\n \t\tlocal b\n@@ -1797,7 +1797,7 @@ _gitk ()\n \t__git_has_doubledash && return\n \n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tlocal g=\"$(git rev-parse --git-dir 2>/dev/null)\"\n+\tlocal g=\"$(__gitdir)\"\n \tlocal merge=\"\"\n \tif [ -f $g/MERGE_HEAD ]; then\n \t\tmerge=\"--merge\"\n-- \n1.6.1.2.390.gba743\n"},{"id":"104229","messageId":"1234375406-27099-3-git-send-email-ted@tedpavlic.com","threadId":"17727","inReplyTo":"1234375406-27099-2-git-send-email-ted@tedpavlic.com","subject":"[PATCH 2/4] completion: Use consistent if [...] convention. No test.","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-11T18:03:24Z","receivedAt":"2009-02-11T18:03:24Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"The local coding convention in bash completion is to use [...] rather\nthan test. Additionally,\n\n    if [...]; then\n\nis preferred over\n\n    if [...]\n    then\n\nand so matching \"if [...]\\nthen\" were changed accordingly.\n\nSigned-off-by: Ted Pavlic <ted@tedpavlic.com>\n---\n contrib/completion/git-completion.bash |   31 +++++++++++--------------------\n 1 files changed, 11 insertions(+), 20 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 6bbe09a..7706170 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -84,39 +84,30 @@ __git_ps1 ()\n \tif [ -n \"$g\" ]; then\n \t\tlocal r\n \t\tlocal b\n-\t\tif [ -d \"$g/rebase-apply\" ]\n-\t\tthen\n-\t\t\tif test -f \"$g/rebase-apply/rebasing\"\n-\t\t\tthen\n+\t\tif [ -d \"$g/rebase-apply\" ]; then\n+\t\t\tif [ -f \"$g/rebase-apply/rebasing\" ]; then\n \t\t\t\tr=\"|REBASE\"\n-\t\t\telif test -f \"$g/rebase-apply/applying\"\n-\t\t\tthen\n+            elif [ -f \"$g/rebase-apply/applying\" ]; then\n \t\t\t\tr=\"|AM\"\n \t\t\telse\n \t\t\t\tr=\"|AM/REBASE\"\n \t\t\tfi\n \t\t\tb=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n-\t\telif [ -f \"$g/rebase-merge/interactive\" ]\n-\t\tthen\n+\t\telif [ -f \"$g/rebase-merge/interactive\" ]; then\n \t\t\tr=\"|REBASE-i\"\n \t\t\tb=\"$(cat \"$g/rebase-merge/head-name\")\"\n-\t\telif [ -d \"$g/rebase-merge\" ]\n-\t\tthen\n+\t\telif [ -d \"$g/rebase-merge\" ]; then\n \t\t\tr=\"|REBASE-m\"\n \t\t\tb=\"$(cat \"$g/rebase-merge/head-name\")\"\n-\t\telif [ -f \"$g/MERGE_HEAD\" ]\n-\t\tthen\n+\t\telif [ -f \"$g/MERGE_HEAD\" ]; then\n \t\t\tr=\"|MERGING\"\n \t\t\tb=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n \t\telse\n-\t\t\tif [ -f \"$g/BISECT_LOG\" ]\n-\t\t\tthen\n+\t\t\tif [ -f \"$g/BISECT_LOG\" ]; then\n \t\t\t\tr=\"|BISECTING\"\n \t\t\tfi\n-\t\t\tif ! b=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n-\t\t\tthen\n-\t\t\t\tif ! b=\"$(git describe --exact-match HEAD 2>/dev/null)\"\n-\t\t\t\tthen\n+\t\t\tif ! b=\"$(git symbolic-ref HEAD 2>/dev/null)\"; then\n+\t\t\t\tif ! b=\"$(git describe --exact-match HEAD 2>/dev/null)\"; then\n \t\t\t\t\tb=\"$(cut -c1-7 \"$g/HEAD\")...\"\n \t\t\t\tfi\n \t\t\tfi\n@@ -125,8 +116,8 @@ __git_ps1 ()\n \t\tlocal w\n \t\tlocal i\n \n-\t\tif test -n \"${GIT_PS1_SHOWDIRTYSTATE-}\"; then\n-\t\t\tif test \"$(git config --bool bash.showDirtyState)\" != \"false\"; then\n+\t\tif [ -n \"${GIT_PS1_SHOWDIRTYSTATE-}\" ]; then\n+\t\t\tif [ \"$(git config --bool bash.showDirtyState)\" != \"false\" ]; then\n \t\t\t\tgit diff --no-ext-diff --ignore-submodules \\\n \t\t\t\t\t--quiet --exit-code || w=\"*\"\n \t\t\t\tif git rev-parse --quiet --verify HEAD >/dev/null; then\n-- \n1.6.1.2.390.gba743\n"},{"id":"104232","messageId":"1234375406-27099-4-git-send-email-ted@tedpavlic.com","threadId":"17727","inReplyTo":"1234375406-27099-3-git-send-email-ted@tedpavlic.com","subject":"[PATCH 3/4] completion: Better __git_ps1 support when not in working directory","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-11T18:03:25Z","receivedAt":"2009-02-11T18:03:25Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"If .git/HEAD is not readable, __git_ps1 does nothing.\n\nIf --is-in-git-dir, __git_ps1 returns \" (GIT_DIR!)\" as a cautionary\nnote. The previous behavior would show the branch name (and would\noptionally attempt to determine the dirtyState of the directory, which\nwas impossible because a \"git diff\" was used).\n\nIf --is-in-work-tree, __git_ps1 returns the branch name. Additionally,\nif showDirtyState is on, the dirty state is displayed.\n\nSigned-off-by: Ted Pavlic <ted@tedpavlic.com>\n---\n contrib/completion/git-completion.bash |   36 +++++++++++++++++++------------\n 1 files changed, 22 insertions(+), 14 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 7706170..c28d6be 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -108,7 +108,9 @@ __git_ps1 ()\n \t\t\tfi\n \t\t\tif ! b=\"$(git symbolic-ref HEAD 2>/dev/null)\"; then\n \t\t\t\tif ! b=\"$(git describe --exact-match HEAD 2>/dev/null)\"; then\n-\t\t\t\t\tb=\"$(cut -c1-7 \"$g/HEAD\")...\"\n+\t\t\t\t\tif [ -r \"$g/HEAD\" ]; then\n+\t\t\t\t\t\tb=\"$(cut -c1-7 \"$g/HEAD\")...\"\n+\t\t\t\t\tfi\n \t\t\t\tfi\n \t\t\tfi\n \t\tfi\n@@ -116,23 +118,29 @@ __git_ps1 ()\n \t\tlocal w\n \t\tlocal i\n \n-\t\tif [ -n \"${GIT_PS1_SHOWDIRTYSTATE-}\" ]; then\n-\t\t\tif [ \"$(git config --bool bash.showDirtyState)\" != \"false\" ]; then\n-\t\t\t\tgit diff --no-ext-diff --ignore-submodules \\\n-\t\t\t\t\t--quiet --exit-code || w=\"*\"\n-\t\t\t\tif git rev-parse --quiet --verify HEAD >/dev/null; then\n-\t\t\t\t\tgit diff-index --cached --quiet \\\n-\t\t\t\t\t\t--ignore-submodules HEAD -- || i=\"+\"\n-\t\t\t\telse\n-\t\t\t\t\ti=\"#\"\n+\t\tif [ \"true\" = \"$(git rev-parse --is-inside-git-dir 2>/dev/null)\" ]; then\n+\t\t\tb=\"GIT_DIR!\"\n+\t\telif [ \"true\" = \"$(git rev-parse --is-inside-work-tree 2>/dev/null)\" ]; then\n+\t\t\tif [ -n \"${GIT_PS1_SHOWDIRTYSTATE-}\" ]; then\n+\t\t\t\tif [ \"$(git config --bool bash.showDirtyState)\" != \"false\" ]; then\n+\t\t\t\t\tgit diff --no-ext-diff --ignore-submodules \\\n+\t\t\t\t\t\t--quiet --exit-code || w=\"*\"\n+\t\t\t\t\tif git rev-parse --quiet --verify HEAD >/dev/null; then\n+\t\t\t\t\t\tgit diff-index --cached --quiet \\\n+\t\t\t\t\t\t\t--ignore-submodules HEAD -- || i=\"+\"\n+\t\t\t\t\telse\n+\t\t\t\t\t\ti=\"#\"\n+\t\t\t\t\tfi\n \t\t\t\tfi\n \t\t\tfi\n \t\tfi\n \n-\t\tif [ -n \"${1-}\" ]; then\n-\t\t\tprintf \"$1\" \"${b##refs/heads/}$w$i$r\"\n-\t\telse\n-\t\t\tprintf \" (%s)\" \"${b##refs/heads/}$w$i$r\"\n+\t\tif [ -n \"$b\" ]; then\n+\t\t\tif [ -n \"${1-}\" ]; then\n+\t\t\t\tprintf \"$1\" \"${b##refs/heads/}$w$i$r\"\n+\t\t\telse\n+\t\t\t\tprintf \" (%s)\" \"${b##refs/heads/}$w$i$r\"\n+\t\t\tfi\n \t\tfi\n \tfi\n }\n-- \n1.6.1.2.390.gba743\n"},{"id":"104231","messageId":"1234375406-27099-5-git-send-email-ted@tedpavlic.com","threadId":"17727","inReplyTo":"1234375406-27099-4-git-send-email-ted@tedpavlic.com","subject":"[PATCH 4/4] completion: More fixes to prevent unbound variable errors.","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-11T18:03:26Z","receivedAt":"2009-02-11T18:03:26Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"Several functions make use of \"[-n ...]\" and \"[-z ...]\". In many cases,\nthe variables being tested were declared with \"local.\" However, several\n__variables are not, and so they must be replaced with their ${__-}\nequivalents.\n\nSigned-off-by: Ted Pavlic <ted@tedpavlic.com>\n---\n contrib/completion/git-completion.bash |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex c28d6be..371148b 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -62,7 +62,7 @@ esac\n __gitdir ()\n {\n \tif [ -z \"${1-}\" ]; then\n-\t\tif [ -n \"$__git_dir\" ]; then\n+\t\tif [ -n \"${__git_dir-}\" ]; then\n \t\t\techo \"$__git_dir\"\n \t\telif [ -d .git ]; then\n \t\t\techo .git\n@@ -298,7 +298,7 @@ __git_remotes ()\n \n __git_merge_strategies ()\n {\n-\tif [ -n \"$__git_merge_strategylist\" ]; then\n+\tif [ -n \"${__git_merge_strategylist-}\" ]; then\n \t\techo \"$__git_merge_strategylist\"\n \t\treturn\n \tfi\n@@ -384,7 +384,7 @@ __git_complete_revlist ()\n \n __git_all_commands ()\n {\n-\tif [ -n \"$__git_all_commandlist\" ]; then\n+\tif [ -n \"${__git_all_commandlist-}\" ]; then\n \t\techo \"$__git_all_commandlist\"\n \t\treturn\n \tfi\n@@ -402,7 +402,7 @@ __git_all_commandlist=\"$(__git_all_commands 2>/dev/null)\"\n \n __git_porcelain_commands ()\n {\n-\tif [ -n \"$__git_porcelain_commandlist\" ]; then\n+\tif [ -n \"${__git_porcelain_commandlist-}\" ]; then\n \t\techo \"$__git_porcelain_commandlist\"\n \t\treturn\n \tfi\n-- \n1.6.1.2.390.gba743\n"},{"id":"104234","messageId":"20090211180705.GL30949@spearce.org","threadId":"17727","inReplyTo":"1234375406-27099-3-git-send-email-ted@tedpavlic.com","subject":"Re: [PATCH 2/4] completion: Use consistent if [...] convention. No test.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-02-11T18:07:05Z","receivedAt":"2009-02-11T18:07:05Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Ted Pavlic <ted@tedpavlic.com> wrote:\n> The local coding convention in bash completion is to use [...] rather\n> than test. Additionally,\n> \n>     if [...]; then\n> \n> is preferred over\n> \n>     if [...]\n>     then\n> \n> and so matching \"if [...]\\nthen\" were changed accordingly.\n> \n> Signed-off-by: Ted Pavlic <ted@tedpavlic.com>\n> ---\n>  contrib/completion/git-completion.bash |   31 +++++++++++--------------------\n>  1 files changed, 11 insertions(+), 20 deletions(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 6bbe09a..7706170 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -84,39 +84,30 @@ __git_ps1 ()\n>  \tif [ -n \"$g\" ]; then\n>  \t\tlocal r\n>  \t\tlocal b\n> -\t\tif [ -d \"$g/rebase-apply\" ]\n> -\t\tthen\n> -\t\t\tif test -f \"$g/rebase-apply/rebasing\"\n> -\t\t\tthen\n> +\t\tif [ -d \"$g/rebase-apply\" ]; then\n> +\t\t\tif [ -f \"$g/rebase-apply/rebasing\" ]; then\n>  \t\t\t\tr=\"|REBASE\"\n> -\t\t\telif test -f \"$g/rebase-apply/applying\"\n> -\t\t\tthen\n> +            elif [ -f \"$g/rebase-apply/applying\" ]; then\n\nThere is some sort of whitespace damage right here, the elif doesn't\nseem to line up correctly.\n\n-- \nShawn.\n"},{"id":"104235","messageId":"20090211180902.GM30949@spearce.org","threadId":"17727","inReplyTo":"1234375406-27099-4-git-send-email-ted@tedpavlic.com","subject":"Re: [PATCH 3/4] completion: Better __git_ps1 support when not in working directory","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-02-11T18:09:02Z","receivedAt":"2009-02-11T18:09:02Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Ted Pavlic <ted@tedpavlic.com> wrote:\n> If .git/HEAD is not readable, __git_ps1 does nothing.\n> \n> If --is-in-git-dir, __git_ps1 returns \" (GIT_DIR!)\" as a cautionary\n> note. The previous behavior would show the branch name (and would\n> optionally attempt to determine the dirtyState of the directory, which\n> was impossible because a \"git diff\" was used).\n> \n> If --is-in-work-tree, __git_ps1 returns the branch name. Additionally,\n> if showDirtyState is on, the dirty state is displayed.\n> \n> Signed-off-by: Ted Pavlic <ted@tedpavlic.com>\n\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n\n> ---\n>  contrib/completion/git-completion.bash |   36 +++++++++++++++++++------------\n>  1 files changed, 22 insertions(+), 14 deletions(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 7706170..c28d6be 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -108,7 +108,9 @@ __git_ps1 ()\n>  \t\t\tfi\n>  \t\t\tif ! b=\"$(git symbolic-ref HEAD 2>/dev/null)\"; then\n>  \t\t\t\tif ! b=\"$(git describe --exact-match HEAD 2>/dev/null)\"; then\n> -\t\t\t\t\tb=\"$(cut -c1-7 \"$g/HEAD\")...\"\n> +\t\t\t\t\tif [ -r \"$g/HEAD\" ]; then\n> +\t\t\t\t\t\tb=\"$(cut -c1-7 \"$g/HEAD\")...\"\n> +\t\t\t\t\tfi\n>  \t\t\t\tfi\n>  \t\t\tfi\n>  \t\tfi\n> @@ -116,23 +118,29 @@ __git_ps1 ()\n>  \t\tlocal w\n>  \t\tlocal i\n>  \n> -\t\tif [ -n \"${GIT_PS1_SHOWDIRTYSTATE-}\" ]; then\n> -\t\t\tif [ \"$(git config --bool bash.showDirtyState)\" != \"false\" ]; then\n> -\t\t\t\tgit diff --no-ext-diff --ignore-submodules \\\n> -\t\t\t\t\t--quiet --exit-code || w=\"*\"\n> -\t\t\t\tif git rev-parse --quiet --verify HEAD >/dev/null; then\n> -\t\t\t\t\tgit diff-index --cached --quiet \\\n> -\t\t\t\t\t\t--ignore-submodules HEAD -- || i=\"+\"\n> -\t\t\t\telse\n> -\t\t\t\t\ti=\"#\"\n> +\t\tif [ \"true\" = \"$(git rev-parse --is-inside-git-dir 2>/dev/null)\" ]; then\n> +\t\t\tb=\"GIT_DIR!\"\n> +\t\telif [ \"true\" = \"$(git rev-parse --is-inside-work-tree 2>/dev/null)\" ]; then\n> +\t\t\tif [ -n \"${GIT_PS1_SHOWDIRTYSTATE-}\" ]; then\n> +\t\t\t\tif [ \"$(git config --bool bash.showDirtyState)\" != \"false\" ]; then\n> +\t\t\t\t\tgit diff --no-ext-diff --ignore-submodules \\\n> +\t\t\t\t\t\t--quiet --exit-code || w=\"*\"\n> +\t\t\t\t\tif git rev-parse --quiet --verify HEAD >/dev/null; then\n> +\t\t\t\t\t\tgit diff-index --cached --quiet \\\n> +\t\t\t\t\t\t\t--ignore-submodules HEAD -- || i=\"+\"\n> +\t\t\t\t\telse\n> +\t\t\t\t\t\ti=\"#\"\n> +\t\t\t\t\tfi\n>  \t\t\t\tfi\n>  \t\t\tfi\n>  \t\tfi\n>  \n> -\t\tif [ -n \"${1-}\" ]; then\n> -\t\t\tprintf \"$1\" \"${b##refs/heads/}$w$i$r\"\n> -\t\telse\n> -\t\t\tprintf \" (%s)\" \"${b##refs/heads/}$w$i$r\"\n> +\t\tif [ -n \"$b\" ]; then\n> +\t\t\tif [ -n \"${1-}\" ]; then\n> +\t\t\t\tprintf \"$1\" \"${b##refs/heads/}$w$i$r\"\n> +\t\t\telse\n> +\t\t\t\tprintf \" (%s)\" \"${b##refs/heads/}$w$i$r\"\n> +\t\t\tfi\n>  \t\tfi\n>  \tfi\n>  }\n> -- \n> 1.6.1.2.390.gba743\n> \n\n-- \nShawn.\n"},{"id":"104237","messageId":"20090211180934.GN30949@spearce.org","threadId":"17727","inReplyTo":"1234375406-27099-5-git-send-email-ted@tedpavlic.com","subject":"Re: [PATCH 4/4] completion: More fixes to prevent unbound variable errors.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-02-11T18:09:34Z","receivedAt":"2009-02-11T18:09:34Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Ted Pavlic <ted@tedpavlic.com> wrote:\n> Several functions make use of \"[-n ...]\" and \"[-z ...]\". In many cases,\n> the variables being tested were declared with \"local.\" However, several\n> __variables are not, and so they must be replaced with their ${__-}\n> equivalents.\n> \n> Signed-off-by: Ted Pavlic <ted@tedpavlic.com>\n\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n\n> ---\n>  contrib/completion/git-completion.bash |    8 ++++----\n>  1 files changed, 4 insertions(+), 4 deletions(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index c28d6be..371148b 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -62,7 +62,7 @@ esac\n>  __gitdir ()\n>  {\n>  \tif [ -z \"${1-}\" ]; then\n> -\t\tif [ -n \"$__git_dir\" ]; then\n> +\t\tif [ -n \"${__git_dir-}\" ]; then\n>  \t\t\techo \"$__git_dir\"\n>  \t\telif [ -d .git ]; then\n>  \t\t\techo .git\n> @@ -298,7 +298,7 @@ __git_remotes ()\n>  \n>  __git_merge_strategies ()\n>  {\n> -\tif [ -n \"$__git_merge_strategylist\" ]; then\n> +\tif [ -n \"${__git_merge_strategylist-}\" ]; then\n>  \t\techo \"$__git_merge_strategylist\"\n>  \t\treturn\n>  \tfi\n> @@ -384,7 +384,7 @@ __git_complete_revlist ()\n>  \n>  __git_all_commands ()\n>  {\n> -\tif [ -n \"$__git_all_commandlist\" ]; then\n> +\tif [ -n \"${__git_all_commandlist-}\" ]; then\n>  \t\techo \"$__git_all_commandlist\"\n>  \t\treturn\n>  \tfi\n> @@ -402,7 +402,7 @@ __git_all_commandlist=\"$(__git_all_commands 2>/dev/null)\"\n>  \n>  __git_porcelain_commands ()\n>  {\n> -\tif [ -n \"$__git_porcelain_commandlist\" ]; then\n> +\tif [ -n \"${__git_porcelain_commandlist-}\" ]; then\n>  \t\techo \"$__git_porcelain_commandlist\"\n>  \t\treturn\n>  \tfi\n> -- \n> 1.6.1.2.390.gba743\n> \n\n-- \nShawn.\n"},{"id":"104239","messageId":"7v63jgg7st.fsf@gitster.siamese.dyndns.org","threadId":"17727","inReplyTo":"1234375406-27099-3-git-send-email-ted@tedpavlic.com","subject":"Re: [PATCH 2/4] completion: Use consistent if [...] convention. No test.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-11T18:14:26Z","receivedAt":"2009-02-11T18:14:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ted Pavlic <ted@tedpavlic.com> writes:\n\n> -\t\tif [ -d \"$g/rebase-apply\" ]\n> -\t\tthen\n> -\t\t\tif test -f \"$g/rebase-apply/rebasing\"\n> -\t\t\tthen\n> +\t\tif [ -d \"$g/rebase-apply\" ]; then\n> +\t\t\tif [ -f \"$g/rebase-apply/rebasing\" ]; then\n>  \t\t\t\tr=\"|REBASE\"\n> -\t\t\telif test -f \"$g/rebase-apply/applying\"\n> -\t\t\tthen\n> +            elif [ -f \"$g/rebase-apply/applying\" ]; then\n>  \t\t\t\tr=\"|AM\"\n>  \t\t\telse\n\nWhat's with this funny indentation?\n\nAs a general rule, it usually is a good idea to apply clean-up to the\ncodebase before starting substantial work, but that holds true only when\nthe clean-up is undisputed.  Otherwise you would end up holding the later,\nmore \"interesting\" work a hostage to an earlier potentially controversial\n\"clean-up\".\n\nI think this particular clean-up makes the odd-ball __git_ps1 more\nconsnstent with the rest of the script, but it ultimately is Shawn's\ncall.\n"},{"id":"104242","messageId":"7v1vu4g78q.fsf@gitster.siamese.dyndns.org","threadId":"17727","inReplyTo":"20090211180705.GL30949@spearce.org","subject":"Re: [PATCH 2/4] completion: Use consistent if [...] convention. No test.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-11T18:26:29Z","receivedAt":"2009-02-11T18:26:29Z","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>> -\t\t\telif test -f \"$g/rebase-apply/applying\"\n>> -\t\t\tthen\n>> +            elif [ -f \"$g/rebase-apply/applying\" ]; then\n>\n> There is some sort of whitespace damage right here, the elif doesn't\n> seem to line up correctly.\n\nIf that is the only gripe and otherwise if you are Ok with the patch, I'll\nqueue the entire series with a fix-up here myself.\n"},{"id":"104246","messageId":"20090211183557.GP30949@spearce.org","threadId":"17727","inReplyTo":"7v1vu4g78q.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/4] completion: Use consistent if [...] convention. No test.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-02-11T18:35:57Z","receivedAt":"2009-02-11T18:35:57Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> \"Shawn O. Pearce\" <spearce@spearce.org> writes:\n> \n> >> -\t\t\telif test -f \"$g/rebase-apply/applying\"\n> >> -\t\t\tthen\n> >> +            elif [ -f \"$g/rebase-apply/applying\" ]; then\n> >\n> > There is some sort of whitespace damage right here, the elif doesn't\n> > seem to line up correctly.\n> \n> If that is the only gripe and otherwise if you are Ok with the patch, I'll\n> queue the entire series with a fix-up here myself.\n\nYes, this patch is fine, if you can hand-fix the whitespace damage,\nplease feel free to add my Ack.\n\n-- \nShawn.\n"},{"id":"104265","messageId":"49931C3F.4000903@tedpavlic.com","threadId":"17727","inReplyTo":"7v63jgg7st.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/4] completion: Use consistent if [...] convention. No test.","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-11T18:43:11Z","receivedAt":"2009-02-11T18:43:11Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"> What's with this funny indentation?\n\nIn Vim, I have \"exapndtabs\" set by default. I manually turned it off, \nbut during testing, I must have closed Vim and re-opened and forgot to \nturn it back off.\n\nSome time ago, I suggested adding a vim modeline to the file to handle \nturning expandtabs off for everyone who edits it with vim. That change \ngot denied.\n\nIf you'd like, I can clean up the whitespace and resubmit with Shawn's Acks.\n\n--Ted\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":"104268","messageId":"1234378479-29304-1-git-send-email-ted@tedpavlic.com","threadId":"17727","inReplyTo":"7v63jgg7st.fsf@gitster.siamese.dyndns.org","subject":"[PATCH 0/4] completion fixes: Acks, whitespace, and r=\"\"","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-11T18:54:35Z","receivedAt":"2009-02-11T18:54:35Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"* Added Shawn O. Pearce acks\n* Fixed whitespace problem in second patch (vim:expandtabs was on)\n* When in GIT_DIR, set r=\"\" in __git_ps1 as well\n\nTed Pavlic (4):\n  completion: For consistency, changed \"git rev-parse\" to __gitdir\n    calls.\n  completion: Use consistent if [...] convention. No test.\n  completion: Better __git_ps1 support when not in working directory\n  completion: More fixes to prevent unbound variable errors.\n\n contrib/completion/git-completion.bash |   76 ++++++++++++++++----------------\n 1 files changed, 38 insertions(+), 38 deletions(-)\n"},{"id":"104269","messageId":"1234378479-29304-2-git-send-email-ted@tedpavlic.com","threadId":"17727","inReplyTo":"1234378479-29304-1-git-send-email-ted@tedpavlic.com","subject":"[PATCH 1/4] completion: For consistency, changed \"git rev-parse\" to __gitdir calls.","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-11T18:54:36Z","receivedAt":"2009-02-11T18:54:36Z","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>\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex f44f63c..6bbe09a 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -80,7 +80,7 @@ __gitdir ()\n # returns text to add to bash PS1 prompt (includes branch name)\n __git_ps1 ()\n {\n-\tlocal g=\"$(git rev-parse --git-dir 2>/dev/null)\"\n+\tlocal g=\"$(__gitdir)\"\n \tif [ -n \"$g\" ]; then\n \t\tlocal r\n \t\tlocal b\n@@ -1797,7 +1797,7 @@ _gitk ()\n \t__git_has_doubledash && return\n \n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tlocal g=\"$(git rev-parse --git-dir 2>/dev/null)\"\n+\tlocal g=\"$(__gitdir)\"\n \tlocal merge=\"\"\n \tif [ -f $g/MERGE_HEAD ]; then\n \t\tmerge=\"--merge\"\n-- \n1.6.1.2.390.gba743\n"},{"id":"104267","messageId":"1234378479-29304-3-git-send-email-ted@tedpavlic.com","threadId":"17727","inReplyTo":"1234378479-29304-2-git-send-email-ted@tedpavlic.com","subject":"[PATCH 2/4] completion: Use consistent if [...] convention. No test.","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-11T18:54:37Z","receivedAt":"2009-02-11T18:54:37Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"The local coding convention in bash completion is to use [...] rather\nthan test. Additionally,\n\n    if [...]; then\n\nis preferred over\n\n    if [...]\n    then\n\nand so matching \"if [...]\\nthen\" were changed accordingly.\n\nSigned-off-by: Ted Pavlic <ted@tedpavlic.com>\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |   31 +++++++++++--------------------\n 1 files changed, 11 insertions(+), 20 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 6bbe09a..e729944 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -84,39 +84,30 @@ __git_ps1 ()\n \tif [ -n \"$g\" ]; then\n \t\tlocal r\n \t\tlocal b\n-\t\tif [ -d \"$g/rebase-apply\" ]\n-\t\tthen\n-\t\t\tif test -f \"$g/rebase-apply/rebasing\"\n-\t\t\tthen\n+\t\tif [ -d \"$g/rebase-apply\" ]; then\n+\t\t\tif [ -f \"$g/rebase-apply/rebasing\" ]; then\n \t\t\t\tr=\"|REBASE\"\n-\t\t\telif test -f \"$g/rebase-apply/applying\"\n-\t\t\tthen\n+\t\t\telif [ -f \"$g/rebase-apply/applying\" ]; then\n \t\t\t\tr=\"|AM\"\n \t\t\telse\n \t\t\t\tr=\"|AM/REBASE\"\n \t\t\tfi\n \t\t\tb=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n-\t\telif [ -f \"$g/rebase-merge/interactive\" ]\n-\t\tthen\n+\t\telif [ -f \"$g/rebase-merge/interactive\" ]; then\n \t\t\tr=\"|REBASE-i\"\n \t\t\tb=\"$(cat \"$g/rebase-merge/head-name\")\"\n-\t\telif [ -d \"$g/rebase-merge\" ]\n-\t\tthen\n+\t\telif [ -d \"$g/rebase-merge\" ]; then\n \t\t\tr=\"|REBASE-m\"\n \t\t\tb=\"$(cat \"$g/rebase-merge/head-name\")\"\n-\t\telif [ -f \"$g/MERGE_HEAD\" ]\n-\t\tthen\n+\t\telif [ -f \"$g/MERGE_HEAD\" ]; then\n \t\t\tr=\"|MERGING\"\n \t\t\tb=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n \t\telse\n-\t\t\tif [ -f \"$g/BISECT_LOG\" ]\n-\t\t\tthen\n+\t\t\tif [ -f \"$g/BISECT_LOG\" ]; then\n \t\t\t\tr=\"|BISECTING\"\n \t\t\tfi\n-\t\t\tif ! b=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n-\t\t\tthen\n-\t\t\t\tif ! b=\"$(git describe --exact-match HEAD 2>/dev/null)\"\n-\t\t\t\tthen\n+\t\t\tif ! b=\"$(git symbolic-ref HEAD 2>/dev/null)\"; then\n+\t\t\t\tif ! b=\"$(git describe --exact-match HEAD 2>/dev/null)\"; then\n \t\t\t\t\tb=\"$(cut -c1-7 \"$g/HEAD\")...\"\n \t\t\t\tfi\n \t\t\tfi\n@@ -125,8 +116,8 @@ __git_ps1 ()\n \t\tlocal w\n \t\tlocal i\n \n-\t\tif test -n \"${GIT_PS1_SHOWDIRTYSTATE-}\"; then\n-\t\t\tif test \"$(git config --bool bash.showDirtyState)\" != \"false\"; then\n+\t\tif [ -n \"${GIT_PS1_SHOWDIRTYSTATE-}\" ]; then\n+\t\t\tif [ \"$(git config --bool bash.showDirtyState)\" != \"false\" ]; then\n \t\t\t\tgit diff --no-ext-diff --ignore-submodules \\\n \t\t\t\t\t--quiet --exit-code || w=\"*\"\n \t\t\t\tif git rev-parse --quiet --verify HEAD >/dev/null; then\n-- \n1.6.1.2.390.gba743\n"},{"id":"104270","messageId":"1234378479-29304-4-git-send-email-ted@tedpavlic.com","threadId":"17727","inReplyTo":"1234378479-29304-3-git-send-email-ted@tedpavlic.com","subject":"[PATCH 3/4] completion: Better __git_ps1 support when not in working directory","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-11T18:54:38Z","receivedAt":"2009-02-11T18:54:38Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"If .git/HEAD is not readable, __git_ps1 does nothing.\n\nIf --is-in-git-dir, __git_ps1 returns \" (GIT_DIR!)\" as a cautionary\nnote. The previous behavior would show the branch name (and would\noptionally attempt to determine the dirtyState of the directory, which\nwas impossible because a \"git diff\" was used).\n\nIf --is-in-work-tree, __git_ps1 returns the branch name. Additionally,\nif showDirtyState is on, the dirty state is displayed.\n\nSigned-off-by: Ted Pavlic <ted@tedpavlic.com>\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |   37 +++++++++++++++++++------------\n 1 files changed, 23 insertions(+), 14 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex e729944..3d48a65 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -108,7 +108,9 @@ __git_ps1 ()\n \t\t\tfi\n \t\t\tif ! b=\"$(git symbolic-ref HEAD 2>/dev/null)\"; then\n \t\t\t\tif ! b=\"$(git describe --exact-match HEAD 2>/dev/null)\"; then\n-\t\t\t\t\tb=\"$(cut -c1-7 \"$g/HEAD\")...\"\n+\t\t\t\t\tif [ -r \"$g/HEAD\" ]; then\n+\t\t\t\t\t\tb=\"$(cut -c1-7 \"$g/HEAD\")...\"\n+\t\t\t\t\tfi\n \t\t\t\tfi\n \t\t\tfi\n \t\tfi\n@@ -116,23 +118,30 @@ __git_ps1 ()\n \t\tlocal w\n \t\tlocal i\n \n-\t\tif [ -n \"${GIT_PS1_SHOWDIRTYSTATE-}\" ]; then\n-\t\t\tif [ \"$(git config --bool bash.showDirtyState)\" != \"false\" ]; then\n-\t\t\t\tgit diff --no-ext-diff --ignore-submodules \\\n-\t\t\t\t\t--quiet --exit-code || w=\"*\"\n-\t\t\t\tif git rev-parse --quiet --verify HEAD >/dev/null; then\n-\t\t\t\t\tgit diff-index --cached --quiet \\\n-\t\t\t\t\t\t--ignore-submodules HEAD -- || i=\"+\"\n-\t\t\t\telse\n-\t\t\t\t\ti=\"#\"\n+\t\tif [ \"true\" = \"$(git rev-parse --is-inside-git-dir 2>/dev/null)\" ]; then\n+\t\t\tb=\"GIT_DIR!\"\n+            r=\"\"\n+\t\telif [ \"true\" = \"$(git rev-parse --is-inside-work-tree 2>/dev/null)\" ]; then\n+\t\t\tif [ -n \"${GIT_PS1_SHOWDIRTYSTATE-}\" ]; then\n+\t\t\t\tif [ \"$(git config --bool bash.showDirtyState)\" != \"false\" ]; then\n+\t\t\t\t\tgit diff --no-ext-diff --ignore-submodules \\\n+\t\t\t\t\t\t--quiet --exit-code || w=\"*\"\n+\t\t\t\t\tif git rev-parse --quiet --verify HEAD >/dev/null; then\n+\t\t\t\t\t\tgit diff-index --cached --quiet \\\n+\t\t\t\t\t\t\t--ignore-submodules HEAD -- || i=\"+\"\n+\t\t\t\t\telse\n+\t\t\t\t\t\ti=\"#\"\n+\t\t\t\t\tfi\n \t\t\t\tfi\n \t\t\tfi\n \t\tfi\n \n-\t\tif [ -n \"${1-}\" ]; then\n-\t\t\tprintf \"$1\" \"${b##refs/heads/}$w$i$r\"\n-\t\telse\n-\t\t\tprintf \" (%s)\" \"${b##refs/heads/}$w$i$r\"\n+\t\tif [ -n \"$b\" ]; then\n+\t\t\tif [ -n \"${1-}\" ]; then\n+\t\t\t\tprintf \"$1\" \"${b##refs/heads/}$w$i$r\"\n+\t\t\telse\n+\t\t\t\tprintf \" (%s)\" \"${b##refs/heads/}$w$i$r\"\n+\t\t\tfi\n \t\tfi\n \tfi\n }\n-- \n1.6.1.2.390.gba743\n"},{"id":"104271","messageId":"1234378479-29304-5-git-send-email-ted@tedpavlic.com","threadId":"17727","inReplyTo":"1234378479-29304-4-git-send-email-ted@tedpavlic.com","subject":"[PATCH 4/4] completion: More fixes to prevent unbound variable errors.","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-11T18:54:39Z","receivedAt":"2009-02-11T18:54:39Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"Several functions make use of \"[-n ...]\" and \"[-z ...]\". In many cases,\nthe variables being tested were declared with \"local.\" However, several\n__variables are not, and so they must be replaced with their ${__-}\nequivalents.\n\nSigned-off-by: Ted Pavlic <ted@tedpavlic.com>\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n---\n contrib/completion/git-completion.bash |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 3d48a65..8d62b2b 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -62,7 +62,7 @@ esac\n __gitdir ()\n {\n \tif [ -z \"${1-}\" ]; then\n-\t\tif [ -n \"$__git_dir\" ]; then\n+\t\tif [ -n \"${__git_dir-}\" ]; then\n \t\t\techo \"$__git_dir\"\n \t\telif [ -d .git ]; then\n \t\t\techo .git\n@@ -299,7 +299,7 @@ __git_remotes ()\n \n __git_merge_strategies ()\n {\n-\tif [ -n \"$__git_merge_strategylist\" ]; then\n+\tif [ -n \"${__git_merge_strategylist-}\" ]; then\n \t\techo \"$__git_merge_strategylist\"\n \t\treturn\n \tfi\n@@ -385,7 +385,7 @@ __git_complete_revlist ()\n \n __git_all_commands ()\n {\n-\tif [ -n \"$__git_all_commandlist\" ]; then\n+\tif [ -n \"${__git_all_commandlist-}\" ]; then\n \t\techo \"$__git_all_commandlist\"\n \t\treturn\n \tfi\n@@ -403,7 +403,7 @@ __git_all_commandlist=\"$(__git_all_commands 2>/dev/null)\"\n \n __git_porcelain_commands ()\n {\n-\tif [ -n \"$__git_porcelain_commandlist\" ]; then\n+\tif [ -n \"${__git_porcelain_commandlist-}\" ]; then\n \t\techo \"$__git_porcelain_commandlist\"\n \t\treturn\n \tfi\n-- \n1.6.1.2.390.gba743\n"},{"id":"104306","messageId":"20090211222503.GF29955@coredump.intra.peff.net","threadId":"17727","inReplyTo":"49931C3F.4000903@tedpavlic.com","subject":"Re: [PATCH 2/4] completion: Use consistent if [...] convention. No test.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-02-11T22:25:03Z","receivedAt":"2009-02-11T22:25:03Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 11, 2009 at 01:43:11PM -0500, Ted Pavlic wrote:\n\n> In Vim, I have \"exapndtabs\" set by default. I manually turned it off, but \n> during testing, I must have closed Vim and re-opened and forgot to turn it \n> back off.\n>\n> Some time ago, I suggested adding a vim modeline to the file to handle  \n> turning expandtabs off for everyone who edits it with vim. That change  \n> got denied.\n\nFWIW, I do this in my .vimrc:\n\n  au BufNewFile,BufRead /path/to/git/repo/* set noet sts=8 sw=8 ts=8\n\n-Peff\n"},{"id":"105629","messageId":"499EE1DE.2000309@tedpavlic.com","threadId":"17727","inReplyTo":"1234378479-29304-1-git-send-email-ted@tedpavlic.com","subject":"Re: [PATCH 0/4] completion fixes: Acks, whitespace, and r=\"\"","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-20T17:01:18Z","receivedAt":"2009-02-20T17:01:18Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"In my latest \"git pull,\" I noticed a few completion changes, but none of \nthese changes were included (and thus on some of my machines, I get \nunbound variable errors again).\n\nWere these changes finally rejected?\n\nThanks --\nTed\n\nOn 2/11/09 1:54 PM, Ted Pavlic wrote:\n> * Added Shawn O. Pearce acks\n> * Fixed whitespace problem in second patch (vim:expandtabs was on)\n> * When in GIT_DIR, set r=\"\" in __git_ps1 as well\n>\n> Ted Pavlic (4):\n>    completion: For consistency, changed \"git rev-parse\" to __gitdir\n>      calls.\n>    completion: Use consistent if [...] convention. No test.\n>    completion: Better __git_ps1 support when not in working directory\n>    completion: More fixes to prevent unbound variable errors.\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":"105631","messageId":"200902201808.32834.trast@student.ethz.ch","threadId":"17727","inReplyTo":"499EE1DE.2000309@tedpavlic.com","subject":"Re: [PATCH 0/4] completion fixes: Acks, whitespace, and r=\"\"","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-20T17:08:23Z","receivedAt":"2009-02-20T17:08:23Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Ted Pavlic wrote:\n> In my latest \"git pull,\" I noticed a few completion changes, but none of \n> these changes were included (and thus on some of my machines, I get \n> unbound variable errors again).\n> \n> Were these changes finally rejected?\n\n$ git log --pretty=oneline --abbrev-commit -4 --author=Pavlic origin/next\n5c9cc64 completion: More fixes to prevent unbound variable errors\ne5dd864 completion: Better __git_ps1 support when not in working directory\nad244d2 completion: Use consistent if [...] convention, not \"test\"\nfa26a40 completion: For consistency, change \"git rev-parse\" to __gitdir calls\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"105634","messageId":"499EE5EB.2090305@tedpavlic.com","threadId":"17727","inReplyTo":"200902201808.32834.trast@student.ethz.ch","subject":"Re: [PATCH 0/4] completion fixes: Acks, whitespace, and r=\"\"","fromName":"Ted Pavlic","fromEmail":"ted@tedpavlic.com","sentAt":"2009-02-20T17:18:35Z","receivedAt":"2009-02-20T17:18:35Z","isPatch":true,"sender":{"key":"ted@tedpavlic.com","avatar":"https://gravatar.com/avatar/d085392370ff4c028cf17a0e81e0647744c9682fbcb36b499f31d08ef80ef569?d=mp&s=160"},"body":"> $ git log --pretty=oneline --abbrev-commit -4 --author=Pavlic origin/next\n\nAh -- next branch. I git it.\n\nThis is all very fancy. Sorry for the spam.\n\n--Ted\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"}]}