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

Re: [PATCHv4] sha1_file: fix iterating loose alternate objects

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 2, 2015, 19:35 UTC
Message-ID
<xmqqoapct8bl.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150202185049.GA27399@peff.net>
Jeff King <peff@peff.net> writes:
Show 21 quoted lines
> On Mon, Feb 02, 2015 at 10:48:12AM -0800, Jonathon Mah wrote:
>
>> The string in 'base' contains a path suffix to a specific object; when
>> its value is used, the suffix must either be filled (as in
>> stat_sha1_file, open_sha1_file, check_and_freshen_nonlocal) or cleared
>> (as in prepare_packed_git) to avoid junk at the end.  loose_from_alt_odb
>> (introduced in 660c889e46d185dc98ba78963528826728b0a55d) did neither and
>> treated 'base' as a complete path to the "base" object directory,
>> instead of a pointer to the "base" of the full path string.
>> 
>> The trailing path after 'base' is still initialized to NUL, hiding the
>> bug in some common cases.  Additionally the descendent
>> for_each_file_in_obj_subdir function swallows ENOENT, so an error only
>> shows if the alternate's path was last filled with a valid object
>> (where statting /path/to/existing/00/0bjectfile/00 fails).
>> 
>> Signed-off-by: Jonathon Mah <me@JonathonMah.com>
>> ---
>> Squashed test and fix.
>
> Thanks, this version looks good to me.
Thanks, both of you.
The analysis, the fix and the test all look reasonable.
Previous: Jeff KingNext: Junio C Hamano
Message 3 of 5 in “[PATCHv4] sha1_file: fix iterating loose alternate objects”
  1. Jonathon MahFeb 2, 2015
  2. Jeff KingFeb 2, 2015
  3. Junio C HamanoFeb 2, 2015
  4. Junio C HamanoFeb 2, 2015
  5. Jeff KingFeb 2, 2015

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.