Thread (1 message) 1 message, 1 author, 2017-11-13

Re: [PATCH v1] fsmonitor: simplify determining the git worktree under Windows

From: Junio C Hamano <hidden>
Date: 2017-11-13 01:02:23

Ben Peart [off-list ref] 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 <redacted>
Signed-off-by: Johannes Schindelin <redacted>
---
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();
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help