Re: [PATCH v8] status: modernize git-status "slow untracked files" advice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 22, 2022 at 5:07 PM Rudy Rigot via GitGitGadget
<gitgitgadget@xxxxxxxxx> wrote:
> `git status` can be slow when there are a large number of
> untracked files and directories since Git must search the entire
> worktree to enumerate them.  When it is too slow, Git prints
> advice with the elapsed search time and a suggestion to disable
> the search using the `-uno` option.  This suggestion also carries
> a warning that might scare off some users.
>
> However, these days, `-uno` isn't the only option.  Git can reduce
> the size and time of the untracked file search when the
> `core.untrackedCache` and `core.fsmonitor` features are enabled by
> caching results from previous `git status` invocations.
>
> Therefore, update the `git status` man page to explain the various
> configuration options, and update the advice to provide more
> detail about the current configuration and to refer to the updated
> documentation.
>
> Signed-off-by: Rudy Rigot <rudy.rigot@xxxxxxxxx>
> ---
>     Changes since v7:
>
>      * Moved tests from new test script to existing one, in order not to
>        needlessly waste a test script number for such a small feature. Two
>        caveats:
>        * The use of test_config in a subshell result in: 'error: bug in the
>          test script: test_when_finished does nothing in a subshell', so
>          I've had to resort to using plain old git config instead.

Sorry, I should have thought of this when making suggestions in my
earlier reviews. For completeness, in case you run across this sort of
issue again if submitting patches in the future, it is possible to get
this working by using the -C option (change to directory) with
test_config() outside of the subshell. For instance:

    test_expect_sucess 'some title' '
        test_config -C slowstatus core.untrackedCache false &&
        test_config -C slowstatus core.fsmonitor false &&
        (
            cd slowstatus &&
            GIT_TEST_UF_DELAY_WARNING=1 git status >out &&
            ...
        )
    '



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux