git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 26, 2008, 03:31 UTC
Message-ID
<7vod92jh3u.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.1.00.0803251841420.2775@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 13 quoted lines
> On Fri, 21 Mar 2008, Junio C Hamano wrote:
>>
>> 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)
Previous: Linus TorvaldsNext: Junio C Hamano
Message 16 of 20 in “Permit refspec source side to parse as a sha1”
  1. Permit refspec source side to parse as a sha1Daniel Barkalow, Mar 21, 2008
  2. Junio C HamanoMar 21, 2008
  3. Junio C HamanoMar 21, 2008
  4. Daniel BarkalowMar 21, 2008
  5. Junio C HamanoMar 21, 2008
  6. Daniel BarkalowMar 21, 2008
  7. Junio C HamanoMar 21, 2008
  8. Daniel BarkalowMar 21, 2008
  9. remote.c: Fix overtight refspec validationJunio C Hamano, Mar 21, 2008
  10. Daniel BarkalowMar 21, 2008
  11. Junio C HamanoMar 21, 2008
  12. Daniel BarkalowMar 22, 2008
  13. Junio C HamanoMar 22, 2008
  14. Daniel BarkalowMar 22, 2008
  15. Linus TorvaldsMar 26, 2008
  16. Junio C HamanoMar 26, 2008
  17. Junio C HamanoMar 26, 2008
  18. Daniel BarkalowMar 26, 2008
  19. Junio C HamanoMar 26, 2008
  20. Jeff KingMar 26, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.