REOPENED 41788
commit-log-editor: wrong ChangeLog read when invoked from subdir with git
https://bugs.webkit.org/show_bug.cgi?id=41788
Summary commit-log-editor: wrong ChangeLog read when invoked from subdir with git
David Kilzer (:ddkilzer)
Reported 2010-07-07 12:37:30 PDT
Created attachment 60765 [details] Patch Reviewed by NOBODY (OOPS!). For both svn and git, commit-log-editor is invoked from the root of the working directory. Unlike svn, git returns a list of changed files that are relative to the directory where the command was invoked. This caused the ChangeLog file in the root directory to be read instead of the ChangeLog in the current directory. The fix is to use $ENV{PWD} as the base directory when fixing the path to the ChangeLog files. With svn, this has no net effect since $ENV{PWD} is the root of the working directory and the ChangeLog paths are already relative to that directory. With git, $ENV{PWD} is the directory that the commit was invoked from, which fixes the ChangeLog paths so that the correct files are read when creating the commit log entry. Note that the call to makeFilePathRelative() was supposed to address this issue, but it doesn't because (a) it does nothing with svn working directories by design, and (b) it does nothing with git working directories because it's invoked when the current directory is the root of the working directory, thus giving no relative path. * Scripts/commit-log-editor: Removed call to makeFilePathRelative() since since it does nothing. Moved code to fix up $changeLog path so that it's fixed before trying to open the file, and use $ENV{PWD} as the base path. Also use canonicalizePath() to clean up paths with "../" in them. --- 2 files changed, 37 insertions(+), 3 deletions(-)
Attachments
Patch (3.37 KB, patch)
2010-07-07 12:37 PDT, David Kilzer (:ddkilzer)
no flags
David Kilzer (:ddkilzer)
Comment 1 2010-07-07 13:04:48 PDT
David Kilzer (:ddkilzer)
Comment 2 2010-07-09 10:32:52 PDT
This breaks "sometimes" for svn users. See <http://trac.webkit.org/changeset/62882>. Also, it didn't fix Anders' use case where ~/WebKit is a symlink to another volume. I will roll out the patch until I have time to write unit tests and fix this properly.
David Kilzer (:ddkilzer)
Comment 3 2010-07-09 13:40:48 PDT
Eric Seidel (no email)
Comment 4 2010-07-09 14:16:08 PDT
Comment on attachment 60765 [details] Patch Cleared Anders Carlsson's review+ from obsolete attachment 60765 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Note You need to log in before you can comment on or make changes to this bug.