Re: [PATCH] fsmonitor: long status advice adapted to the fsmonitor use case
- From
- Jeff Hostetler <git@jeffhostetler.com>
- Date
- Oct 20, 2022, 12:56 UTC
- Message-ID
- <d696b07f-cfa9-be45-b6d2-adb72811a205@jeffhostetler.com>
- In-Reply-To
- <CANaDLWKcF07=FQgT7ZTKmcgworH45YdNy8hy2faMBg3CGYEf+w@mail.gmail.com>
On 10/17/22 12:59 PM, Rudy Rigot wrote:
Show 15 quoted lines
>> We should be careful here, FSMonitor only helps with untracked > files if the untracked cache (UC) is also turned on. They do work > well together and they greatly speed up things, but if either is > turned off, `git status` will still need to scan. > > Oh, thanks, I didn't realize! With that, I agree that the messaging I'm > proposing is not technically correct, and needs to be fixed. > > I agree with your advice about the message when FSMonitor and > untracked cache are both turned off. I'm also trying to think about > what advice to give when they are turned on, and git status was > slow because the update-index was building the cache on that call. > > Importantly, I'm trying to think of ways to keep the messaging > accessible even when the user is not familiar with those concepts.
Agreed. We sometimes forget that not everyone is an expert in the subtleties and terms of Git. Even the original message "...enumerate untracked files..." can be a little obscure to the casual user.
Show 39 quoted lines
> I'm thinking a user may not even know what is currently enabled or > not in their environment, so there's probably value in detecting their > situation, and best adapting the messaging to it. > > For context, in our case, we set core.fsmonitor and core.untrackedCache > as part of our dev environment setup script, because we don't expect > our least advanced developers to ramp up on what they are. And yet, > it is useful to all of them to have them enabled, our git status is about > 30 seconds long without FSMonitor and UC. > > As a result, we have been receiving negative feedback that git status is > slow, but when we inform the user that it is cached, they run it again and > confirm that it is fine like this. The problem being about educating > users and not a technical issue, of course we're adding the info to our > setup doc, but I figured other large repos may hit this usability issue, so > here I am. > > What do you think of those phrasings? > > - If neither FSMonitor nor the untracked cache are turned on, changing > the current advice to: "It took %.2f seconds to enumerate untracked files. > You may want to skip that part with 'status -uno' but you have to be > careful not to forget to add new files yourself (see 'git help status'). > Otherwise, you can enable the core.untrackedCache config to have > it be cached, and potentially the core.fsmonitor config to further improve > the cache's performance." > > - If only the untracked cache is turned on, since you said it could already > improve some: "It took %.2f seconds to enumerate untracked files. > Your untracked cache is enabled, but you may want to enable the > core.fsmonitor config to further improve the cache's performance. > Otherwise, you may want to skip that part with 'status -uno' but you have > to be careful not to forget to add new files yourself (see 'git help status')." > > - If they're both turned on: "It took %.2f seconds to enumerate untracked > files. Your untracked cache is enabled and fsmonitor is on, > so your next calls may be faster. Otherwise, you may want to skip that part > with 'status -uno' but you have to be careful not to forget to add new > files yourself (see 'git help status')."
All three of these are a bit wordy and/or awkward -- but I'm not sure how to say it either, so don't feel bad. I think it is just the quality of the corner that we've been backed into -- there are just too many knobs and not enough space to do them justice. And I've always found the "turn this on, but be careful..." advice/warning a bit odd.
As an alternative, and definitely just thinking out loud here.
Would it be better to add a "Untracked Files and Status Speed" section to the bottom of https://git-scm.com/docs/git-status (aka `Documentation/git-status.txt`) near https://git-scm.com/docs/git-status#_background_refresh
Describe the various combination of config options in more detail and discuss the pros/cons of each, what the defaults are, and how to set them, how to tell what they are currently set to, and so on.
Then have the advice message reference that new section.
We might also reword the large paragraph ("When `-u` option is not...") in the `--untracked-files` argument to reference the new section. It is a little stale and just as awkward.
Just a thought...
Jeff