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

Re: [PATCH 3/5] remote: separate out the remote_find_tracking logic into query_refspecs

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 16, 2011, 05:10 UTC
Message-ID
<7vhb39ttcc.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vobxhtugo.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 17 quoted lines
> Carlos Martín Nieto <cmn@elego.de> writes:
>
>> Move the body of remote_find_tracking to a new function query_refspecs
>> which does the same (find a refspec that matches and apply the
>> transformation) but explicitly wants the list of refspecs.
>>
>> Make remote_find_tracking and apply_refspecs use query_refspecs.
>>
>> Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
>> ---
>>  remote.c |   70 ++++++++++++++++++++++++++++++-------------------------------
>>  1 files changed, 34 insertions(+), 36 deletions(-)
>
> Looks very sensible, especially knowing what you want to do in the next
> patch ;-).
>
> Thanks.

I notice that before this update, passing a refspec[] with an element that lacks its dst side to apply_refspecs() would have segfaulted but with this update such an element in the refspec[] will simply be ignored.

This helper function was added in 72ff894 (Allow helper to map private ref names into normal names, 2009-11-18) for transport-helper's use. I am sure the change will not introduce a regression due to this skippage (the code without this patch would have simply crashed with such an input anyway), but I thought people involved in the transport layer may want to know.

Previous: Junio C HamanoNext: Carlos Martín Nieto
Message 6 of 8 in “[PATCHv4 0/5] Be more careful when prunning”
  1. Carlos Martín NietoOct 15, 2011
  2. 1/5 fetch: free all the additional refspecsCarlos Martín Nieto, Oct 15, 2011
  3. 2/5 t5510: add tests for fetch --pruneCarlos Martín Nieto, Oct 15, 2011
  4. 3/5 remote: separate out the remote_find_tracking logic into query_refspecsCarlos Martín Nieto, Oct 15, 2011
  5. Junio C HamanoOct 16, 2011
  6. Junio C HamanoOct 16, 2011
  7. 4/5 fetch: honor the user-provided refspecs when pruning refsCarlos Martín Nieto, Oct 15, 2011
  8. 5/5 fetch: treat --tags like refs/tags/*:refs/tags/* when pruningCarlos Martín Nieto, Oct 15, 2011

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.