# [PATCH 0/2] completion: Fixes GIT_PS1_SHOWDIRTYSTATE problems

9 messages from 2009-02-06 to 2009-02-06. Participants: Ted Pavlic, Shawn O. Pearce, Thomas Rast.
Thread: https://gitlist.dev/t/17616

## Ted Pavlic, 2009-02-06 15:46

Subject: [PATCH 0/2] completion: Fixes GIT_PS1_SHOWDIRTYSTATE problems
Message-ID: <1233935210-4941-1-git-send-email-ted@tedpavlic.com>
URL: https://gitlist.dev/e/1233935210-4941-1-git-send-email-ted%40tedpavlic.com

```
These two patches correct some problems introduced by the recent
GIT_PS1_SHOWDIRTYSTATE fixes.

The first changes $VAR to ${VAR-} to
prevent the unbound variable errors that were discussed earlier on the
list.

The second changes the GIT_PS1_SHOWDIRTYSTATE documentation from

#(Tab)Text

to

#(7 spaces)Text

to be consistent with the surrounding text.

Ted Pavlic (2):
  completion: Fix GIT_PS1_SHOWDIRTYSTATE to prevent unbound variable
    errors.
  completion: Get rid of tabbed indentation in comments. Replace with
    spaces.

 contrib/completion/git-completion.bash |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

```

## Ted Pavlic, 2009-02-06 15:46

Subject: [PATCH 1/2] completion: Fix GIT_PS1_SHOWDIRTYSTATE to prevent unbound variable errors.
Message-ID: <1233935210-4941-2-git-send-email-ted@tedpavlic.com>
URL: https://gitlist.dev/e/1233935210-4941-2-git-send-email-ted%40tedpavlic.com
In-Reply-To: <1233935210-4941-1-git-send-email-ted@tedpavlic.com>

```
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
---
 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 307bf5d..6e04985 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -125,7 +125,7 @@ __git_ps1 ()
 		local w
 		local i
 
-		if test -n "$GIT_PS1_SHOWDIRTYSTATE"; then
+		if test -n "${GIT_PS1_SHOWDIRTYSTATE-}"; then
 			if test "$(git config --bool bash.showDirtyState)" != "false"; then
 				git diff --no-ext-diff --ignore-submodules \
 					--quiet --exit-code || w="*"
-- 
1.6.1.2.319.gbd9e

```

## Ted Pavlic, 2009-02-06 15:46

Subject: [PATCH 2/2] completion: Get rid of tabbed indentation in comments. Replace with spaces.
Message-ID: <1233935210-4941-3-git-send-email-ted@tedpavlic.com>
URL: https://gitlist.dev/e/1233935210-4941-3-git-send-email-ted%40tedpavlic.com
In-Reply-To: <1233935210-4941-2-git-send-email-ted@tedpavlic.com>

```
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
---
 contrib/completion/git-completion.bash |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 6e04985..f44f63c 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -34,11 +34,11 @@
 #       are currently in a git repository.  The %s token will be
 #       the name of the current branch.
 #
-#	In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty
-#	value, unstaged (*) and staged (+) changes will be shown next
-#	to the branch name.  You can configure this per-repository
-#	with the bash.showDirtyState variable, which defaults to true
-#	once GIT_PS1_SHOWDIRTYSTATE is enabled.
+#       In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty
+#       value, unstaged (*) and staged (+) changes will be shown next
+#       to the branch name.  You can configure this per-repository
+#       with the bash.showDirtyState variable, which defaults to true
+#       once GIT_PS1_SHOWDIRTYSTATE is enabled.
 #
 # To submit patches:
 #
-- 
1.6.1.2.319.gbd9e

```

## Shawn O. Pearce, 2009-02-06 15:58

Subject: Re: [PATCH 2/2] completion: Get rid of tabbed indentation in comments. Replace with spaces.
Message-ID: <20090206155823.GO26880@spearce.org>
URL: https://gitlist.dev/e/20090206155823.GO26880%40spearce.org
In-Reply-To: <1233935210-4941-3-git-send-email-ted@tedpavlic.com>

```
Ted Pavlic <ted@tedpavlic.com> wrote:
> Signed-off-by: Ted Pavlic <ted@tedpavlic.com>

Both patches,

Trivially-acked-by: Shawn O. Pearce <spearce@spearce.org>


> ---
>  contrib/completion/git-completion.bash |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 6e04985..f44f63c 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -34,11 +34,11 @@
>  #       are currently in a git repository.  The %s token will be
>  #       the name of the current branch.
>  #
> -#	In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty
> -#	value, unstaged (*) and staged (+) changes will be shown next
> -#	to the branch name.  You can configure this per-repository
> -#	with the bash.showDirtyState variable, which defaults to true
> -#	once GIT_PS1_SHOWDIRTYSTATE is enabled.
> +#       In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty
> +#       value, unstaged (*) and staged (+) changes will be shown next
> +#       to the branch name.  You can configure this per-repository
> +#       with the bash.showDirtyState variable, which defaults to true
> +#       once GIT_PS1_SHOWDIRTYSTATE is enabled.
>  #
>  # To submit patches:
>  #
> -- 
> 1.6.1.2.319.gbd9e
> 

-- 
Shawn.

```

