Bug 15324 - prepare-ChangeLog does not detect removed files when git is used
Summary: prepare-ChangeLog does not detect removed files when git is used
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-29 15:43 PDT by Holger Freyther
Modified: 2007-09-29 16:39 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Freyther 2007-09-29 15:43:24 PDT
The current prepare-ChangeLog script is not able to detect removed files. These files where removed using git-rm and there are at least two reasons for that:

 1.) Using git-rm file, the index gets updated and git-diff will not show the removal of the file
 2.) If git-diff --cached is used the removal of files will be indicated but for removal "^D " is used which is not known by prepare-ChangeLog.

The following hack works to detect removals but it will fail with the --git-commit mode of prepare-ChangeLog. Also Adam mentioned that adding "^D" to the isAddedStatus() is kind of odd.

diff --git a/WebKitTools/Scripts/prepare-ChangeLog b/WebKitTools/Scripts/prepare-ChangeLog
index 69edd9a..1f2458d 100755
--- a/WebKitTools/Scripts/prepare-ChangeLog
+++ b/WebKitTools/Scripts/prepare-ChangeLog
@@ -982,7 +982,8 @@ sub statusCommand(@)
     if ($isSVN) {
         $command = "$SVN stat $filesString";
     } elsif ($isGit) {
-        $command = "$GIT diff -r --name-status -C -C -M " . diffFromToString();
+        print("Foo");
+        $command = "$GIT diff --cached -r --name-status -C -C -M " . diffFromToString();
         $command .= " -- $filesString" unless $gitCommit;
     }
 

@@ -1119,6 +1121,7 @@ sub isAddedStatus($)
     my %statusCodes = (
         "A" => 1,
         "C" => $isGit,
+        "D" => $isGit,
         "R" => 1,
     );