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

Re: [PATCH 1/2] revision: use repository from rev_info when parsing commits

From
Derrick Stolee <stolee@gmail.com>
Date
Sep 4, 2020, 12:19 UTC
Message-ID
<181e95c7-8b43-e548-7fc9-36fca140645d@gmail.com>
In-Reply-To
<xmqqzh667ca4.fsf@gitster.c.googlers.com>
On 9/3/2020 5:58 PM, Junio C Hamano wrote:
Show 30 quoted lines
> Derrick Stolee <stolee@gmail.com> writes:
> 
>> On 6/23/2020 4:56 PM, Michael Forney wrote:
>>> This is needed when repo_init_revisions() is called with a repository
>>> that is not the_repository to ensure appropriate repository is used
>>> in repo_parse_commit_internal(). If the wrong repository is used,
>>> a fatal error is the commit-graph machinery occurs:
>>>
>>>   fatal: invalid commit position. commit-graph is likely corrupt
>>>
>>> Since revision.c was the only user of the parse_commit_gently
>>> compatibility define, remove it from commit.h.
>>
>> Is this demonstrable in a test case, to prevent regressions?
> 
> It appears that Michael tried and failed.  Even if we do not
> currently have a caller that asks these functions in revision.c to
> work on a repository that is not the primary one (i.e. in a
> submodule), in which case these patches may not be fixing any bug
> that can be triggered in the current code, it is quite obvious that
> these functions misbehave once a caller starts asking them to work
> on a repository other than the primary one.
> 
> So, given that ... 
> 
>>
>> I counted 9 copies of parse_commit[_gently]() in my version
>> of revision.c, so it looks like you caught them all.
> 
> ... we should be able to proceed with the code as-is, I guess
Yes, I think this is an improvement regardless.
Thanks, for the reminder.
-Stolee
Previous: Junio C Hamano
Message 10 of 10 in “revision: use repository from rev_info when parsing commits”
  1. 1/2 revision: use repository from rev_info when parsing commitsMichael Forney, Jun 23, 2020
  2. 2/2 submodule: use submodule repository when preparing summaryMichael Forney, Jun 23, 2020
  3. Derrick StoleeJun 24, 2020
  4. Junio C HamanoJun 24, 2020
  5. Michael ForneyJun 30, 2020
  6. Michael ForneyAug 13, 2020
  7. Eric SunshineJun 23, 2020
  8. Derrick StoleeJun 24, 2020
  9. Junio C HamanoSep 3, 2020
  10. Derrick StoleeSep 4, 2020

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.