git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Sun, 13 May 2012 23:58:41 +0100	[thread overview]
Message-ID: <4FB03CA1.4030703@ramsay1.demon.co.uk> (raw)
In-Reply-To: <CAAXzdLXbYp5YW9cZXxmRJk0MP=6PU897f4nuTe4ipLqk+EH9PQ@mail.gmail.com>

Steven Penny wrote:
> Ramsay Jones wrote:
>> I would rather define a script; it can then be used independently of git.
> 
> So your suggestion is to have git-sh-setup.sh account for MinGW, which is its
> current state, but not account for Cygwin?

I wasn't specifically suggesting that no; I was suggesting that I prefer to
fix the problem with a script on cygwin. (Again, the script can be used
independently of git)

BTW, Johannes, earlier you said commit be39048 ("git-sh-setup.sh: Add an pwd()
function for MinGW", 17-04-2012) would fix the problem on MinGW; I'm not so
sure it will. I haven't actually tested it, so don't take my word for it. ;-P
(See below for an explanation of my doubts)

>> Personally, I don't have this specific problem because I use (the cygwin
>> version of) vim. (does anybody actually use notepad?)
> 
> If you had read carefully, you would have noticed that I mentioned more than
> notepad. As well Notepad2, and Notepad++, etc.

Yes, I did notice that you mentioned more than 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 ...
> 
> This convo is not about what tools _you_ use, but about the current
> incompatibility with several native windows text editors.

OK.

So, yes, I didn't give your patch a look; sorry about that. Let's take a look
now (quoting from earlier email):

> 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 haven't actually tried to apply or test your patch, so take the
following with a pinch of salt ...

I don't think this will work because:

    - cygpath is not a bash builtin, so bash *should* simply issue
      an error something along the lines of "not a shell builtin".

    - cygpath requires an input path

So, I would have expected the body of the pwd function to be something like:

    cygpath -m "$PWD"

or maybe

    cygpath -m "$(builtin pwd)"

(Again, I'm just typing into my mail client, so not tested ...)

Also note that the MinGW pwd() uses a shell builtin and so, unlike the above,
does not suffer any fork+exec overhead.

If we fix the above, then another problem (*which MinGW shares*) is that the
pwd() function is defined *after* the code that sets $GIT_DIR from which the
rebase state directory name is derived (see git-sh-setup.sh lines 223-239).

Note that cygwin git will create the various inputs (commit template say) with
lf only line endings; so the windows text editor you use must be able to cope
with such an input. (I think the PSEdit editor will cope just fine).

Similar comments apply to all other external programs launched by git (for
example, external diff/merge tools, clean/smudge filters ...).

HTH

ATB,
Ramsay Jones

  reply	other threads:[~2012-05-13 23:01 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
2012-05-11  4:35                   ` Steven Penny
2012-05-13 22:58                     ` Ramsay Jones [this message]
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=4FB03CA1.4030703@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).