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

Re: [PATCH 1/2] fetch/push: allow refs/*:refs/*

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 22, 2012, 16:56 UTC
Message-ID
<7vlih6ams7.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7v7gsrb1xs.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> Michael Haggerty <mhagger@alum.mit.edu> writes:
> ...
>> * The second branch of the if is *never* executed.
> 		else if (args.fetch_all &&
> 			 (!args.depth || prefixcmp(ref->name, "refs/tags/") )) {
> 			*newtail = ref;
> 			ref->next = NULL;
> 			newtail = &ref->next;
> 			continue;
> 		}
>
> I am not familiar with (nor particularly interested in) the "args.depth"
> code, so I have no comment on this part offhand.

This is "fetch --all" case. I think the original intent was to fetch all branches (hence exclusion of tags) so the prefixcmp() may not be correct (!prefixcmp() with "refs/heads" would be more kosher) these days. I am not sure what !args.depth check wants to do here (that is, I can see it wants to defeat "fetch --all" and instead make it go through the usual refspec matching codepath, but I do not know why we thought that is a good thing to do here).

Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 8 in “further fixes of check_ref_format() users”
  1. 0/2 further fixes of check_ref_format() usersJunio C Hamano, Aug 20, 2012
  2. 1/2 fetch/push: allow refs/*:refs/*Junio C Hamano, Aug 20, 2012
  3. Michael HaggertyAug 21, 2012
  4. Junio C HamanoAug 21, 2012
  5. Michael HaggertyAug 22, 2012
  6. Junio C HamanoAug 22, 2012
  7. Junio C HamanoAug 22, 2012
  8. 2/2 get_fetch_map(): tighten checks on dest refsJunio C Hamano, Aug 20, 2012

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.