diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -19,6 +19,7 @@ Features, regex - Customizable pattern for searching and capturing existing copyright year, author, and contact through regex +- Derive the copyright year from the first commit in git history. ## Background @@ -210,7 +211,13 @@ The match-copyright section define the pattern to match with old copyright text. The regex must contains named group to capture copyright year, author, and contact. -For example, given the following old copyright text, + +If no copyright year found on the file, program will derive the year from +the date of the first commit in history of the file using the Source Code +Management (SCM). +In git SCM, it will run "git log --follow file". + +Example, given the following old copyright text, ``` Copyright 2022, John Doe <john.doe@email>. All rights reserved. @@ -258,7 +265,7 @@ path = { unicode_char } license_id = "default" | "exist" | "match" idx_license_id = 1 * decimal_digit -year = "unknown" | 4 * decimal_digit +year = 4 * decimal_digit ("," year) | 4 * decimal_digit "-" 4*decimal_digit copyright_id = "default" | "exist" | "match" @@ -285,8 +292,8 @@ found at the bottom. The `year` column define the copyright year for the work. The value is either, -- unknown - program cannot detect year - YYYY - single year, for example 2026 +- YYYY,YYYY,... - list of year, separated by comma - YYYY-YYYY - range of years, for example 2000-2026 The `copyright_id` define the author and contact. |
