[PATCH v2 1/1] Add .gitignore and script to manage .po files

Alan Dunn amdunn at google.com
Wed Feb 17 05:06:29 AEDT 2016

It is much easier to track one's changes (i.e., added files) to
Petitboot without all of the generated files being marked as
untracked.  In this commit I add a .gitignore file and script to mark
the .po files that are changed by the setup process as unchanged.
This way, there are no untracked generated files from the setup and
compilation process all the way through "make" and "make check".

This version of the patch corrects gitignore patterns starting with -
to ones starting with ! ("-" was the wrong character to negate
patterns), removes particular exclusions in the m4 directory that are
unnecessary, and changes the format of some directory exclusions
(e.g., **/.libs/ -> **/.libs).

 In a clean copy of the repository after this change, I ran:
  ./configure --without-twin-x11 --without-twin-fbdev
  make check

 and then saw no untracked files.

 I manually created test/parser/test-foo.c and saw that it was marked
 as untracked rather than ignored.

 I made manual changes to the tracked m4/ax_with_curses.m4 and saw
 that these were not ignored.

Signed-off-by: Alan Dunn <amdunn at google.com>
 .gitignore          | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 manage_unchanged.sh | 22 ++++++++++++++++++
 2 files changed, 87 insertions(+)
 create mode 100644 .gitignore
 create mode 100755 manage_unchanged.sh

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d7653aa
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,65 @@
+# Petitboot generated files
+# Petitboot binaries
+# Libtool generated files
+# Autotools generated files
+# Gettext
+/po/en at boldquot.header
+/po/en at quot.header
+# Tests
+## Test binaries
+# Compiled files
diff --git a/manage_unchanged.sh b/manage_unchanged.sh
new file mode 100755
index 0000000..15b510e
--- /dev/null
+++ b/manage_unchanged.sh
@@ -0,0 +1,22 @@
+# There are some files in this repository that the setup process
+# changes, and the changes should not be tracked by git.  This script
+# causes git to ignore or unignore changes to those files.  The later
+# is necessary in the case that the files change upstream.  The script
+# is designed to be run in the directory it is in.  For usage, see the
+# usage message below.
+if [ "$DIRECTION" = 1 ]; then
+  GIT_FLAG=--assume-unchanged
+elif [ "$DIRECTION" = 0 ]; then
+  GIT_FLAG=--no-assume-unchanged
+  echo "Usage: $0 [1 to ignore files, 0 to unignore files, default 1]"
+  exit 1
+git update-index $GIT_FLAG $FILES

More information about the Petitboot mailing list