[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).

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

 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
+/discover/grub2/grub2-lexer.[ch]
+/discover/grub2/grub2-parser.[ch]
+
+# Petitboot binaries
+/discover/pb-discover
+/ui/ncurses/petitboot-nc
+/utils/pb-config
+/utils/pb-event
+
+# Libtool generated files
+*.lo
+*.la
+**/.libs
+
+# Autotools generated files
+**/.deps
+.dirstamp
+
+/ABOUT-NLS
+/Makefile
+/Makefile.in
+/aclocal.m4
+/autom4te.cache
+/compile
+/config.*
+/configure
+/depcomp
+/install-sh
+/libtool
+/ltmain.sh
+/m4/*
+/missing
+/stamp-h1
+/ylwrap
+
+# Gettext
+/po/*.po~
+/po/Makefile*
+/po/Makevars.template
+/po/*.gmo
+/po/*.sin
+/po/*.sed
+/po/POTFILES
+/po/Rules-quot
+/po/en at boldquot.header
+/po/en at quot.header
+/po/petitboot.pot
+/po/stamp-po
+
+# Tests
+*.log
+*.trs
+/test-driver
+## Test binaries
+/test/lib/list-test
+/test/urls/parse-url
+/test/urls/run-url-test
+/test/**/test*
+!/test/**/test*.c
+/ui/test/discover-test
+
+# Compiled files
+*.o
+*.ro
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 @@
+#!/bin/sh
+
+# 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.
+
+FILES=po/*.po
+DIRECTION=${1:-1}
+
+if [ "$DIRECTION" = 1 ]; then
+  GIT_FLAG=--assume-unchanged
+elif [ "$DIRECTION" = 0 ]; then
+  GIT_FLAG=--no-assume-unchanged
+else
+  echo "Usage: $0 [1 to ignore files, 0 to unignore files, default 1]"
+  exit 1
+fi
+
+git update-index $GIT_FLAG $FILES
-- 
2.7.0.rc3.207.g0ac5344



More information about the Petitboot mailing list