Perl warns of the use of an uninitialized variable in prepare-ChangeLog when the working copy has a non-empty new file staged for commit: Use of uninitialized value $first_line in pattern match (m//) at Tools/Scripts/prepare-ChangeLog line 644. Without loss of generality, you can reproduce this issue by running the following terminal commands inside the top-level directory of a Git checkout of the WebKit repository: $ echo 'A' > A.txt $ git add A.txt $ Tools/Scripts/prepare-ChangeLog Then you will see output of the form: Running status to find changed, added, or removed files. Reviewing diff to determine which lines changed. Extracting affected function names from source files. fatal: Path 'A.txt' exists on disk, but not in 'HEAD'. Use of uninitialized value $first_line in pattern match (m//) at Tools/Scripts/prepare-ChangeLog line 644. Change author: Daniel Bates <dabates@apple.com>. Editing the ./ChangeLog file. -- Please remember to include a detailed description in your ChangeLog entry. -- -- See <http://webkit.org/coding/contributing.html> for more info --
The logic for parsing a chunk range line of a unified diff is incorrect in extractLineRange{Before, After}Change(). In addition to causes this bug it also causes prepare-ChangeLog to always emit the name of the function f_0 above a deleted function regardless of whether f_0 changed.
Created attachment 253243 [details] Patch and unit tests
Comment on attachment 253243 [details] Patch and unit tests View in context: https://bugs.webkit.org/attachment.cgi?id=253243&action=review > Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/extractLineRangeBeforeAndAfterChange.pl:29 > +use VCSUtils; Will remove this before landing.
Committed r184521: <http://trac.webkit.org/changeset/184521>