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

Incremental use of fast-import may cause conflicting notes

From
Henrik Grubbström <grubba@grubba.org>
Date
Nov 23, 2011, 12:09 UTC
Message-ID
<Pine.GSO.4.63.1111231137350.5099@shipon.roxen.com>
Hi.
Background: I have an incremental repository-walker creating a 
corresponding documentation repository from a source repository
that uses git-notes to store its state, a use for which notes
seem very suitable.
Problem: When the number of notes in the root of the notes branch
increases beyond a threshold, fast-import changes the fanout. This 
is as designed, but the problem is that when fast-import is restarted
it won't remember the fanout, and will start writing files in the root 
again. This means that there may be multiple notes-files for the same 
commit, eg both de/adbeef and deadbeef.

This is not what the user expects, and is not good practice, even if it in this case actually works, since the latter is defined to have priority. I'm however not sure if eg fast_import.c:do_change_note_fanout() will do the right thing if/when the fanout is changed again.

The problem is probably due to b->num_notes not being initialized properly when the old non-empty root commit for the notes branch is loaded in parse_from()/parse_new_commit().

My workaround for now is to use filedeleteall and restore all the notes by hand in the first new commit on the notes branch.

Version of git: 1.7.6.4 (gentoo)
Thanks,

-- Henrik Grubbström grubba@grubba.org Roxen Internet Software AB grubba@roxen.com

Next: Henrik Grubbström
Message 1 of 7 in “Incremental use of fast-import may cause conflicting notes”
  1. Henrik GrubbströmNov 23, 2011
  2. Henrik GrubbströmNov 23, 2011
  3. Jonathan NiederNov 24, 2011
  4. 0/3 fast-import: Fix incremental use of notesJohan Herland, Nov 25, 2011
  5. 1/3 t9301: Fix testcase covering up a bug in fast-import's notes fanout handlingJohan Herland, Nov 25, 2011
  6. 2/3 t9301: Add 2nd testcase exposing bugs in fast-import's notes fanout handlingJohan Herland, Nov 25, 2011
  7. 3/3 fast-import: Fix incorrect fanout level when modifying existing notes refsJohan Herland, Nov 25, 2011

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.