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

git-p4: default behavior for handling moves?

From
Luke Diamand <luke@diamand.org>
Date
Jan 7, 2019, 12:50 UTC
Message-ID
<CAE5ih7987J2WXdCJvs2e3hOn3zucpE6gsr4JJtxO+XE5=K2G_Q@mail.gmail.com>

git-p4 can map a "git move" operation to a Perforce "move" operation. But by default this is disabled. You then end up with a P4 commit where the file is deleted, and a fresh file is created with the same contents at the new location at revision #1.

Rename detection gets enabled either with the "-M" option, or with some config variables, git-p4.detectCopies and git-p4.detectRenames.

I've been tripped up by this, and I actually know about it, and I know other people have been as well.

Should we switch the default over so that it's enabled by default? I can't think of any reason why you wouldn't want it enabled.

I think the rename code was first introduced around 2011 by Vitor.
Another option is to add a warning, but people just ignore warnings!

Thanks! Luke

Next: Mazo, Andrey
Message 1 of 3 in “git-p4: default behavior for handling moves?”
  1. Luke DiamandJan 7, 2019
  2. Mazo, AndreyJan 8, 2019
  3. Vitor AntunesJan 9, 2019

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.