]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
teach mklog to look in the current directory for ChangeLog files
authorTrevor Saunders <tbsaunde+gcc@tbsaunde.org>
Sun, 6 Mar 2016 17:36:19 +0000 (17:36 +0000)
committerTrevor Saunders <tbsaunde@gcc.gnu.org>
Sun, 6 Mar 2016 17:36:19 +0000 (17:36 +0000)
 when run in repos other than gcc mklog fails to find ChangeLog files
because it looks for $0/../$dir/ChangeLog, but of course if the diff is
for a project other than gcc that might not exist.  It should be fine to
also look for $cwd/$dir/ChangeLog, and use that if we find it.  This
means that for example in binutils-gdb.git you can do git commit,
and then in your editor read git diff HEAD~ | mklog - to generate a
template ChangeLog for that commit.

contrib/ChangeLog:

2016-03-06  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

* mklog: Look for the ChangeLog file in $cwd.

From-SVN: r234014

contrib/ChangeLog
contrib/mklog

index d789cd8cf7b7ac40a51afd9d8b91c4374a85a08d..e40db53ed64a15813b7d086368b1830f31dc96f0 100644 (file)
@@ -1,3 +1,7 @@
+2016-03-06  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
+       * mklog: Look for the ChangeLog file in $cwd.
+
 2016-02-26  Joel Sherrill <joel@rtems.org>
 
        * config-list.mk: Add aarch64-rtems and x86_64-rtems
index 455614bfb422523010cc7e576da1af235e0310a4..61126280f1fef07fecf0ba6b82f002bf08049f86 100755 (executable)
@@ -104,7 +104,7 @@ sub get_clname ($) {
        my $dirname = $_[0];
        while ($dirname) {
                my $clname = "$dirname/ChangeLog";
-               if (-f "$gcc_root/$clname") {
+               if (-f "$gcc_root/$clname" || -f "$clname") {
                        my $relname = substr ($_[0], length ($dirname) + 1);
                        return ($clname, $relname);
                } else {