Bug 57686 - webkit-patch post does not properly recognize renamed files with git
Summary: webkit-patch post does not properly recognize renamed files with git
Status: RESOLVED DUPLICATE of bug 48075
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P4 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-01 17:27 PDT by Keith Kyzivat
Modified: 2011-04-18 19:08 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Kyzivat 2011-04-01 17:27:24 PDT
Patch files created and uploaded with webkit-patch from a git repository where files have been renamed does not work properly.

The renamed files are not included in the patch.
It appears that this is because the renamed files are added to the staging area, and webkit-patch post only operates on local changes and commits.

For an example of the difference of what webkit-patch does, and a manual git diff created patch, see:
https://bugs.webkit.org/show_bug.cgi?id=57666

The obsoleted patch is one created by webkit-patch post 57666
The committed patch is the one created with git diff by hand.
Comment 1 Adam Barth 2011-04-01 17:37:27 PDT
Yep.  This bug just bit me, in fact.
Comment 2 Csaba Osztrogonác 2011-04-01 17:37:40 PDT
Let's see a simple example which modifies a file and rename an other file.

$ git diff
diff --git a/mod.txt b/mod.txt
index e965047..557db03 100644
--- a/mod.txt
+++ b/mod.txt
@@ -1 +1 @@
-Hello
+Hello World


$ git diff --staged
diff --git a/dst.txt b/dst.txt
new file mode 100644
index 0000000..e69de29
diff --git a/src.txt b/src.txt
deleted file mode 100644
index e69de29..0000000


$ git diff HEAD
diff --git a/dst.txt b/dst.txt
new file mode 100644
index 0000000..e69de29
diff --git a/mod.txt b/mod.txt
index e965047..557db03 100644
--- a/mod.txt
+++ b/mod.txt
@@ -1 +1 @@
-Hello
+Hello World
diff --git a/src.txt b/src.txt
deleted file mode 100644
index e69de29..0000000


$ git diff HEAD -M
diff --git a/src.txt b/dst.txt
similarity index 100%
rename from src.txt
rename to dst.txt
diff --git a/mod.txt b/mod.txt
index e965047..557db03 100644
--- a/mod.txt
+++ b/mod.txt
@@ -1 +1 @@
-Hello
+Hello World
Comment 3 Csaba Osztrogonác 2011-04-01 17:38:44 PDT
scm.py uses "git diff -M", but I think it should use "git diff HEAD -M"
Comment 4 Keith Kyzivat 2011-04-06 11:59:58 PDT
HEAD isn't what is desired.

What is desired is all local commits not present in the remote (remotes/origin/HEAD ?) + the local staged changes, as well as unstaged changes.

If I'm understanding it correctly, it already figures out the SHA of the remote head and does:
git diff --binary --no-ext-diff --full-index -M <SHA of HEAD> --

So, I'm still baffled what is causing this.
My thought was that it's just not understanding the rename lines in the patch generated...
Comment 5 Eric Seidel (no email) 2011-04-06 12:58:37 PDT
I suspect this is the changed_files optimization breaking us.
Comment 6 Eric Seidel (no email) 2011-04-18 19:08:30 PDT

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