I've pushed this.  It appears to be a well known problem that GNU Indent
is not idempotent when run once on code, but it appears to be idempotent
when run twice.  This is a maintainer target, so performance should not
be a significant factor (and running indent on even large projects is
quite fast anyway).

/Simon

---
 ChangeLog    |    4 ++++
 top/maint.mk |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 65d06ef..db345d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-29  Simon Josefsson  <si...@josefsson.org>
+
+       * top/maint.mk (indent): Run twice to produce idempotent results.
+
 2010-04-28  Bruno Haible  <br...@clisp.org>
 
        getdate: Generate getdate.c in the source directory.
diff --git a/top/maint.mk b/top/maint.mk
index ed41389..6389c38 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -1127,10 +1127,12 @@ refresh-po:
        echo 'e...@quot' >> $(PODIR)/LINGUAS && \
        ls $(PODIR)/*.po | sed 's/\.po//' | sed 's,$(PODIR)/,,' | sort >> 
$(PODIR)/LINGUAS
 
+ # Running indent once is not idempotent, but running it twice is.
 INDENT_SOURCES ?= $(C_SOURCES)
 .PHONY: indent
 indent:
        indent $(INDENT_SOURCES)
+       indent $(INDENT_SOURCES)
 
 # If you want to set UPDATE_COPYRIGHT_* environment variables,
 # put the assignments in this variable.
-- 
1.7.0.5


Reply via email to