emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master adb69dd: Avoid unnecessary bumping of Makefile.in's


From: Glenn Morris
Subject: [Emacs-diffs] master adb69dd: Avoid unnecessary bumping of Makefile.in's timestamp.
Date: Thu, 07 May 2015 01:59:13 +0000

branch: master
commit adb69ddff05ce770261e03d249f2e31e75c098af
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    Avoid unnecessary bumping of Makefile.in's timestamp.
    
    * Makefile.in (gen_origin): Move to gitlog-to-emacslog.
    (emacslog): New variable.
    (ChangeLog): Use $emacslog.  Don't pass $gen_origin.
    (unchanged-history-files): Use $emacslog rather than Makefile.in.
    (change-history-nocommit): Store hash in $emacslog.
    * build-aux/gitlog-to-emacslog (gen_origin): Move default here.
    * admin/update_autogen (changelog_files): Update for the above.
---
 Makefile.in                  |   14 ++++++--------
 admin/update_autogen         |    2 +-
 build-aux/gitlog-to-emacslog |    5 ++++-
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index c1ed1c3..5102575 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1091,10 +1091,8 @@ bootstrap: bootstrap-clean
 .PHONY: ChangeLog change-history change-history-commit change-history-nocommit
 .PHONY: master-branch-is-current unchanged-history-files
 
-# The newest revision that should not appear in the generated ChangeLog.
-gen_origin = 2c1b8604946efbcd8ec5dd6c6dda7541ce4fc3c0
-
 CHANGELOG =
+emacslog = $(srcdir)/build-aux/gitlog-to-emacslog
 
 # Convert git commit log to ChangeLog file.  make-dist uses this.
 # I guess this is PHONY because it generates in distprefix (which is
@@ -1103,7 +1101,7 @@ CHANGELOG =
 ChangeLog:
        @[ -n "${CHANGELOG}" ] || test ! -f ChangeLog
        $(AM_V_GEN)distprefix=$(distprefix) srcprefix=$(srcdir)/ \
-       $(srcdir)/build-aux/gitlog-to-emacslog $(gen_origin) $(CHANGELOG)
+       $(emacslog) . $(CHANGELOG)
 
 # The ChangeLog history files are called ChangeLog.1, ChangeLog.2, ...,
 # ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX).  $(CHANGELOG_N) stands for
@@ -1115,7 +1113,7 @@ CHANGELOG_N = ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX)
 master-branch-is-current:
        git branch | grep -q '^\* master$$'
 unchanged-history-files:
-       x=$$(git diff-files --name-only $(CHANGELOG_N) Makefile.in) && \
+       x=$$(git diff-files --name-only $(CHANGELOG_N) $(emacslog)) && \
          test -z "$$x"
 
 # Copy newer commit messages to the start of the ChangeLog history file,
@@ -1126,10 +1124,10 @@ change-history-nocommit: master-branch-is-current 
unchanged-history-files
          >$(CHANGELOG_N).tmp
        rm ChangeLog.tmp
        new_origin=$$(git log --pretty=format:%H HEAD^!) && \
-       sed 's/^\(gen_origin *= *\).*/\1'"$$new_origin/" \
-         <Makefile.in >Makefile.in.tmp
+       sed 's/^\(gen_origin=\).*/\1'"$$new_origin/" \
+         < $(emacslog) > $(emacslog).tmp
        mv $(CHANGELOG_N).tmp $(CHANGELOG_N)
-       mv Makefile.in.tmp Makefile.in
+       mv $(emacslog).tmp $(emacslog)
 
 change-history: change-history-nocommit
        $(MAKE) address@hidden
diff --git a/admin/update_autogen b/admin/update_autogen
index e9d4aa5..27d5303 100755
--- a/admin/update_autogen
+++ b/admin/update_autogen
@@ -94,7 +94,7 @@ changelog_flag=
 ldefs_in=lisp/loaddefs.el
 ldefs_out=lisp/ldefs-boot.el
 changelog_n=$(sed -n 's/CHANGELOG_HISTORY_INDEX_MAX *= *//p' Makefile.in)
-changelog_files="ChangeLog.$changelog_n Makefile.in"
+changelog_files="ChangeLog.$changelog_n build-aux/gitlog-to-emacslog"
 sources="configure.ac lib/Makefile.am"
 ## Files to copy into autogendir.
 ## Everything:
diff --git a/build-aux/gitlog-to-emacslog b/build-aux/gitlog-to-emacslog
index 059cf81..a657cce 100755
--- a/build-aux/gitlog-to-emacslog
+++ b/build-aux/gitlog-to-emacslog
@@ -22,7 +22,10 @@
 LC_ALL=C
 export LC_ALL
 
-gen_origin=${1?}
+# The newest revision that should not appear in the generated ChangeLog.
+gen_origin=2c1b8604946efbcd8ec5dd6c6dda7541ce4fc3c0
+test -n "$1" && test "$1" != "." && gen_origin=$1
+
 output=$2
 test -n "$output" || output=ChangeLog
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]