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

Re: [PATCH] fast-import: Do less work when given "from" matches current branch head

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 9, 2015, 22:44 UTC
Message-ID
<xmqq7fq9uf1w.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150709223018.GA3403@glandium.org>
Mike Hommey <mh@glandium.org> writes:
Show 12 quoted lines
>> Does that mean the original code was doing a release that was
>> unnecessary?  Or does it mean this patch changes what happens on
>> that codepath, namely (1) leaking resource, and/or (2) keeping a
>> tree of the original 'b' that does not have anything to do with the
>> tree of 's', preventing the later lazy-load code from reading the
>> tree of 's' and instead of building on top of a wrong tree content?
>
> I guess the question is whether branch_tree.tree can be in a state that
> doesn't match that of branch_tree.versions[1].sha1. If not, then if s
> and b have the same branch_tree.versions[1].sha1 for some reason, then
> keeping the old branch_tree.tree makes no practical difference from
> resetting it. Except it skips the busy-work.

Perhaps my comment was misleading. I _think_ the state at the end of this function (i.e. the latter hunk you added to the function makes the above issue I raised go away). It just made me feel uneasy to leave branch_tree.tree and branch_tree.versions[] in an inconsistent state inside this function, while it calls a few helper functions (hence my comment on the fact that they do not seem to be affected by this inconsistency).

Previous: Mike HommeyNext: Junio C Hamano
Message 8 of 9 in “suboptimal behavior of fast-import in some cases with "from"”
  1. Mike HommeyJul 6, 2015
  2. Junio C HamanoJul 6, 2015
  3. Mike HommeyJul 9, 2015
  4. Mike HommeyJul 9, 2015
  5. fast-import: Do less work when given "from" matches current branch headMike Hommey, Jul 9, 2015
  6. Junio C HamanoJul 9, 2015
  7. Mike HommeyJul 9, 2015
  8. Junio C HamanoJul 9, 2015
  9. Junio C HamanoJul 9, 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.