git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] git-fetch: do not use "*" for fetching multiple refs
@ 2006-12-04 19:38 Michael Loeffler
  2006-12-04 19:48 ` Jakub Narebski
  2006-12-04 19:49 ` Michael Loeffler
  0 siblings, 2 replies; 11+ messages in thread
From: Michael Loeffler @ 2006-12-04 19:38 UTC (permalink / raw)
  To: git

The trailing / is enough to decide if this should map everything under
refs/heads/ to refs/somewhere/.

The "*" should be reserved for the use as regex operator.

Signed-off-by: Michael Loeffler <zvpunry@zvpunry.de>
---
I want to use regular expressions to match remote refs, so I try to
implement this. But the current globfetch syntax needs the '*'.

Maybe it is not to late to change the syntax to this:
Pull: refs/heads/:refs/remotes/origin/

What do you think?


diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index da064a5..38af4cb 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -101,13 +101,13 @@ expand_refs_wildcard () {
 	do
 		lref=${ref#'+'}
 		# a non glob pattern is given back as-is.
-		expr "z$lref" : 'zrefs/.*/\*:refs/.*/\*$' >/dev/null || {
+		expr "z$lref" : 'zrefs/.*/:refs/.*/$' >/dev/null || {
 			echo "$ref"
 			continue
 		}
 
-		from=`expr "z$lref" : 'z\(refs/.*/\)\*:refs/.*/\*$'`
-		to=`expr "z$lref" : 'zrefs/.*/\*:\(refs/.*/\)\*$'`
+		from=`expr "z$lref" : 'z\(refs/.*/\):refs/.*/$'`
+		to=`expr "z$lref" : 'zrefs/.*/:\(refs/.*/\)$'`
 		local_force=
 		test "z$lref" = "z$ref" || local_force='+'
 		echo "$ls_remote_result" |
-- 
1.4.4



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

end of thread, other threads:[~2006-12-06 23:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-04 19:38 [PATCH 2/3] git-fetch: do not use "*" for fetching multiple refs Michael Loeffler
2006-12-04 19:48 ` Jakub Narebski
2006-12-06 16:34   ` Michael Loeffler
2006-12-06 16:58     ` Jakub Narebski
2006-12-06 18:16       ` Michael Loeffler
2006-12-06 18:27         ` Jakub Narebski
2006-12-06 18:39           ` Junio C Hamano
2006-12-06 18:37         ` Junio C Hamano
2006-12-06 23:21       ` Johannes Schindelin
2006-12-06 23:38         ` Jakub Narebski
2006-12-04 19:49 ` Michael Loeffler

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).