Thread (1 message) 1 message, 1 author, 2016-06-15
  • (off-list ancestor, not in this archive)
  • Re: MinGW port usable · Junio C Hamano <hidden> · 2016-06-15

Re: MinGW port usable

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:51
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Johannes Sixt [off-list ref] writes:
Junio, you may like to cherry-pick these two non-critical commits from my 
repository:

8c8bb94f94f1d972c7ffadda4744cf343fac6f34 gitk: Use peek-remote instead of 
ls-remote.
46580d2192d79a469f8b40fc1081db9116ad5517 Add a missing fork() error check.
Thanks; cherry-picked the fork() one.

Regarding gitk, I think the following patch would be better
regardless of the platform.

-- >8 --
[PATCH] gitk: Use show-ref instead of ls-remote

It used to be ls-remote on self was the only easy way to grab
the ref information.  Now we have show-ref which does not
involve fork and IPC, so use it.

Signed-off-by: Junio C Hamano <redacted>
---
diff --git a/gitk b/gitk
index 31d0aad..67e6a64 100755
--- a/gitk
+++ b/gitk
@@ -309,9 +309,9 @@ proc readrefs {} {
     foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
 	catch {unset $v}
     }
-    set refd [open [list | git ls-remote [gitdir]] r]
+    set refd [open [list | git show-ref] r]
     while {0 <= [set n [gets $refd line]]} {
-	if {![regexp {^([0-9a-f]{40})	refs/([^^]*)$} $line \
+	if {![regexp {^([0-9a-f]{40}) refs/([^^]*)$} $line \
 	    match id path]} {
 	    continue
 	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help