threads / discuss / 54534

git-gui: How to configure for use in gigantic projects?

Subject: git-gui: How to configure for use in gigantic projects?

## tl;dr

5 messages between Oct 30, 2020 and Oct 30, 2020.

replies: 4people: 4as markdown or json

Birger Skogeng Pedersen· Oct 30, 2020, 10:16 UTC · lore
Hi,

I would like to use git gui for a project. The problem is that the repository directory is really gigantic. Doing a scan (F5) takes a couple of minutes to finish.

I would like the scan to only focus on files that are specifically added to the index. In git I do this:

git config status.showUntrackedFiles no

git status will then only show status of files that I have specifically added. So git status completion is instant.

But this configuration appears to have no effect on git-gui. The scan is just as slow as before.

Anything I can do to make git-gui only scan files that are specifically added, and not look through the whole directory?

Konstantin Tokarev· Oct 30, 2020, 10:30 UTC · re: Birger Skogeng Pedersen · lore

Re: git-gui: How to configure for use in gigantic projects?

30.10.2020, 13:16, "Birger Skogeng Pedersen" <birger.sp@gmail.com>:
Show 19 quoted lines
> Hi,
>
> I would like to use git gui for a project. The problem is that the
> repository directory is really gigantic. Doing a scan (F5) takes a
> couple of minutes to finish.
>
> I would like the scan to only focus on files that are specifically
> added to the index. In git I do this:
>
> git config status.showUntrackedFiles no
>
> git status will then only show status of files that I have
> specifically added. So git status completion is instant.
>
> But this configuration appears to have no effect on git-gui. The scan
> is just as slow as before.
>
> Anything I can do to make git-gui only scan files that are
> specifically added, and not look through the whole directory?

FWIW, there are better ways to improve performance of git status without hiding untracked files (which are useful to see when new files are added):

* Add all uninteresting files and directories to .gitignore
* Use fast storage for git repository, e.g. NVME-based
* If your OS can handle filesystem cache efficiently (e.g., Linux) make sure 
there is enough of free RAM for caches and all repeated operations on
same files and directories will speed up dramatically
* If your OS cannot handle filesystem cache efficiently (e.g. Windows) consider
using different OS for development
* If overall performance is still not sufficient, consider using fsmonitor hook [1]
[1] https://github.blog/2018-04-05-git-217-released/#speeding-up-status-with-watchman

--  Regards, Konstantin

Pratyush Yadav· Oct 30, 2020, 10:58 UTC · re: Birger Skogeng Pedersen · lore

Re: git-gui: How to configure for use in gigantic projects?

Hi Birger,
On 30/10/20 11:16AM, Birger Skogeng Pedersen wrote:
Show 19 quoted lines
> Hi,
> 
> I would like to use git gui for a project. The problem is that the
> repository directory is really gigantic. Doing a scan (F5) takes a
> couple of minutes to finish.
> 
> I would like the scan to only focus on files that are specifically
> added to the index. In git I do this:
> 
> git config status.showUntrackedFiles no
> 
> git status will then only show status of files that I have
> specifically added. So git status completion is instant.
> 
> But this configuration appears to have no effect on git-gui. The scan
> is just as slow as before.
> 
> Anything I can do to make git-gui only scan files that are
> specifically added, and not look through the whole directory?

Uncheck "Show untracked files" in options. It is controlled by the config 'gui.displayuntracked'.

-- 
Regards,
Pratyush Yadav
Birger Skogeng Pedersen· Oct 30, 2020, 11:11 UTC · re: Pratyush Yadav · lore

Re: git-gui: How to configure for use in gigantic projects?

Ah, that one changed everything! Thank you Pratyush!
On Fri, Oct 30, 2020 at 11:59 AM Pratyush Yadav <me@yadavpratyush.com> wrote:
Show 30 quoted lines
>
> Hi Birger,
>
> On 30/10/20 11:16AM, Birger Skogeng Pedersen wrote:
> > Hi,
> >
> > I would like to use git gui for a project. The problem is that the
> > repository directory is really gigantic. Doing a scan (F5) takes a
> > couple of minutes to finish.
> >
> > I would like the scan to only focus on files that are specifically
> > added to the index. In git I do this:
> >
> > git config status.showUntrackedFiles no
> >
> > git status will then only show status of files that I have
> > specifically added. So git status completion is instant.
> >
> > But this configuration appears to have no effect on git-gui. The scan
> > is just as slow as before.
> >
> > Anything I can do to make git-gui only scan files that are
> > specifically added, and not look through the whole directory?
>
> Uncheck "Show untracked files" in options. It is controlled by the
> config 'gui.displayuntracked'.
>
> --
> Regards,
> Pratyush Yadav
Marc Branchaud· Oct 30, 2020, 14:06 UTC · re: Birger Skogeng Pedersen · lore

Re: git-gui: How to configure for use in gigantic projects?

On 2020-10-30 6:16 a.m., Birger Skogeng Pedersen wrote:
Show 5 quoted lines
> Hi,
> 
> I would like to use git gui for a project. The problem is that the
> repository directory is really gigantic. Doing a scan (F5) takes a
> couple of minutes to finish.

I've found that enabling Trust File Modification Time helps, at the cost of git-gui doing (very) occasional rescans when it notices that a file it thought was modified turns out to be unmodified. As Konstantin said, things generally improve once the initial scan primes the disk cache. YMMV.

The setting is in the Preferences, or "git config gui.trustmtime true".
		M.

← back to recent threads