From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Steven Penny <svnpenn@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Johannes Sixt <j.sixt@viscovery.net>,
git@vger.kernel.org
Subject: Re: Git commit path vs rebase path
Date: Thu, 10 May 2012 19:10:02 +0100 [thread overview]
Message-ID: <4FAC047A.4010001@ramsay1.demon.co.uk> (raw)
In-Reply-To: <CAAXzdLVj0szCgpdOSdhnLdkBKAM+e6vrQpvrsz4HeUo+Nh1K6A@mail.gmail.com>
Steven Penny wrote:
> Junio C Hamano wrote:
>> Actually, the above is stated rather poorly. The path that ends up in
>> $file must be usable by both Windows native and Cygwin programs, as the
>> user may be using "vi" from Cygwin, or "notepad" like your example.
>
> Excellent point.
>
> I ran some test and this is what I came up with
>
> # VI
> /cygdrive/c/test/hello.sh # works
> C:\test\hello.sh # works
> C:/test/hello/sh # works
>
> # NOTEPAD
> /cygdrive/c/test/hello.sh # does not work
> C:\test\hello.sh # works
> C:/test/hello.sh # works
>
> so the best compromise would be "C:/test/hello.sh" which can be created with
>
> diff --git a/git-sh-setup.sh b/git-sh-setup.sh
> index 7b3ae75..ba198d2 100644
> --- a/git-sh-setup.sh
> +++ b/git-sh-setup.sh
> @@ -260,6 +260,11 @@ case $(uname -s) in
> return 1
> }
> ;;
> +*CYGWIN*)
> + pwd () {
> + builtin cygpath -m
> + }
> + ;;
> *)
> is_absolute_path () {
> case "$1" in
>
> http://github.com/svnpenn/git/commit/692bc
I would rather define a script; it can then be used independently of git.
Personally, I don't have this specific problem because I use (the cygwin
version of) vim. (does anybody actually use notepad?)
I mostly, but not exclusively, use cygwin tools on cygwin. For example I
use win32 versions of doxygen, ghostscript, tex (MikTex 2.7), graphviz etc.
However, the makefiles which drive those tools use relative paths ...
In fact the only problem I have encountered is with firefox, which I
resolved by hacking up a script. Indeed I have already posted to the
list on this issue before (back in January 2009) and, to save you the
effort of trawling the archives, I append that mail below.
HTH
ATB,
Ramsay Jones
-- >8 --
Date: Sat, 24 Jan 2009 18:51:23 +0000
From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: =?ISO-8859-1?Q?Bj=F6rn_Steinbrink?= <B.Steinbrink@gmx.de>
CC: Junio C Hamano <gitster@pobox.com>, jaeckel@stzedn.de,
git@vger.kernel.org
Subject: Re: [PATCH] cygwin: Convert paths for html help from posix to windows
Björn Steinbrink wrote:
> When using "git help --web" with cygwin, we used to pass the posix path
> to the browser, but a native windows browser will expect a windows path
> and is unable to make use of the given path.
>
> So the cygwin port gets its own open_html implementation that handles
> the path conversion.
>
> Reported-by: Steffen Jaeckel <jaeckel@stzedn.de>
> Tested-by: Steffen Jaeckel <jaeckel@stzedn.de>
>
> Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
> ---
> OK, I don't really know if this is the right way to do it. Maybe when
> the browser was built for cygwin this breaks? I have no clue, it's
> admittedly just the result of a quick glance at the code and some
> googling to find the "right" cygwin function... :-/
>
Hi Björn,
I had the same problem. However, rather than modifying git, I created a
firefox wrapper script (in ~/bin) which used the cygpath command line
tool to do the path conversion. Also, if you use "git instaweb", you
also need to filter out http URLs and pass them through un-molested
by cygpath (it turns http://localhost into http:\localhost).
My script is clearly a "quick hack" just to get something working for
me, but you may find it useful as a starting point for your own
("proper" ;-) script, so I've included it below.
HTH,
Ramsay Jones
-->8--
#!/bin/sh
#
while test $# != 0
do
case "$1" in
-version)
echo "firefox 1.5.0.2"
exit 0
;;
-new-tab)
echo "-new-tab not supported"
exit 1
;;
--)
shift
break
;;
-*)
echo "option '$1' not supported"
exit 1
;;
*)
break
;;
esac
shift
done
if test "$1" = ""
then
p=
else
case "$1" in
http*)
p="$1"
;;
*)
p="$(cygpath -w "$1")"
;;
esac
fi
"/cygdrive/c/Program Files/Mozilla Firefox/firefox.exe" "$p"
exit 0
-- 8< --
next prev parent reply other threads:[~2012-05-10 18:11 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-06 4:24 Git commit path vs rebase path Steven Penny
2012-05-07 17:27 ` Junio C Hamano
2012-05-08 6:22 ` Johannes Sixt
2012-05-08 6:44 ` Steven Penny
2012-05-08 7:06 ` Johannes Sixt
2012-05-08 7:11 ` Steven Penny
2012-05-08 17:02 ` Junio C Hamano
2012-05-08 17:25 ` Junio C Hamano
2012-05-08 22:47 ` Steven Penny
2012-05-09 21:54 ` Junio C Hamano
2012-05-09 23:14 ` Steven Penny
2012-05-10 18:10 ` Ramsay Jones [this message]
2012-05-11 4:35 ` Steven Penny
2012-05-13 22:58 ` Ramsay Jones
2012-05-13 23:42 ` Steven Penny
2012-05-14 6:02 ` Johannes Sixt
2012-05-15 17:32 ` Ramsay Jones
2012-05-16 5:52 ` Johannes Sixt
2012-05-17 18:30 ` Ramsay Jones
2012-05-17 19:19 ` Junio C Hamano
2012-05-16 18:00 ` [PATCH 0/2] " Junio C Hamano
2012-05-16 18:00 ` [PATCH 1/2] git-sh-setup: define workaround wrappers before they are used Junio C Hamano
2012-05-17 22:36 ` Ramsay Jones
2012-05-16 18:00 ` [PATCH 2/2] git-sh-setup: work around Cygwin path handling gotchas Junio C Hamano
2012-05-16 18:51 ` Steven Penny
2012-05-16 19:02 ` Junio C Hamano
2012-05-17 23:15 ` Ramsay Jones
2012-05-18 2:34 ` Junio C Hamano
2012-05-19 0:43 ` Steven Penny
2012-05-21 18:43 ` Ramsay Jones
2012-05-21 22:24 ` Junio C Hamano
2012-05-24 18:27 ` Ramsay Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FAC047A.4010001@ramsay1.demon.co.uk \
--to=ramsay@ramsay1.demon.co.uk \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
--cc=svnpenn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.