[1/8] debian: Add all temporary files to Gitignore

Message ID 20210416130612.15959-2-valter.jansons@gmail.com
State Accepted
Commit 73dfec8399cccfa4e561dd64be89dc5355df7c05
Headers
Series debian: Mitigate bulk of Lintian issues |

Commit Message

Valters Jansons April 16, 2021, 1:06 p.m. UTC
  New packages have been added since the inception of the .gitignore and
as a result during build we see directories such as location-importer/
and files such as location-importer.debhelper.log.

This commit ensures all temporary subdirectories, and additional
generic build artifact files, are ignored by Git.

The subdirectory exceptions to this rule are:

- d/patches/ which may be used by Quilt
  considering the source format is '3.0 (quilt)',

- d/source/ for the format file,

- d/tests/ which may be used by autopkgtest
  to specify what test suites exist for the source.
  See: https://salsa.debian.org/ci-team/autopkgtest/-/raw/debian/5.16/doc/README.package-tests.rst

Signed-off-by: Valters Jansons <valter.jansons@gmail.com>
---
 debian/.gitignore | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
  

Comments

Michael Tremer April 19, 2021, 1:10 p.m. UTC | #1
Hello,

> On 16 Apr 2021, at 14:06, Valters Jansons <valter.jansons@gmail.com> wrote:
> 
> New packages have been added since the inception of the .gitignore and
> as a result during build we see directories such as location-importer/
> and files such as location-importer.debhelper.log.
> 
> This commit ensures all temporary subdirectories, and additional
> generic build artifact files, are ignored by Git.
> 
> The subdirectory exceptions to this rule are:
> 
> - d/patches/ which may be used by Quilt
>  considering the source format is '3.0 (quilt)',
> 
> - d/source/ for the format file,
> 
> - d/tests/ which may be used by autopkgtest
>  to specify what test suites exist for the source.
>  See: https://salsa.debian.org/ci-team/autopkgtest/-/raw/debian/5.16/doc/README.package-tests.rst
> 
> Signed-off-by: Valters Jansons <valter.jansons@gmail.com>
> ---
> debian/.gitignore | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/debian/.gitignore b/debian/.gitignore
> index 0faf920..8190b92 100644
> --- a/debian/.gitignore
> +++ b/debian/.gitignore
> @@ -2,9 +2,10 @@
> /autoreconf.*
> /debhelper-build-stamp
> /files
> -/libloc/
> -/libloc-dev/
> -/libloc-perl/
> -/tmp
> +/*/

What is /*/ for? Why would we ignore any directory that is created in the root directory.

It feels like a bit much to me.

-Michael

> *.debhelper
> +*.log
> *.substvars
> +!/patches/
> +!/source/
> +!/tests/
> -- 
> 2.31.1
>
  
Valters Jansons April 19, 2021, 1:48 p.m. UTC | #2
On Mon, Apr 19, 2021 at 4:10 PM Michael Tremer
<michael.tremer@ipfire.org> wrote:
> What is /*/ for? Why would we ignore any directory that is created in the root directory.
>
> It feels like a bit much to me.

As this is debian/.gitignore, then as a result all directories created
in debian/ get ignored. From gitignore(5): "These patterns match
relative to the location of the .gitignore file."

The added exceptions to that are debian/patches/, debian/source/ and
debian/tests/ as described in the commit message.

This ensures that if a new package is added, it doesn't need to be
manually added to the Gitignore. Similarly, if a package is removed,
then it doesn't need to be removed from the Gitignore either.

--Valters
  

Patch

diff --git a/debian/.gitignore b/debian/.gitignore
index 0faf920..8190b92 100644
--- a/debian/.gitignore
+++ b/debian/.gitignore
@@ -2,9 +2,10 @@ 
 /autoreconf.*
 /debhelper-build-stamp
 /files
-/libloc/
-/libloc-dev/
-/libloc-perl/
-/tmp
+/*/
 *.debhelper
+*.log
 *.substvars
+!/patches/
+!/source/
+!/tests/