From 1d9a1215e8b0a2c9f3723d6f1fe5340943ed53a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 17 Oct 2021 19:49:15 +0200 Subject: [PATCH] gitattributes: introduce and use "generated" attribute I want to mark some files to be ignored for licensing purposes, e.g. output from fuzzers and other samples. By using the gitattribute machinery for this we don't need to design a custom protocol: $ git check-attr generated test/test-sysusers/unhappy-* test/test-sysusers/unhappy-1.expected-err: generated: set test/test-sysusers/unhappy-1.input: generated: unspecified test/test-sysusers/unhappy-2.expected-err: generated: set test/test-sysusers/unhappy-2.input: generated: unspecified test/test-sysusers/unhappy-3.expected-err: generated: set test/test-sysusers/unhappy-3.input: generated: unspecified --- .gitattributes | 10 +++++++++- po/.gitattributes | 1 + test/dmidecode-dumps/.gitattributes | 2 +- test/fuzz/.gitattributes | 1 + test/journal-data/.gitattributes | 2 +- test/test-network-generator-conversion/.gitattributes | 1 + test/test-network/.gitattributes | 1 + test/test-resolve/.gitattributes | 2 +- test/test-sysusers/.gitattributes | 2 ++ test/test-umount/.gitattributes | 1 + 10 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 po/.gitattributes create mode 100644 test/test-network-generator-conversion/.gitattributes create mode 100644 test/test-network/.gitattributes create mode 100644 test/test-sysusers/.gitattributes create mode 100644 test/test-umount/.gitattributes diff --git a/.gitattributes b/.gitattributes index 429748b0d42..c5b9d859dcf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,11 @@ *.[ch] whitespace=tab-in-indent,trailing-space -*.gpg binary +*.gpg binary generated *.bmp binary + +# Mark files as "generated", i.e. no license applies to them. +# This includes output from programs, directive lists generated by grepping +# for all possibilities, samples from fuzzers, files from /proc, packet samples, +# and anything else where no copyright can be asserted. +# +# Use 'git check-attr generated -- ' to query the attribute. +[attr]generated diff --git a/po/.gitattributes b/po/.gitattributes new file mode 100644 index 00000000000..9418c2a217d --- /dev/null +++ b/po/.gitattributes @@ -0,0 +1 @@ +/LINGUAS generated diff --git a/test/dmidecode-dumps/.gitattributes b/test/dmidecode-dumps/.gitattributes index 64294bde82c..a930f4fc7e3 100644 --- a/test/dmidecode-dumps/.gitattributes +++ b/test/dmidecode-dumps/.gitattributes @@ -1 +1 @@ -/*.bin binary +/*.bin binary generated diff --git a/test/fuzz/.gitattributes b/test/fuzz/.gitattributes index 49f2902f0d1..02dea65580c 100644 --- a/test/fuzz/.gitattributes +++ b/test/fuzz/.gitattributes @@ -5,3 +5,4 @@ /fuzz-fido-id-desc/ binary /fuzz-lldp-rx/* binary /fuzz-ndisc-rs/* binary +/*/* generated diff --git a/test/journal-data/.gitattributes b/test/journal-data/.gitattributes index c04df17b598..483f6cdd60b 100644 --- a/test/journal-data/.gitattributes +++ b/test/journal-data/.gitattributes @@ -1,2 +1,2 @@ # Journal data in export format -/*.txt binary +/*.txt binary generated diff --git a/test/test-network-generator-conversion/.gitattributes b/test/test-network-generator-conversion/.gitattributes new file mode 100644 index 00000000000..6df434f423c --- /dev/null +++ b/test/test-network-generator-conversion/.gitattributes @@ -0,0 +1 @@ +* generated diff --git a/test/test-network/.gitattributes b/test/test-network/.gitattributes new file mode 100644 index 00000000000..e99a2c3d053 --- /dev/null +++ b/test/test-network/.gitattributes @@ -0,0 +1 @@ +/conf/*.key generated diff --git a/test/test-resolve/.gitattributes b/test/test-resolve/.gitattributes index e4b1e295d60..6bebb3e11eb 100644 --- a/test/test-resolve/.gitattributes +++ b/test/test-resolve/.gitattributes @@ -1 +1 @@ -/*.pkts binary +/*.pkts binary generated diff --git a/test/test-sysusers/.gitattributes b/test/test-sysusers/.gitattributes new file mode 100644 index 00000000000..f03f6c03ac8 --- /dev/null +++ b/test/test-sysusers/.gitattributes @@ -0,0 +1,2 @@ +/*.initial* generated +/*.expected* generated diff --git a/test/test-umount/.gitattributes b/test/test-umount/.gitattributes new file mode 100644 index 00000000000..6df434f423c --- /dev/null +++ b/test/test-umount/.gitattributes @@ -0,0 +1 @@ +* generated