git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 2/2] cygwin: Allow pushing to UNC paths

From
tboegi@web.de <tboegi@web.de>
Date
Jul 1, 2017, 12:50 UTC
Message-ID
<20170701125059.16210-1-tboegi@web.de>
In-Reply-To
<20170628162958.519-1-tboegi@web.de>
From: Torsten Bögershausen <tboegi@web.de>
 cygwin can use an UNC path like //server/share/repo
 $ cd //server/share/dir
 $ mkdir test
 $ cd test
 $ git init --bare
 However, when we try to push from a local Git repository to this repo,
 there is a problem: Git converts the leading "//" into a single "/".
 As cygwin handles an UNC path so well, Git can support them better:
 - Introduce cygwin_offset_1st_component() which keeps the leading "//",
   similar to what Git for Windows does.
 - Move CYGWIN out of the POSIX in the tests for path normalization in t0060.
---
 config.mak.uname      | 1 +
 git-compat-util.h     | 3 +++
 t/t0060-path-utils.sh | 2 ++
 3 files changed, 6 insertions(+)
diff --git a/config.mak.uname b/config.mak.uname
index adfb90b..551e465 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -184,6 +184,7 @@ ifeq ($(uname_O),Cygwin)
 	UNRELIABLE_FSTAT = UnfortunatelyYes
 	SPARSE_FLAGS = -isystem /usr/include/w32api -Wno-one-bit-signed-bitfield
 	OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
+	COMPAT_OBJS += compat/cygwin.o
 endif
 ifeq ($(uname_S),FreeBSD)
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 047172d..db9c22d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -189,6 +189,9 @@
 #include <sys/sysctl.h>
 #endif
 
+#if defined(__CYGWIN__)
+#include "compat/cygwin.h"
+#endif
 #if defined(__MINGW32__)
 /* pull in Windows compatibility stuff */
 #include "compat/mingw.h"
diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
index 444b5a4..7ea2bb5 100755
--- a/t/t0060-path-utils.sh
+++ b/t/t0060-path-utils.sh
@@ -70,6 +70,8 @@ ancestor() {
 case $(uname -s) in
 *MINGW*)
 	;;
+*CYGWIN*)
+	;;
 *)
 	test_set_prereq POSIX
 	;;
-- 
2.10.0
Previous: Junio C Hamano
Message 7 of 7 in “cygwin: Allow pushing to UNC paths”
  1. 1/1 cygwin: Allow pushing to UNC pathstboegi@web.de, Jun 28, 2017
  2. Junio C HamanoJun 28, 2017
  3. 1/2 Check DB_ENVIRONMENT using is_directory()tboegi@web.de, Jul 1, 2017
  4. Junio C HamanoJul 1, 2017
  5. 1/1 cygwin: Allow pushing to UNC pathstboegi@web.de, Jul 3, 2017
  6. Junio C HamanoJul 5, 2017
  7. 2/2 cygwin: Allow pushing to UNC pathstboegi@web.de, Jul 1, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.