From: Bruno Haible Date: Thu, 21 Mar 2024 14:45:42 +0000 (+0100) Subject: gnulib-tool: Make the .gitignore files handling more consistent. X-Git-Tag: v1.0~259 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=74f000c7d9d3cea55b6ad3131cf9e36076b08289;p=gnulib.git gnulib-tool: Make the .gitignore files handling more consistent. * gnulib-tool.sh (func_done_dir): Ignore the presence or absence of a .git directory if there is a .gitignore file in the same place. * pygnulib/GLImport.py (GLImport._done_dir_): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 09ab4ac158..e92b0cac2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-03-21 Bruno Haible + + gnulib-tool: Make the .gitignore files handling more consistent. + * gnulib-tool.sh (func_done_dir): Ignore the presence or absence of a + .git directory if there is a .gitignore file in the same place. + * pygnulib/GLImport.py (GLImport._done_dir_): Likewise. + 2024-03-20 Bruno Haible gnulib-tool.sh: Undocument the --[no-]cache-modules options. diff --git a/gnulib-tool.sh b/gnulib-tool.sh index 2081ed049e..f1a36ec023 100755 --- a/gnulib-tool.sh +++ b/gnulib-tool.sh @@ -6290,7 +6290,7 @@ s,//*$,/,' if test -d "$destdir/CVS" || test -d "$destdir/${dir}CVS" || test -f "$destdir/${dir}.cvsignore"; then func_update_ignorelist .cvsignore fi - if test -d "$destdir/.git" || test -f "$destdir/${dir}.gitignore"; then + if test -d "$destdir/.git" || test -f "$destdir/.gitignore" || test -f "$destdir/${dir}.gitignore"; then func_update_ignorelist .gitignore fi } diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index 4c7b62a8df..66b63ef08e 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -781,6 +781,7 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix self._update_ignorelist_(directory, '.cvsignore', dirs_added, dirs_removed) if (isdir(joinpath(destdir, '.git')) + or isfile(joinpath(destdir, '.gitignore')) or isfile(joinpath(destdir, directory, '.gitignore'))): self._update_ignorelist_(directory, '.gitignore', dirs_added, dirs_removed)