Skip to content

Commit 1d9a121

Browse files
committed
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
1 parent 546e57f commit 1d9a121

10 files changed

Lines changed: 19 additions & 4 deletions

File tree

.gitattributes

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
*.[ch] whitespace=tab-in-indent,trailing-space
2-
*.gpg binary
2+
*.gpg binary generated
33
*.bmp binary
4+
5+
# Mark files as "generated", i.e. no license applies to them.
6+
# This includes output from programs, directive lists generated by grepping
7+
# for all possibilities, samples from fuzzers, files from /proc, packet samples,
8+
# and anything else where no copyright can be asserted.
9+
#
10+
# Use 'git check-attr generated -- <path>' to query the attribute.
11+
[attr]generated

po/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/LINGUAS generated
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/*.bin binary
1+
/*.bin binary generated

test/fuzz/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/fuzz-fido-id-desc/ binary
66
/fuzz-lldp-rx/* binary
77
/fuzz-ndisc-rs/* binary
8+
/*/* generated

test/journal-data/.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Journal data in export format
2-
/*.txt binary
2+
/*.txt binary generated
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* generated

test/test-network/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/conf/*.key generated

test/test-resolve/.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/*.pkts binary
1+
/*.pkts binary generated

test/test-sysusers/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/*.initial* generated
2+
/*.expected* generated

test/test-umount/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* generated

0 commit comments

Comments
 (0)