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: 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 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to '.gitattributes') diff --git a/.gitattributes b/.gitattributes index 429748b0d4..c5b9d859dc 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 -- cgit v1.2.1