All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH] git-gui: Show a round number of bytes of large untracked text files
Date: Fri, 03 Oct 2008 10:28:49 +0200	[thread overview]
Message-ID: <48E5D7C1.7050404@viscovery.net> (raw)

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

                 reply	other threads:[~2008-10-03  8:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48E5D7C1.7050404@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.