From: Junio C Hamano Date: Mon, 13 Nov 2017 01:02:13 GMT Subject: Re: [PATCH v1] fsmonitor: simplify determining the git worktree under Windows Message-ID: In-Reply-To: <20171110210311.11036-1-benpeart@microsoft.com> Ben Peart 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. > > 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 > Signed-off-by: Johannes Schindelin > --- The patch looks reasonable ;-) Thanks. > +if ($^O =~ 'msys' || $^O =~ 'cygwin') { > + $git_work_tree = Win32::GetCwd(); > + $git_work_tree =~ tr/\\/\//; > } else { > require Cwd; > $git_work_tree = Cwd::cwd();