Eric Blake wrote: > One other thing - the generated .gitignore files are failing to pick up on > the > fact that link-warning.h and arg-nonnull.h (and soon-to-be warn-on-use.h) are > generated files: > > # Untracked files: > # (use "git add <file>..." to include in what will be committed) > # > # lib/arg-nonnull.h > # lib/link-warning.h > > Can gnulib-tool be taught to update the ignore files to include these?
It depends on the policy of the particular project 1) which generated files are put under version control, 2) whether an "autogen.sh" (or similar) script exists, 3) which among the generated files that are not under version control get added to .gitignore and which get added to .git/info/exclude. Additionally, the list of files that are put in .gitignore or .git/info/exclude depends more on the contents of the (partially generated) Makefile.am than on the file list of a gnulib module. For this reason, gnulib-tool is currently minimal about what it adds to .gitignore. Namely, it considers only question 1). - If generated files are under version control, then the user should pass --no-vc-files. - If generated files are not under version control, then the user should pass --vc-files. gnulib-tool only adds files that it explicitly copies or generates. Below is a summary of the different policies that I'm using in my different projects. You see, there is not one policy that fits all projects. Bruno Files under version control and gitignored files in LIBUNISTRING ================================================================ Because releases are rolled through automake's "make distcheck", unused files can lie around in the working checkout. A separate "-clean" checkout is used which should not contain modifications nor unused files. in in Committed .gitignore .git/info/exclude Source Y N N gnulib-cache.m4 Y N N Brought in by autotools, N Y N gnulib-tool Generated by autotools N Y N Generated by "make" and N Y N distributed (i.e. kept by "make distclean") Generated by "make" and N N Y not distributed (i.e. erased by "make distclean") Editor backup files N Y N Have an autogen.sh ? Y Files under version control and gitignored files in GETTEXT =========================================================== Because releases are rolled through automake's "make distcheck", unused files can lie around in the working checkout. A separate "-clean" checkout is used which should not contain modifications nor unused files. in in Committed .gitignore .git/info/exclude Source Y N N gnulib-cache.m4 N Y N Brought in by autotools, N Y N gnulib-tool Generated by autotools N Y N Generated by "make" and N for most Y for most N for most distributed (i.e. kept by Y for *.po N for *.po (see below for *.po) "make distclean") Generated by "make" and N N Y not distributed (i.e. erased by "make distclean") Editor backup files N Y N Have an autogen.sh ? Y To hide uncommitted changes to the PO files, do # Files that are generated/updated by "make" but that are also distributed # and that are committed (and thus not listed in .gitignore). git update-index --assume-unchanged gettext-runtime/po/gettext-runtime.pot git update-index --assume-unchanged gettext-runtime/po/??.po git update-index --assume-unchanged gettext-runtime/po/pt_??.po git update-index --assume-unchanged gettext-runtime/po/zh_??.po git update-index --assume-unchanged gettext-tools/po/gettext-tools.pot git update-index --assume-unchanged gettext-tools/po/??.po git update-index --assume-unchanged gettext-tools/po/pt_??.po git update-index --assume-unchanged gettext-tools/po/zh_??.po git update-index --assume-unchanged gettext-tools/examples/po/gettext-examples.pot git update-index --assume-unchanged gettext-tools/examples/po/??.po git update-index --assume-unchanged gettext-tools/examples/po/pt_??.po git update-index --assume-unchanged gettext-tools/examples/po/zh_??.po (Quite unusual! There are modifications and "git status" does not show them!!) Files under version control and gitignored files in LIBICONV ============================================================ Nothing in .gitignore, because releases are rolled from the working directory (not through automake's "make distcheck"), therefore no files must be left over at this moment. A separate "-clean" checkout is used which should not contain modifications nor unused files. in in Committed .gitignore .git/info/exclude Source Y N N gnulib-cache.m4 N N Y Brought in by autotools, N N Y gnulib-tool Generated by autotools N N Y Generated by "make" and N N Y distributed (i.e. kept by Y for *.po "make distclean") Generated by "make" and N N Y not distributed (i.e. erased by "make distclean") Editor backup files N N Y Have an autogen.sh ? Y Files under version control and gitignored files in GPERF ========================================================= Nothing in .gitignore, because releases are rolled from the working directory (not through automake's "make distcheck"), therefore no files must be left over at this moment. A separate "-clean" checkout is used which should not contain modifications nor unused files. in in Committed .gitignore .git/info/exclude Source Y N N gnulib-cache.m4 n/a n/a n/a Brought in by autotools, Y N N gnulib-tool Generated by autotools Y N N Generated by "make" and Y N N distributed (i.e. kept by "make distclean") Generated by "make" and N N Y not distributed (i.e. erased by "make distclean") Editor backup files N N Y Have an autogen.sh ? N, use Makefile.devel instead