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

Alan Dunn amdunn at google.com
Fri Feb 12 09:49:53 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".

 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.

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

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..39f0d28
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,67 @@
+# 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