# [PATCH] Revert "git gui: show diffs with a minimum of 1 context line"

3 messages from 2009-05-23 to 2009-05-24. Participants: Markus Heidelberg, Clemens Buchacher.
Thread: https://gitlist.dev/t/19452

## Markus Heidelberg, 2009-05-23 17:28

Subject: [PATCH] Revert "git gui: show diffs with a minimum of 1 context line"
Message-ID: <1243099727-5272-1-git-send-email-markus.heidelberg@web.de>
URL: https://gitlist.dev/e/1243099727-5272-1-git-send-email-markus.heidelberg%40web.de

```
This reverts commit 55ba8a3474102eb8d638834d2b9bfe58d5014a40.

Conflicts:

	lib/option.tcl

Diffs without context can actually be useful. Depending on the changes
it can be less distracting to read them or to get an overview.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
 git-gui.sh     |    2 +-
 lib/diff.tcl   |    2 +-
 lib/option.tcl |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index 14b92ba..604fdad 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2287,7 +2287,7 @@ proc show_more_context {} {
 
 proc show_less_context {} {
 	global repo_config
-	if {$repo_config(gui.diffcontext) > 1} {
+	if {$repo_config(gui.diffcontext) >= 1} {
 		incr repo_config(gui.diffcontext) -1
 		reshow_diff
 	}
diff --git a/lib/diff.tcl b/lib/diff.tcl
index 925b3f5..71b250b 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -282,7 +282,7 @@ proc start_show_diff {cont_info {add_opts {}}} {
 
 	lappend cmd -p
 	lappend cmd --no-color
-	if {$repo_config(gui.diffcontext) >= 1} {
+	if {$repo_config(gui.diffcontext) >= 0} {
 		lappend cmd "-U$repo_config(gui.diffcontext)"
 	}
 	if {$w eq $ui_index} {
diff --git a/lib/option.tcl b/lib/option.tcl
index 1d55b49..eb216f6 100644
--- a/lib/option.tcl
+++ b/lib/option.tcl
@@ -149,7 +149,7 @@ proc do_options {} {
 		{b gui.fastcopyblame {mc "Blame Copy Only On Changed Files"}}
 		{i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
 		{i-0..300 gui.blamehistoryctx {mc "Blame History Context Radius (days)"}}
-		{i-1..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
+		{i-0..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
 		{i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
 		{t gui.newbranchtemplate {mc "New Branch Name Template"}}
 		{c gui.encoding {mc "Default File Contents Encoding"}}
-- 
1.6.3.1.160.g45b30

```

## Clemens Buchacher, 2009-05-23 23:16

Subject: Re: [PATCH] Revert "git gui: show diffs with a minimum of 1 context line"
Message-ID: <20090523231605.GA4522@localhost>
URL: https://gitlist.dev/e/20090523231605.GA4522%40localhost
In-Reply-To: <1243099727-5272-1-git-send-email-markus.heidelberg@web.de>

```
On Sat, May 23, 2009 at 07:28:47PM +0200, Markus Heidelberg wrote:
> Diffs without context can actually be useful. Depending on the changes
> it can be less distracting to read them or to get an overview.

Maybe so. But as stated in the commit message of 55ba8a3 (git gui: show
diffs with a minimum of 1 context line) context-less diff was disabled
because it caused bugs with staging. However, I never got around to fix the
real cause of the problem. See the original thread at

http://article.gmane.org/gmane.comp.version-control.git/94387

```

## Markus Heidelberg, 2009-05-24 10:01

Subject: Re: [PATCH] Revert "git gui: show diffs with a minimum of 1 context line"
Message-ID: <200905241201.04297.markus.heidelberg@web.de>
URL: https://gitlist.dev/e/200905241201.04297.markus.heidelberg%40web.de
In-Reply-To: <20090523231605.GA4522@localhost>

```
Clemens Buchacher, 24.05.2009:
> On Sat, May 23, 2009 at 07:28:47PM +0200, Markus Heidelberg wrote:
> > Diffs without context can actually be useful. Depending on the changes
> > it can be less distracting to read them or to get an overview.
> 
> Maybe so. But as stated in the commit message of 55ba8a3 (git gui: show
> diffs with a minimum of 1 context line) context-less diff was disabled
> because it caused bugs with staging.

It wasn't clear to me that there were bugs. I thought it just "does not
work" in some way, but should have tried it at least. Now I see.

> However, I never got around to fix the
> real cause of the problem. See the original thread at
> 
> http://article.gmane.org/gmane.comp.version-control.git/94387

Thanks for the link. After reading this discussion I also see that
disabling staging with zero context is not a user-friendly solution.

Markus

```
