threads / patch / 25695

patchrebase: only show stat if configured to true

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

## tl;dr

2 messages between Nov 9, 2010 and Nov 29, 2010. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Martin von Zweigbergk· Nov 9, 2010, 20:59 UTC · lore

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(-)
Show changes to git-rebase.sh +2 −1
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· Nov 29, 2010, 22:50 UTC · re: Martin von Zweigbergk · lore

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

Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:
Show 8 quoted lines
> 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.

← back to recent threads