Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] remote.c: Fix overtight refspec validation

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

Possibly related (same subject, not in this thread)

Linus Torvalds [off-list ref] writes:
On Fri, 21 Mar 2008, Junio C Hamano wrote:
quoted
We tightened the refspec validation code in an earlier ef00d15 (Tighten
refspec processing, 2008-03-17) per my suggestion, but the suggestion was
misguided to begin with and it broke this usage:
It seems to have also broken "git push --tags".

I now get 

	fatal: Invalid refspec 'refs/tags/*'

which seems a bit sad.
Yeah that indeed is very sad.  Given that Andrew identified another
regression on the fetch side today, I am beginning to suspect that 1.5.4
was still too early to merge the C rewrite.  On the other hand, until we
tag, new features are not tested in the field, so...

Especially that "refs/tags/*" is sad in that it is leaking an internal
implementation detail.  I do not think the original code ever used
wildcards on the push side, and it probably was a good idea to allow
wildcards when the code was rewritten.

In any case, this should fix it.

 builtin-push.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-push.c b/builtin-push.c
index b68c681..5316d6d 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -120,7 +120,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 	if (verbose)
 		flags |= TRANSPORT_PUSH_VERBOSE;
 	if (tags)
-		add_refspec("refs/tags/*");
+		add_refspec("refs/tags/*:refs/tags/*");
 	if (all)
 		flags |= TRANSPORT_PUSH_ALL;
 	if (mirror)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help