Skip to content

Commit

Permalink
Make .git_archival.txt more reproducible
Browse files Browse the repository at this point in the history
  • Loading branch information
LecrisUT committed Apr 16, 2024
1 parent d081257 commit 9ea57a0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion .git_archival.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
14 changes: 12 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,19 @@ Ensure the content of the following files:
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
```

Feel free to alter the `match` field in `describe-name` to match your project's
tagging style.

!!! note

If your git host provider does not properly expand `describe-name`, you may
need to include `ref-names: $Format:%D$`. But **beware**, this can often
lead to the git archive's checksum changing after a commit is added
post-release. See [this issue][git-archive-issue] for more details.


``` {.text file=".gitattributes"}
.git_archival.txt export-subst
```
Expand All @@ -251,7 +261,7 @@ $ git add .git_archival.txt .gitattributes && git commit -m "add export config"
Note that if you are creating a `_version.py` file, note that it should not
be kept in version control. It's strongly recommended to be put into gitignore.


[git-archive-issue]: https://github.com/pypa/setuptools_scm/issues/806

### File finders hook makes most of `MANIFEST.in` unnecessary

Expand Down
1 change: 0 additions & 1 deletion src/setuptools_scm/.git_archival.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$

0 comments on commit 9ea57a0

Please sign in to comment.