git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Luke Diamand <luke@diamand.org>
To: Lex Spoon <lex@lexspoon.org>
Cc: Git Users <git@vger.kernel.org>, Pete Wyckoff <pw@padd.com>,
	FusionX86 <fusionx86@gmail.com>,
	Vitor Antunes <vitor.hda@gmail.com>
Subject: Re: [PATCH] git-p4: add failing tests for case-folding p4d
Date: Wed, 29 Apr 2015 09:19:43 +0100	[thread overview]
Message-ID: <5540941F.9090507@diamand.org> (raw)
In-Reply-To: <CALM2Sna0OqxYWzEj94SY61ZsL8cB+SyuiJ0EsAzq+kbiw87QLQ@mail.gmail.com>

(Adding Pete, Vitor, and Fusion in case they have any thoughts on 
working with P4 servers that do case-folding, or at least failing 
gracefully).

On 29/04/15 00:01, Lex Spoon wrote:
> The last comment in the test took me a minute to decipher. I would
> suggest "no repo path called LC" instead of "no repo called LC". Also,
> it would have helped me to either have a little comment on the "UC"
> version of the test, or to make the previous comment a little more
> neutral so that it will apply to both test cases.

OK, thanks!

>
> Otherwise, while I am not a regular maintainer of this code, the patch
> does LGTM. Certainly it's good to have more test coverage.
>
> For the underlying problem, I haven't thought about it very much, but
> it looks like a plausible first step might be to simply probe the
> given file name and see if it comes back the same way. If it comes
> back differently, then maybe the command should abort?

I think the problem may be a bit trickier than that.

I think what's happening when cloning is that when files come back from 
the server, git-p4 checks that they are contained within the directory 
it is cloning. This happens in p4StartsWith(), (called from 
extractFilesFromCommit()) which already tries to fix this problem by 
checking 'core.ignorecase'. However, that won't work if the local 
machine is case sensitive but the server isn't (e.g. Linux client, 
Windows server).

git-p4 does this because it's fetching *commits* from Perforce, and a 
commit might have files that are outside the directory being cloned.

I tried teaching p4StartsWith() to ask the server if it is case-folding 
('p4 info') and that then means that the git-p4 clone actually succeeds. 
However, git-p4 submit then fails because it gets terribly confused 
about pathnames - it probably needs to do some lowercasing somewhere. So 
that might be worth pursuing.

Open to other suggestions though!

>
>
> What a tough problem all around...

Indeed!

Luke

  reply	other threads:[~2015-04-29  8:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28  9:08 [PATCH] git-p4: add failing tests for case-folding in p4d Luke Diamand
2015-04-28  9:08 ` [PATCH] git-p4: add failing tests for case-folding p4d Luke Diamand
2015-04-28 23:01   ` Lex Spoon
2015-04-29  8:19     ` Luke Diamand [this message]
2015-04-28  9:19 ` [PATCH] git-p4: add failing tests for case-folding in p4d Luke Diamand

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5540941F.9090507@diamand.org \
    --to=luke@diamand.org \
    --cc=fusionx86@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=lex@lexspoon.org \
    --cc=pw@padd.com \
    --cc=vitor.hda@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).