git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v6] git-p4: Obey core.ignorecase when using P4 client specs.

From
Lars Schneider <larsxschneider@gmail.com>
Date
Aug 26, 2015, 21:25 UTC
Message-ID
<4CB47914-F04C-4E88-8D73-E00AFEFEF727@gmail.com>
In-Reply-To
<xmqqa8td3je7.fsf@gitster.dls.corp.google.com>
On 26 Aug 2015, at 22:05, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> larsxschneider@gmail.com writes:
> 
>> From: Lars Schneider <larsxschneider@gmail.com>
>> 
>> We run P4 servers on Linux and P4 clients on Windows. For an unknown
>> reason the file path for a number of files in P4 does not match the
>> directory path with respect to case sensitivity.
> 
> Thanks, but is this still "For an unknown reason", or during the
> course of debugging you found the root cause, which is what led to
> this fix?
We are migrating away from P4 and therefore I haven’t debugged the root cause. The source of this problem is 100% P4 related. No Git involvement at all. Maybe I just remove this paragraph?
Show 18 quoted lines
> 
>> 
>> E.g. "p4 files" might return
>> //depot/path/to/file1
>> //depot/pATH/to/file2
>> 
>> If you use P4/P4V then these files end up in the same directory, e.g.
>> //depot/path/to/file1
>> //depot/path/to/file2
>> 
>> If you use git-p4 and clone the code via client spec "//depot/path/..."
>> then all files not matching the case in the client spec will be ignored
>> (in the example above "file2"). This is correct if core.ignorecase=false
>> but not otherwise.
> 
> This sentence is hard to grok.  What are you describing?  Solution?
> Current problematic behaviour?  Desired behaviour that the patch
> attempts to obtain?
I tried to describe the situation that causes the strange behavior.
Show 11 quoted lines
> 
> If I paraphrase it like this, did I understood you correctly?
> 
>    The current code always ignores paths in wrong case that do not
>    match client spec.  It is correct to ignore them when
>    core.ignorecase is not set; //depot/path/ and //depot/pATH/ are
>    different things in that case.
> 
>    But it is a wrong thing to do if core.ignorecase is set to true.
>    Let's make sure we avoid it by downcasing the depot_path when
>    core.ignorecase is set to true.
How about this:

----------------- The current code always ignores files with paths that do not match the case of the paths defined in the client spec. This commit changes this behavior and obeys these files if “core.ignorecase” is set to "true”.

Example: A P4 repository contains the following files: //depot/path/to/file1 //depot/pATH/to/file2

The P4 repository is cloned with git-p4 and the following client spec view: //depot/path/… //client/...

The cloned Git repository will contain only the following file: to/file1

“file2” is not present in the cloned Git repository. If “core.ignorecase" is set to “true” then path case sensitivity is ignored and “file2” will be present. ————————

Thanks, Lars

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “git-p4: Obey core.ignorecase when using P4 client specs.”
  1. git-p4: Obey core.ignorecase when using P4 client specs.larsxschneider@gmail.com, Aug 26, 2015
  2. Junio C HamanoAug 26, 2015
  3. Lars SchneiderAug 26, 2015
  4. Junio C HamanoAug 26, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.