# [PATCH] rebase: only show stat if configured to true

2 messages from 2010-11-09 to 2010-11-29. Participants: Martin von Zweigbergk, Junio C Hamano.
Thread: https://gitlist.dev/t/25695

## Martin von Zweigbergk, 2010-11-09 20:59

Subject: [PATCH] rebase: only show stat if configured to true
Message-ID: <1289336340-28337-1-git-send-email-martin.von.zweigbergk@gmail.com>
URL: https://gitlist.dev/e/1289336340-28337-1-git-send-email-martin.von.zweigbergk%40gmail.com

```
If rebase.stat is set to true, a diffstat should be displayed. If it is
not set, it should default to false. However, if it is explicitly set to
false (or other value), a diffstat is still displayed, which is probably
not what most users would expect. Show diffstat only if it is set
to true.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
---
 git-rebase.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index e5df23b..42c0628 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -49,7 +49,8 @@ do_merge=
 dotest="$GIT_DIR"/rebase-merge
 prec=4
 verbose=
-diffstat=$(git config --bool rebase.stat)
+diffstat=
+test "$(git config --bool rebase.stat)" = true && diffstat=t
 git_am_opt=
 rebase_root=
 force_rebase=
-- 
1.7.3.2.167.ga361b

```

## Junio C Hamano, 2010-11-29 22:50

Subject: Re: [PATCH] rebase: only show stat if configured to true
Message-ID: <7veia3zqv9.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7veia3zqv9.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1289336340-28337-1-git-send-email-martin.von.zweigbergk@gmail.com>

```
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:

> If rebase.stat is set to true, a diffstat should be displayed. If it is
> not set, it should default to false. However, if it is explicitly set to
> false (or other value), a diffstat is still displayed, which is probably
> not what most users would expect. Show diffstat only if it is set
> to true.
>
> Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
> ---

Sounds sensible; it would have been nicer if it came with a test, but this
particular change is sort of obvious ;-)

Thanks.

```
