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

Re: [PATCH] fast-import: properly fanout notes when tree is imported

From
Johan Herland <johan@herland.net>
Date
Dec 19, 2016, 22:05 UTC
Message-ID
<CALKQrgepfK3Unk-pq4ZpU2EmoPg6u8KYPkgEAKU1F1D1N9WtqA@mail.gmail.com>
In-Reply-To
<20161219021212.15978-1-mh@glandium.org>
On Mon, Dec 19, 2016 at 3:12 AM, Mike Hommey <mh@glandium.org> wrote:
Show 24 quoted lines
> In typical uses of fast-import, trees are inherited from a parent
> commit. In that case, the tree_entry for the branch looks like:
>
>   .versions[1].sha1 = $some_sha1
>   .tree = <tree structure loaded from $some_sha1>
>
> However, when trees are imported, rather than inherited, that is not the
> case. One can import a tree with a filemodify command, replacing the
> root tree object.
>
> e.g.
>   "M 040000 $some_sha1 \n"
>
> In this case, the tree_entry for the branch looks like:
>
>   .versions[1].sha1 = $some_sha1
>   .tree = NULL
>
> When adding new notes with the notemodify command, do_change_note_fanout
> is called to get a notes count, and to do so, it loops over the
> tree_entry->tree, but doesn't do anything when the tree is NULL.
>
> In the latter case above, it means do_change_note_fanout thinks the tree
> contains no note, and new notes are added with no fanout.
s/note,/notes,/
Show 11 quoted lines
>
> Interestingly, do_change_note_fanout does check whether subdirectories
> have a NULL .tree, in which case it uses load_tree(). Which means the
> right behaviour happens when using the filemodify command to import
> subdirectories.
>
> This change makes do_change_note_fanount call load_tree() whenever the
> tree_entry it is given has no tree loaded, making all cases handled
> equally.
>
> Signed-off-by: Mike Hommey <mh@glandium.org>
Acked-by: Johan Herland <johan@herland.net>
Previous: Mike HommeyNext: Junio C Hamano
Message 2 of 8 in “fast-import: properly fanout notes when tree is imported”
  1. fast-import: properly fanout notes when tree is importedMike Hommey, Dec 19, 2016
  2. Johan HerlandDec 19, 2016
  3. Junio C HamanoDec 20, 2016
  4. Mike HommeyDec 20, 2016
  5. Junio C HamanoDec 20, 2016
  6. fast-import: properly fanout notes when tree is importedMike Hommey, Dec 20, 2016
  7. Mike HommeyDec 20, 2016
  8. Junio C HamanoDec 20, 2016

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.