]> git.ipfire.org Git - thirdparty/git.git/commit
git-p4: recover from inconsistent perforce history
authorAndrew Oakley <andrew@adoakley.name>
Sun, 10 May 2020 10:16:50 +0000 (11:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 10 May 2020 16:58:50 +0000 (09:58 -0700)
commit82e46d6b837e96de5ee01f0298b600519aef1bba
tree1e409211ad8ff63845f799f9a6f92d9bcc9df5dd
parentb994622632154fc3b17fb40a38819ad954a5fb88
git-p4: recover from inconsistent perforce history

Perforce allows you commit files and directories with the same name,
so you could have files //depot/foo and //depot/foo/bar both checked
in.  A p4 sync of a repository in this state fails.  Deleting one of
the files recovers the repository.

When this happens we want git-p4 to recover in the same way as
perforce.

Note that Perforce has this change in their 2017.1 version:

     Bugs fixed in 2017.1
     #1489051 (Job #2170) **
        Submitting a file with the same name as an existing depot
        directory path (or vice versa) will now be rejected.

so people hopefully will not creating damaged Perforce repos
anymore, but "git p4" needs to be able to interact with already
corrupt ones.

Signed-off-by: Andrew Oakley <andrew@adoakley.name>
Reviewed-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-p4.py
t/t9834-git-p4-file-dir-bug.sh [new file with mode: 0755]