## Ted Pavlic, 2009-02-06 16:05

Subject: [PATCH 1/2] completion: Fix GIT_PS1_SHOWDIRTYSTATE to prevent unbound variable errors.
Message-ID: <1233936338-10679-1-git-send-email-ted@tedpavlic.com>
URL: https://gitlist.dev/e/1233936338-10679-1-git-send-email-ted%40tedpavlic.com
In-Reply-To: <20090206155823.GO26880@spearce.org>

```
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
---
 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 307bf5d..6e04985 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -125,7 +125,7 @@ __git_ps1 ()
 		local w
 		local i
 
-		if test -n "$GIT_PS1_SHOWDIRTYSTATE"; then
+		if test -n "${GIT_PS1_SHOWDIRTYSTATE-}"; then
 			if test "$(git config --bool bash.showDirtyState)" != "false"; then
 				git diff --no-ext-diff --ignore-submodules \
 					--quiet --exit-code || w="*"
-- 
1.6.1.2.390.gba743

```

## Ted Pavlic, 2009-02-06 16:05

Subject: [PATCH 2/2] completion: Get rid of tabbed indentation in comments. Replace with spaces.
Message-ID: <1233936338-10679-2-git-send-email-ted@tedpavlic.com>
URL: https://gitlist.dev/e/1233936338-10679-2-git-send-email-ted%40tedpavlic.com
In-Reply-To: <1233936338-10679-1-git-send-email-ted@tedpavlic.com>

```
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
---
 contrib/completion/git-completion.bash |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 6e04985..f44f63c 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -34,11 +34,11 @@
 #       are currently in a git repository.  The %s token will be
 #       the name of the current branch.
 #
-#	In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty
-#	value, unstaged (*) and staged (+) changes will be shown next
-#	to the branch name.  You can configure this per-repository
-#	with the bash.showDirtyState variable, which defaults to true
-#	once GIT_PS1_SHOWDIRTYSTATE is enabled.
+#       In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty
+#       value, unstaged (*) and staged (+) changes will be shown next
+#       to the branch name.  You can configure this per-repository
+#       with the bash.showDirtyState variable, which defaults to true
+#       once GIT_PS1_SHOWDIRTYSTATE is enabled.
 #
 # To submit patches:
 #
-- 
1.6.1.2.390.gba743

```

## Shawn O. Pearce, 2009-02-06 16:13

Subject: Re: [PATCH 2/2] completion: Get rid of tabbed indentation in comments. Replace with spaces.
Message-ID: <20090206161303.GP26880@spearce.org>
URL: https://gitlist.dev/e/20090206161303.GP26880%40spearce.org
In-Reply-To: <1233936338-10679-2-git-send-email-ted@tedpavlic.com>

```
Ted Pavlic <ted@tedpavlic.com> wrote:
> Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
> Acked-by: Shawn O. Pearce <spearce@spearce.org>

Heh.

I expected Junio to use my TAB line as-is.  I find them amusing.
Plus, I didn't actually apply your patches and test them.  They
just looked right to me.  Usually Acked-by is applied only if you
actually ran the code and verified it does what the message claims.
Trivially-acked-by is a bit less strict.

Whatever.  These are really trivial patches.  Whatever Junio
applies here is fine.

Thanks for fixing that ${X-} thing.  I clearly missed it on the
review of the ps1 stuff.

-- 
Shawn.

```

## Ted Pavlic, 2009-02-06 16:19

Subject: Re: [PATCH 2/2] completion: Get rid of tabbed indentation in comments. Replace with spaces.
Message-ID: <498C6308.1000700@tedpavlic.com>
URL: https://gitlist.dev/e/498C6308.1000700%40tedpavlic.com
In-Reply-To: <20090206161303.GP26880@spearce.org>

```
> I expected Junio to use my TAB line as-is.  I find them amusing.

Oops. :( In the future, I'll leave such things as is. I just figured the 
"Trivially" was a side comment, but the function was still the same.

> Thanks for fixing that ${X-} thing.  I clearly missed it on the
> review of the ps1 stuff.

I would have missed it myself... but then after I did a git pull, I was 
getting a bash error on every single prompt. That was annoying. :)

Thanks --
Ted


-- 
Ted Pavlic <ted@tedpavlic.com>

   Please visit my ALS association page:
         http://web.alsa.org/goto/tedpavlic
   My family appreciates your support in the fight to defeat ALS.

```

## Thomas Rast, 2009-02-06 23:32

Subject: Re: [PATCH 2/2] completion: Get rid of tabbed indentation in comments. Replace with spaces.
Message-ID: <200902070032.40511.trast@student.ethz.ch>
URL: https://gitlist.dev/e/200902070032.40511.trast%40student.ethz.ch
In-Reply-To: <20090206161303.GP26880@spearce.org>

```
Shawn O. Pearce wrote:
> 
> Thanks for fixing that ${X-} thing.  I clearly missed it on the
> review of the ps1 stuff.

Sorry for not thinking of that, I actually remember the thread around
the original ${X-} cleanup...

For extra sillyness you could also add my Ack ;-)

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

```
