-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix git archive for .gitattributes
#445
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Cristian Le <[email protected]>
Thank you for the PR @LecrisUT, Currently, we do
And the proposed change
so this breaks tito for all projects that have a spec file (or more of them) in some subdirectories. Reproducer:
|
Indeed I was suspecting there is something I am missing. Thanks for pointing to an example for local debugging. Any ideas of how to fix the main issue of this? (I did try adding Probably related: https://stackoverflow.com/questions/52804334/how-to-ignore-files-directories-in-git-archive-and-only-create-an-archive-of-a My test repo is https://github.com/scikit-build/scikit-build-core: $ git archive HEAD:./ --output=test.tar.gz
$ tar -axf test.tar.gz .git_archival.txt -O
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$ Compared to what it should look like: $ git archive HEAD --output=test.tar.gz
$ tar -axf test.tar.gz .git_archival.txt -O
node: 745ce26169fb44e04d91d40ee581cccd591c941e
node-date: 2023-03-01T15:22:44+01:00
describe-name: v0.2.0-14-g745ce26
ref-names: HEAD -> rpm-spec, LecrisUT/rpm-spec |
How about we use |
Thank you. I don't use The directory structure produced by these two commands is the same:
But, in the first case, the
and in the second, it worked
but I don't know how it will work for |
I've just tested locally, To get this to work I think we can do like this:
|
Also, I think this might be a bug in git. Do you know how to file a bug report there? |
Signed-off-by: Cristian Le <[email protected]>
Oh no, this doesn't work. I have uploaded d008bd1 just for reference. The ownership and timestamp of the prefix are broken, but can't figure a way to fix the paths without extraction |
@FrostyX If you want to chime in: https://lore.kernel.org/git/[email protected]/T/#t |
From the discussion on the mail, it seems that the origin of the tarfixer was because we are using a tree instead of the commit. If we are not using the tree as we do it in this PR, we can avoid it? What other headers do we need to have set? What extract/archive commands could we use to preserve the same tar format? |
This might not be the correct understanding of what this command does, but hopefully it is a good stepping stone to fix this. See #444 for more details on the issue.
Closes #444