{"thread":{"id":"30544","subject":"[PATCH] git-sh-setup: work around Cygwin path handling gotchas","startedAt":"2012-05-17T00:39:42Z","lastAt":"2012-05-17T00:39:42Z","messageCount":1,"participants":["Steven Penny"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"191616","messageId":"1337215182-4036-1-git-send-email-svnpenn@gmail.com","threadId":"30544","inReplyTo":null,"subject":"[PATCH] git-sh-setup: work around Cygwin path handling gotchas","fromName":"Steven Penny","fromEmail":"svnpenn@gmail.com","sentAt":"2012-05-17T00:39:42Z","receivedAt":"2012-05-17T00:39:42Z","isPatch":true,"sender":{"key":"svnpenn@gmail.com","avatar":"https://avatars.githubusercontent.com/u/60531334?v=4"},"body":"On Cygwin, tools built for Cygwin can take both Windows-style paths\n(e.g. C:/dir/file.txt or C:\\dir\\file.txt) and Cygwin-style paths\n(e.g. /cygdrive/c/dir/file.txt), but Windows-native tools can only take\nWindows-style paths.  Because the paths that are relative to $GIT_DIR,\ne.g. the name of the insn sheet file of the \"rebase -i\" command, are given\nto the programs with $GIT_DIR prefixed, and $GIT_DIR in turn is computed\nby calling \"pwd\", wrap \"pwd\" to call \"cygpath -m\" to give a Windows-style\npath, in a way similar to how mingw does this.\n\nSigned-off-by: Steven Penny <svnpenn@gmail.com>\n---\n git-sh-setup.sh |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/git-sh-setup.sh b/git-sh-setup.sh\nindex 7b3ae75..07f54c1 100644\n--- a/git-sh-setup.sh\n+++ b/git-sh-setup.sh\n@@ -260,6 +260,11 @@ case $(uname -s) in\n \t\treturn 1\n \t}\n \t;;\n+*CYGWIN*)\n+\tpwd () {\n+\t\tcygpath -m \"$PWD\"\n+\t}\n+\t;;\n *)\n \tis_absolute_path () {\n \t\tcase \"$1\" in\n-- \n1.7.9\n"}]}