git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg@dewire.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Sixt <j6t@kdbg.org>, Thomas Rast <trast@student.ethz.ch>,
	git@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] Handle double slashes in make_relative_path()
Date: Mon, 25 Jan 2010 02:06:48 +0100	[thread overview]
Message-ID: <201001250206.48138.robin.rosenberg@dewire.com> (raw)
In-Reply-To: <7v8wbn8ie2.fsf@alter.siamese.dyndns.org>

söndagen den 24 januari 2010 19.31.01 skrev  Junio C Hamano:
> Johannes Sixt <j6t@kdbg.org> writes:
> > On Samstag, 23. Januar 2010, Johannes Sixt wrote:
> >> On Samstag, 23. Januar 2010, Junio C Hamano wrote:
> >> > What happens if you did this?
> >> >
> >> > 	git --git-dir=//git/repo/repo.git --work-tree=/git/repo
> >> >
> >> > where "//git/repo" is on the "git server" and you are working in local
> >> > hierarchy "/git/repo"?
> >>
> >> Ah, right, this would not do the right thing. (But I can't verify this
> >> claim right now.)
> >
> > I tested it, and it does the right thing. The reason is that before
> > setup_work_tree() calls make_relative_path(), the --work-tree argument
> > has been processed by make_absolute_path(), which adds the drive prefix.
> >
> > As long as setup_work_tree() remains the only caller of
> > make_relative_path(), we are safe.
> 
> Thanks; I think a more correct description of your findings is:
> 
>  - msysgit's make_absolute_path() does the right thing (i.e. adds "drive
>    prefix" to "git/repo" given to --work-tree); and
> 
>  - as long as the callers feed what the platform considers absolute paths
>    in abs and base, make_relative_path() does the right thing.
> 
> So I think we are Ok.  We _might_ want to add Windows-only test at the
> beginning of make_relative_path() to make sure that the both inputs have
> double-slashes at the beginning to catch future broken callers, but I
> think that is a separate topic, and we don't have to do that as long as
> setup_work_tree(0 remains the only caller, as you said.

Separate patch posted since this problem occurs in more than one place. 

-- robin

  reply	other threads:[~2010-01-25  1:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-22  0:07 [PATCH] Handle double slashes in make_relative_path() Thomas Rast
2010-01-22  1:40 ` Junio C Hamano
2010-01-22  3:05   ` Junio C Hamano
2010-01-22  8:36     ` Johannes Sixt
2010-01-23 11:40       ` Robin Rosenberg
2010-01-23 13:09         ` Johannes Sixt
2010-01-23 13:48           ` Robin Rosenberg
2010-01-23 19:00             ` Johannes Sixt
2010-01-23 20:04           ` Junio C Hamano
2010-01-23 20:14             ` Junio C Hamano
2010-01-23 20:41               ` Johannes Sixt
2010-01-23 21:01                 ` Sverre Rabbelier
2010-01-24 13:57                   ` Thomas Rast
2010-01-24 19:04                     ` Bernhard R. Link
2010-01-24 20:05                       ` Junio C Hamano
2010-01-24 16:44                 ` Johannes Sixt
2010-01-24 18:31                   ` Junio C Hamano
2010-01-25  1:06                     ` Robin Rosenberg [this message]
2010-01-22 21:11   ` Thomas Rast
2010-01-22 23:35     ` Junio C Hamano

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=201001250206.48138.robin.rosenberg@dewire.com \
    --to=robin.rosenberg@dewire.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=torvalds@linux-foundation.org \
    --cc=trast@student.ethz.ch \
    /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).