Skip to content

.gitattributes not handled properly with git archive call #444

Open
@LecrisUT

Description

@LecrisUT

For example if the project is built with setuptools_scm, it can use an automatically generated file .git_archival.txt in case the tar ball is not a git repo, specifially:

# .gitattributes
.git_archival.txt  export-subst

# .git_archival.txt
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$

Will generate the following file after running git archive HEAD

# .git_archival.txt
node: 3e4c4c351099b04529ac3c951b720e35d11b5ef0
node-date: 2023-02-17T16:29:19+01:00
describe-name: v0.2.1-rc1
ref-names: HEAD -> rpm-spec, tag: v0.2.1-rc1, LecrisUT/rpm-spec

The issue is that if we run as git archive HEAD:./, this generation breaks and it is not generated.

My understanding is that the path ./ after the colon : is to specify the relative path to the git repository to archive. If that is the case, it should be fixable by changing it to:

git archive HEAD ./

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is clearly a bugeffort/mediumCan be done in 1-2 daysgain/mediumAffects multiple users

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions