Bug 49154 - patches uploaded from git (using webkit-patch) do not include moved files
Summary: patches uploaded from git (using webkit-patch) do not include moved files
Status: RESOLVED DUPLICATE of bug 48075
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 54854 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-11-07 19:57 PST by Eric Seidel (no email)
Modified: 2011-04-18 19:08 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2010-11-07 19:57:39 PST
patches uploaded from git (using webkit-patch) do not include moved files

I ran into this while trying to work on bug 49153.
Comment 1 Eric Seidel (no email) 2010-11-07 19:59:31 PST
The command we're using is:

    def create_patch(self, git_commit=None, changed_files=[]):
...
        return self.run(['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "-M", self.merge_base(git_commit), "--"] + changed_files, decode_output=False)

It's possible this is recently broken by Adam's changed_files optimization, but I think git diff just doesn't include moved files!
Comment 2 Eric Seidel (no email) 2010-11-07 20:00:45 PST
Maybe we should be using some other command to generate the git diff?
Comment 3 David Kilzer (:ddkilzer) 2010-11-07 20:17:57 PST
If there are no changes to the renamed (moved) file, the diff content is blank, but there is a diff header noting the rename does exist in the patch.  This differs from svn-create-patch, though, in that the (unchanged) contents of the file aren't included in the patch itself.
Comment 4 Eric Seidel (no email) 2011-02-16 21:00:35 PST
We seem to run into this a lot, but I'm not sure I have good suggestions as to how to fix.
Comment 5 David Kilzer (:ddkilzer) 2011-02-17 08:56:04 PST
(In reply to comment #4)
> We seem to run into this a lot, but I'm not sure I have good suggestions as to how to fix.

git detects renames through content only.  Is the real issue that committing the patch back to svn (via "git svn dcommit") doesn't represent the moved file like it would if "svn mv" were used?  If so, you may want to add this to the .git/config being used on the commit queue bots:

[diff]
	renames = true

If the bots are using an svn repo (not a git repo), then this issue becomes harder (unless everyone uses -M to make their patches so git includes "rename" metadata near the top of the patch.

This is completely orthogonal, but this should also be set (so that empty directories aren't left in svn by the bots):

[svn]
	rmdir = true
Comment 6 Eric Seidel (no email) 2011-02-17 12:48:15 PST
Sounds like we should definitely add those to the git config page.

However I don't think this is a commit-side problem.  It seems that the patches uploaded have no move information.  Or at least if they do I don't remember seeing it in prettypatch and it must be ignored by svn-apply (maybe that's what the diff.rename=true option fixes?).
Comment 7 Adam Roben (:aroben) 2011-02-17 12:55:02 PST
(In reply to comment #6)
> Sounds like we should definitely add those to the git config page.
> 
> However I don't think this is a commit-side problem.  It seems that the patches uploaded have no move information.  Or at least if they do I don't remember seeing it in prettypatch and it must be ignored by svn-apply (maybe that's what the diff.rename=true option fixes?).

PrettyPatch will show file moves Do you have an example where the wrong thing happened for us to look at?
Comment 8 Adam Barth 2011-02-17 12:56:25 PST
This might be a problem with the changed_files optimization.
Comment 9 Tony Chang 2011-02-22 11:35:39 PST
*** Bug 54854 has been marked as a duplicate of this bug. ***
Comment 10 Mihai Parparita 2011-02-25 11:36:43 PST
I don't know if it's related to this, but ChangeLogs generated by webkit-patch land-cowboy also don't list moved files correctly, but prepare-ChangeLog does.
Comment 11 Adam Barth 2011-02-25 14:22:16 PST
(In reply to comment #10)
> I don't know if it's related to this, but ChangeLogs generated by webkit-patch land-cowboy also don't list moved files correctly, but prepare-ChangeLog does.

That's likely to be the same bug.  The difference is we keep around a list of changed files, which we use to avoid stating the whole file system.  It seems likely that moved files aren't represented correctly in that list.
Comment 12 Eric Seidel (no email) 2011-04-18 19:08:21 PDT

*** This bug has been marked as a duplicate of bug 48075 ***