git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix gitk with lots of tags
@ 2006-04-06 20:36 Jim Radford
  2006-04-18 18:06 ` [RESEND] " Jim Radford
  0 siblings, 1 reply; 5+ messages in thread
From: Jim Radford @ 2006-04-06 20:36 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Junio C Hamano, Git Mailing List

Hi Paul,

This fix allow gitk to be used on repositories with lots of tags.  It
bypasses git-rev-parse and passes its arguments to git-rev-list
directly to avoid the command line length restrictions.

Signed-Off-By: Jim Radford <radford@blackbean.org>

-Jim

---
diff --git a/gitk b/gitk
index 26fa79a..40672fb 100755
--- a/gitk
+++ b/gitk
@@ -17,19 +17,11 @@ proc gitdir {} {
 }
 
 proc parse_args {rargs} {
-    global parsed_args
-
-    if {[catch {
-	set parse_args [concat --default HEAD $rargs]
-	set parsed_args [split [eval exec git-rev-parse $parse_args] "\n"]
-    }]} {
-	# if git-rev-parse failed for some reason...
-	if {$rargs == {}} {
-	    set rargs HEAD
-	}
-	set parsed_args $rargs
+    if {$rargs == {}} {
+        return HEAD
+    } else {
+	return $rargs
     }
-    return $parsed_args
 }
 
 proc start_rev_list {rlargs} {

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RESEND] [PATCH] fix gitk with lots of tags
  2006-04-06 20:36 [PATCH] fix gitk with lots of tags Jim Radford
@ 2006-04-18 18:06 ` Jim Radford
  2006-04-18 18:38   ` Linus Torvalds
  2006-04-21 11:48   ` Paul Mackerras
  0 siblings, 2 replies; 5+ messages in thread
From: Jim Radford @ 2006-04-18 18:06 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Paul Mackerras, Git Mailing List

Hi Junio,

I've gotten no reposnse from Paul on this patch[1].  If it seems ok to
you, would you mind putting it in your queue for him?  I hate to see
gitk die with "argument list too long" messages.  They're so 640k.

Thanks,
-Jim

[1] Maybe he judges people by the color of their IP address?
    Then again, he could just be busy.

---

This fix allow gitk to be used on repositories with lots of tags.  It
bypasses git-rev-parse and passes its arguments to git-rev-list
directly to avoid tcl's argument list length restrictions.

Signed-Off-By: Jim Radford <radford@blackbean.org>

diff --git a/gitk b/gitk
index 26fa79a..40672fb 100755
--- a/gitk
+++ b/gitk
@@ -17,19 +17,11 @@ proc gitdir {} {
 }
 
 proc parse_args {rargs} {
-    global parsed_args
-
-    if {[catch {
-	set parse_args [concat --default HEAD $rargs]
-	set parsed_args [split [eval exec git-rev-parse $parse_args] "\n"]
-    }]} {
-	# if git-rev-parse failed for some reason...
-	if {$rargs == {}} {
-	    set rargs HEAD
-	}
-	set parsed_args $rargs
+    if {$rargs == {}} {
+        return HEAD
+    } else {
+	return $rargs
     }
-    return $parsed_args
 }
 
 proc start_rev_list {rlargs} {

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RESEND] [PATCH] fix gitk with lots of tags
  2006-04-18 18:06 ` [RESEND] " Jim Radford
@ 2006-04-18 18:38   ` Linus Torvalds
  2006-04-21 11:48   ` Paul Mackerras
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2006-04-18 18:38 UTC (permalink / raw)
  To: Jim Radford; +Cc: Junio C Hamano, Paul Mackerras, Git Mailing List



On Tue, 18 Apr 2006, Jim Radford wrote:
> 
> I've gotten no reposnse from Paul on this patch[1].  If it seems ok to
> you, would you mind putting it in your queue for him?  I hate to see
> gitk die with "argument list too long" messages.  They're so 640k.

Don't do this patch. It's wrong.

However, this simpler patch might be ok.

It just depends on the fact that git-rev-list can parse everything that 
git-rev-parse used to do these days, and thus the git-rev-parse call 
really isn't needed any more (and if that isn't true for some odd 
argument, we should make it true).

So the only thing we need to do is to add the "--default HEAD" thing to 
the front of the argument list.

		Linus

---
diff --git a/gitk b/gitk
index 87e7162..5d95779 100755
--- a/gitk
+++ b/gitk
@@ -19,16 +19,7 @@ proc gitdir {} {
 proc parse_args {rargs} {
     global parsed_args
 
-    if {[catch {
-	set parse_args [concat --default HEAD $rargs]
-	set parsed_args [split [eval exec git-rev-parse $parse_args] "\n"]
-    }]} {
-	# if git-rev-parse failed for some reason...
-	if {$rargs == {}} {
-	    set rargs HEAD
-	}
-	set parsed_args $rargs
-    }
+    set parsed_args [concat --default HEAD $rargs]
     return $parsed_args
 }
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RESEND] [PATCH] fix gitk with lots of tags
  2006-04-18 18:06 ` [RESEND] " Jim Radford
  2006-04-18 18:38   ` Linus Torvalds
@ 2006-04-21 11:48   ` Paul Mackerras
  2006-04-21 15:19     ` Linus Torvalds
  1 sibling, 1 reply; 5+ messages in thread
From: Paul Mackerras @ 2006-04-21 11:48 UTC (permalink / raw)
  To: Jim Radford; +Cc: Junio C Hamano, Git Mailing List

Jim Radford writes:

> I've gotten no reposnse from Paul on this patch[1].  If it seems ok to
> you, would you mind putting it in your queue for him?  I hate to see
> gitk die with "argument list too long" messages.  They're so 640k.

The reservation I have about this is that I need to be able to tell
the file/directory names from the tags/heads/SHA1 IDs.  After the pass
through git-rev-parse it's easy; I just take the things that match
^[a-f0-9]{40}$ as IDs and the rest as file/directory names or
switches.

Junio, did you tell me some time ago about a flag to git-rev-parse
that spits out just the file/directory names?  What was it again?

> [1] Maybe he judges people by the color of their IP address?

As in _black_bean.org? :)

>     Then again, he could just be busy.

Yeah.  Or just returned from international travel, or something like
that. :)

Paul.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RESEND] [PATCH] fix gitk with lots of tags
  2006-04-21 11:48   ` Paul Mackerras
@ 2006-04-21 15:19     ` Linus Torvalds
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2006-04-21 15:19 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Jim Radford, Junio C Hamano, Git Mailing List



On Fri, 21 Apr 2006, Paul Mackerras wrote:
> 
> Junio, did you tell me some time ago about a flag to git-rev-parse
> that spits out just the file/directory names?  What was it again?

	git-rev-parse --no-flags --no-revs "$@"

should fo what you want.

		Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-04-21 15:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-06 20:36 [PATCH] fix gitk with lots of tags Jim Radford
2006-04-18 18:06 ` [RESEND] " Jim Radford
2006-04-18 18:38   ` Linus Torvalds
2006-04-21 11:48   ` Paul Mackerras
2006-04-21 15:19     ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).