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

[PATCH] git-gui: Show a round number of bytes of large untracked text files

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Oct 3, 2008, 08:28 UTC
Message-ID
<48E5D7C1.7050404@viscovery.net>
From: Johannes Sixt <johannes.sixt@telecom.at>

If an untracked text file is selected, then its contents are displayed instead of a diff. If the file is large, then the following hint is inserted at the top:

  * Untracked file is 14774881 bytes.
  * Showing only first 131072 bytes.
Why exactly 131072 bytes? With this patch it is 100000 bytes.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
 Another bikeshed to paint. ;)
 Every now and then I stumble over this number, and I ask myself,
 why are those h4x3rs so binary?
 -- Hannes
 lib/diff.tcl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/diff.tcl b/lib/diff.tcl
index abe502d..6e08704 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -164,7 +164,7 @@ proc show_other_diff {path w m cont_info} {
 	# - Git won't give us the diff, there's nothing to compare to!
 	#
 	if {$m eq {_O}} {
-		set max_sz [expr {128 * 1024}]
+		set max_sz 100000
 		set type unknown
 		if {[catch {
 				set type [file type $path]
-- 
1.6.0.2.319.gffa7c
Message 1 of 1 in “git-gui: Show a round number of bytes of large untracked text files”
  1. git-gui: Show a round number of bytes of large untracked text filesJohannes Sixt, Oct 3, 2008

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.