bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] gnulib-tool: limit line length for git send-email


From: Paul Eggert
Subject: [PATCH] gnulib-tool: limit line length for git send-email
Date: Tue, 17 Jul 2018 15:23:24 -0700

* gnulib-tool (func_import): Break actioncmd log line
into multiple lines.
---
 ChangeLog   |  6 +++++
 gnulib-tool | 87 ++++++++++++++++++++++++++++++++-----------------------------
 2 files changed, 52 insertions(+), 41 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ecb9e48..05b0544 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-07-17  Paul Eggert  <address@hidden>
+
+       gnulib-tool: limit line length for git send-email
+       * gnulib-tool (func_import): Break actioncmd log line
+       into multiple lines.
+
 2018-07-16  Bruno Haible  <address@hidden>
 
        ffs: Ensure declaration on mingw.
diff --git a/gnulib-tool b/gnulib-tool
index fcc585c..ebe4443 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -3521,14 +3521,7 @@ func_emit_lib_Makefile_am ()
       echo "## Process this file with automake to produce Makefile.in."
   func_emit_copyright_notice
   if test -n "$actioncmd"; then
-    # The maximum line length (excluding the terminating newline) of any file
-    # that is to be preprocessed by config.status is 3070.  config.status uses
-    # awk, and the HP-UX 11.00 awk fails if a line has length >= 3071;
-    # similarly, the IRIX 6.5 awk fails if a line has length >= 3072.
-    len=`echo "$actioncmd" | wc -c`
-    if test -n "$len" && test "$len" -le 3000; then
-      echo "# Reproduce by: $actioncmd"
-    fi
+    printf '# Reproduce by:\n%s\n' "$actioncmd"
   fi
   echo
   uses_subdirs=
@@ -5150,7 +5143,7 @@ s,^\(.................................................[^ 
]*\) *,
   }
 
   # Command-line invocation printed in a comment in generated gnulib-cache.m4.
-  actioncmd="gnulib-tool --import"
+  actioncmd="# gnulib-tool --import"
 
   # Local helper.
   func_append_local_dir ()
@@ -5159,77 +5152,89 @@ 
s,^\(.................................................[^ ]*\) *,
   }
   func_path_foreach "$local_gnulib_path" func_append_local_dir actioncmd %dir%
 
-  func_append actioncmd " --lib=$libname"
-  func_append actioncmd " --source-base=$sourcebase"
-  func_append actioncmd " --m4-base=$m4base"
+  # Break the action command log into multiple lines.
+  # Emacs puts some gnulib-tool log lines in its source repository, and
+  # git send-email rejects patch lines longer than 998 characters.
+  # Also, config.status uses awk, and the HP-UX 11.00 awk fails if a
+  # line has length >= 3071; similarly, the IRIX 6.5 awk fails if a
+  # line has length >= 3072.
+  func_append_actionarg ()
+  {
+    func_append actioncmd " \\$nl#  $1"
+  }
+  func_append_actionarg "--lib=$libname"
+  func_append_actionarg "--source-base=$sourcebase"
+  func_append_actionarg "--m4-base=$m4base"
   if test -n "$pobase"; then
-    func_append actioncmd " --po-base=$pobase"
+    func_append_actionarg "--po-base=$pobase"
   fi
-  func_append actioncmd " --doc-base=$docbase"
-  func_append actioncmd " --tests-base=$testsbase"
-  func_append actioncmd " --aux-dir=$auxdir"
+  func_append_actionarg "--doc-base=$docbase"
+  func_append_actionarg "--tests-base=$testsbase"
+  func_append_actionarg "--aux-dir=$auxdir"
   if $inctests; then
-    func_append actioncmd " --with-tests"
+    func_append_actionarg "--with-tests"
   fi
   if test -n "$incobsolete"; then
-    func_append actioncmd " --with-obsolete"
+    func_append_actionarg "--with-obsolete"
   fi
   if test -n "$inc_cxx_tests"; then
-    func_append actioncmd " --with-c++-tests"
+    func_append_actionarg "--with-c++-tests"
   fi
   if test -n "$inc_longrunning_tests"; then
-    func_append actioncmd " --with-longrunning-tests"
+    func_append_actionarg "--with-longrunning-tests"
   fi
   if test -n "$inc_privileged_tests"; then
-    func_append actioncmd " --with-privileged-tests"
+    func_append_actionarg "--with-privileged-tests"
   fi
   if test -n "$inc_unportable_tests"; then
-    func_append actioncmd " --with-unportable-tests"
+    func_append_actionarg "--with-unportable-tests"
   fi
   if test -n "$inc_all_tests"; then
-    func_append actioncmd " --with-all-tests"
+    func_append_actionarg "--with-all-tests"
   fi
-  for module in $avoidlist; do
-    func_append actioncmd " --avoid=$module"
-  done
   if test -n "$lgpl"; then
     if test "$lgpl" = yes; then
-      func_append actioncmd " --lgpl"
+      func_append_actionarg "--lgpl"
     else
-      func_append actioncmd " --lgpl=$lgpl"
+      func_append_actionarg "--lgpl=$lgpl"
     fi
   fi
   if $gnu_make; then
-    func_append actioncmd " --gnu-make"
+    func_append_actionarg "--gnu-make"
   fi
   if test -n "$makefile_name"; then
-    func_append actioncmd " --makefile-name=$makefile_name"
+    func_append_actionarg "--makefile-name=$makefile_name"
   fi
   if test "$cond_dependencies" = true; then
-    func_append actioncmd " --conditional-dependencies"
+    func_append_actionarg "--conditional-dependencies"
   else
-    func_append actioncmd " --no-conditional-dependencies"
+    func_append_actionarg "--no-conditional-dependencies"
   fi
   if test "$libtool" = true; then
-    func_append actioncmd " --libtool"
+    func_append_actionarg "--libtool"
   else
-    func_append actioncmd " --no-libtool"
+    func_append_actionarg "--no-libtool"
   fi
-  func_append actioncmd " --macro-prefix=$macro_prefix"
+  func_append_actionarg "--macro-prefix=$macro_prefix"
   if test -n "$po_domain"; then
-    func_append actioncmd " --po-domain=$po_domain"
+    func_append_actionarg "--po-domain=$po_domain"
   fi
   if test -n "$witness_c_macro"; then
-    func_append actioncmd " --witness-c-macro=$witness_c_macro"
+    func_append_actionarg "--witness-c-macro=$witness_c_macro"
   fi
   if test -n "$vc_files"; then
     if test "$vc_files" = true; then
-      func_append actioncmd " --vc-files"
+      func_append_actionarg "--vc-files"
     else
-      func_append actioncmd " --no-vc-files"
+      func_append_actionarg "--no-vc-files"
     fi
   fi
-  func_append actioncmd " `echo $specified_modules`"
+  for module in $avoidlist; do
+    func_append_actionarg "--avoid=$module"
+  done
+  for module in $specified_modules; do
+    func_append_actionarg "$module"
+  done
 
   # Determine include_guard_prefix.
   func_compute_include_guard_prefix
@@ -5500,7 +5505,7 @@ s,//*$,/,'
     echo
     echo
     echo "# Specification in the form of a command-line invocation:"
-    echo "#   $actioncmd"
+    printf '%s\n' "$actioncmd"
     echo
     echo "# Specification in the form of a few gnulib-tool.m4 macro 
invocations:"
     func_count_relative_local_gnulib_path
-- 
2.7.4




reply via email to

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