Re: [PATCH 1/4] fsmonitor: Watch, and ask about, the top of the repo, not the CWD
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 27, 2017, 15:11 UTC
- Message-ID
- <alpine.DEB.2.21.1.1710271709570.6482@virtualbox>
- In-Reply-To
- <alpine.DEB.2.10.1710251700300.9817@alexmv-linux>
Hi Alex,
On Wed, 25 Oct 2017, Alex Vandiver wrote:
Show 9 quoted lines
> On Fri, 20 Oct 2017, Johannes Schindelin wrote: > > This is super expensive, as it means a full-blown new process instead of > > just a simple environment variable expansion. > > > > The idea behind using `PWD` instead was that Git will already have done > > all of the work of figuring out the top-level directory and switched to > > there before calling the fsmonitor hook. > > I'm not seeing that PWD has been at all altered.
No, PWD is not altered.
But a simple environment variable expansion (fast) was replaced by spawning to `git rev-parse --show-top-level` (slow, ~60ms on Windows).
*That* is expensive.
Ciao, Johannes