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

Re: [PATCH 2/2] fsmonitor: Store fsmonitor bitmap before splitting index

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 10, 2017, 05:11 UTC
Message-ID
<xmqqvaiig1ki.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<4ff73be656d5bbf9e2cada6bdec61843da9d1516.1510257457.git.alexmv@dropbox.com>
Alex Vandiver <alexmv@dropbox.com> writes:
> ba1b9caca6 resolved the problem of the fsmonitor data being applied to
(from SubmittingPatches)

If you want to reference a previous commit in the history of a stable branch, use the format "abbreviated sha1 (subject, date)", with the subject enclosed in a pair of double-quotes, like this:

    Commit f86a374 ("pack-bitmap.c: fix a memleak", 2015-03-30)
    noticed that ...

The "Copy commit summary" command of gitk can be used to obtain this format, or this invocation of "git show":

    git show -s --date=short --pretty='format:%h ("%s", %ad)' <commit>
Show 6 quoted lines
> the non-base index when reading; however, a similar problem exists
> when writing the index.  Specifically, writing of the fsmonitor
> extension happens only after the work to split the index has been
> applied -- as such, the information in the index is only for the
> non-"base" index, and thus the extension information contains only
> partial data.

So... what's the effect of not applying this change? Do we miss paths that are known to the watchman to have been modified and end up not adding them if we do "git add -u"? Or do we miss paths that are known to the watchman to be clean but mistakenly think are dirty, and spend unnecessary cycles? IOW, is this fixing a correctness issue, or a performance one?

Show 5 quoted lines
> When saving, compute the ewah bitmap before the index is split, and
> store it in the fsmonitor_dirty field, mirroring the behavior that
> occurred during reading.  fsmonitor_dirty is kept from being leaked by
> being freed when the extension data is written -- which always happens
> precisely once, no matter the split index configuration.

The observation and the approach stated to fix both sounds sensible. I'll queue this too, awaiting for Ben's review.

Thanks.
Previous: Alex VandiverNext: Ben Peart
Message 3 of 9 in “fsmonitor: Stop reading from PWD, write fsmonitor+split index right”
  1. 0/2 fsmonitor: Stop reading from PWD, write fsmonitor+split index rightAlex Vandiver, Nov 9, 2017
  2. 2/2 fsmonitor: Store fsmonitor bitmap before splitting indexAlex Vandiver, Nov 9, 2017
  3. Junio C HamanoNov 10, 2017
  4. Ben PeartNov 13, 2017
  5. Alex VandiverDec 16, 2017
  6. 1/2 fsmonitor: Read from getcwd(), not the PWD environment variableAlex Vandiver, Nov 9, 2017
  7. Junio C HamanoNov 10, 2017
  8. fsmonitor: simplify determining the git worktree under WindowsBen Peart, Nov 10, 2017
  9. Junio C HamanoNov 13, 2017

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.