git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Markus Heidelberg <markus.heidelberg@web.de>
Date
May 23, 2009, 17:28 UTC
Message-ID
<1243099727-5272-1-git-send-email-markus.heidelberg@web.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
Next: Clemens Buchacher
Message 1 of 3 in “Revert "git gui: show diffs with a minimum of 1 context line"”
  1. Revert "git gui: show diffs with a minimum of 1 context line"Markus Heidelberg, May 23, 2009
  2. Clemens BuchacherMay 23, 2009
  3. Markus HeidelbergMay 24, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.