glandium / git-cinnabar

git remote helper to interact with mercurial repositories
GNU General Public License v2.0
290 stars 61 forks source link

git command for "hg copy"? #97

Open timdream opened 7 years ago

timdream commented 7 years ago

From time to time I see reviewer asks people to "use hg copy" to preserve file copying history. I wonder how do to that if we are using git-cinnabar & git-mozreview locally?

glandium commented 7 years ago

For now, you can do that in two steps: write a patch that moves the file (and change the corresponding build system stuff), and a second patch that does changes after that.

glandium commented 7 years ago

Also note this is related to issue #10.

ayg commented 7 years ago

The workaround doesn't work if the new file isn't functional in the new location, e.g., porting a test between .html and .xul or from mochitest to wpt. It would be desirable to preserve the history in these cases, and reviewers might reasonably insist on it. It also makes the diff more readable.

ayg commented 7 years ago

The workaround I used that actually worked is to just import into an hg repo. :( Fortunately I do know enough basic hg commands to import a patch from git and submit it to MozReview.