Re: [PATCH v1] fsmonitor: simplify determining the git worktree under Windows
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 13, 2017, 01:02 UTC
- Message-ID
- <xmqqzi7rat4a.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20171110210311.11036-1-benpeart@microsoft.com>
Ben Peart <benpeart@microsoft.com> writes:
> I haven't tested the non Windows paths but the patch looks reasonable.
I do not think the above line part of the proposed log message for this patch ;-) I guess I'll strip these earlier parts and leave only the last paragraph while queuing.
Show 14 quoted lines
> > This inspired me to get someone more familiar with perl (thanks Johannes) > to revisit this code for the Windows side as well. The logic for > determining the git worktree when running on Windows is more complex > than necessary. It also spawns multiple processes (uname and cygpath) > which slows things down. > > Simplify and speed up the process of finding the git worktree when > running on Windows by keeping it in perl and avoiding spawning helper > processes. > > Signed-off-by: Ben Peart <benpeart@microsoft.com> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > ---
The patch looks reasonable ;-) Thanks.
Show 6 quoted lines
> +if ($^O =~ 'msys' || $^O =~ 'cygwin') {
> + $git_work_tree = Win32::GetCwd();
> + $git_work_tree =~ tr/\\/\//;
> } else {
> require Cwd;
> $git_work_tree = Cwd::cwd();