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

Re: [PATCH 3/3] refspec: store raw refspecs inside refspec_item

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 12, 2024, 09:30 UTC
Message-ID
<xmqqttcc4x5u.fsf@gitster.g>
In-Reply-To
<20241112083937.GC3529122@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> The refspec struct keeps two matched arrays: one for the refspec_item
> structs and one for the original raw refspec strings. The main reason
> for this is that there are other users of refspec_item that do not care
> about the raw strings. But it does make managing the refspec struct
> awkward, as we must keep the two arrays in sync. This has led to bugs in
> the past (both leaks and double-frees).

Yeah, I was wondering about this while reading [2/3], and it is very satisfying to see that the concluding step for the series ends in this change.

Thanks.
Previous: Jeff King
Message 7 of 7 in “[BUG REPORT] git fetch --prefetch with incorrect options hangs with 2.47.0”
  1. Eric MillsNov 11, 2024
  2. Jeff KingNov 12, 2024
  3. 0/3 double-free with git fetch --prefetchJeff King, Nov 12, 2024
  4. 1/3 fetch: adjust refspec->raw_nr when filtering prefetch refspecsJeff King, Nov 12, 2024
  5. 2/3 refspec: drop separate raw_nr countJeff King, Nov 12, 2024
  6. 3/3 refspec: store raw refspecs inside refspec_itemJeff King, Nov 12, 2024
  7. Junio C HamanoNov 12, 2024

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.