Skip to content
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

Skip unrelated files when using git archive #1287

Closed
wants to merge 1 commit into from

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Apr 21, 2023

An option for #1175:

$ git fetch origin pull/1287/head
$ git archive --output=libsecp256k1-PR1287.tar.gz FETCH_HEAD 
$ sha256sum libsecp256k1-PR1287.tar.gz 
6e6fd21afd935e572b138258f782fed60bb11fa88aa51a9866f10cca5d25c39c  libsecp256k1-PR1287.tar.gz
$ git archive --output=libsecp256k1-PR1287.zip FETCH_HEAD 
$ sha256sum libsecp256k1-PR1287.zip 
e108fc4902502640eee2cf4bb69501a494904c4dcd0763c072cc4acaed565861  libsecp256k1-PR1287.zip

Copy link
Contributor

@jonasnick jonasnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what sense are these files unrelated? Is it worth maintaining a list of files in .gitattributes that are "unrelated"?

Fwiw git archive is not deterministic:

❯ git fetch origin pull/1287/head && git archive --output=libsecp256k1-PR1287.tar.gz FETCH_HEAD && sha256sum libsecp256k1-PR1287.tar.gz
From github.com:bitcoin-core/secp256k1
 * branch              refs/pull/1287/head -> FETCH_HEAD
5df771480968b3ff3df53c2808284e855912f037fa2c206b35205ae856e2aa52  libsecp256k1-PR1287.tar.gz
❯ git archive --output=libsecp256k1-PR1287.zip FETCH_HEAD  && sha256sum libsecp256k1-PR1287.zip
7d7167119528c18710f8f5191e2a574405f016f17a7b520a970aca22afa8778e  libsecp256k1-PR1287.zip

@hebasto
Copy link
Member Author

hebasto commented Apr 23, 2023

In what sense are these files unrelated? Is it worth maintaining a list of files in .gitattributes that are "unrelated"?

From #1175 (comment):

It's a bit silly to not include files like .gitignore and .cirrus.yml. I mean this is for devs of the library, you would want to have these files.

@hebasto
Copy link
Member Author

hebasto commented Apr 23, 2023

Fwiw git archive is not deterministic:

Hmm, that's unexpected (

git archive uses the passed commit time as the modification time of each file in the archive. And gzip is deterministic as well.

What is the source of non-determinism in your opinion?

@real-or-random
Copy link
Contributor

From #1175 (comment):

It's a bit silly to not include files like .gitignore and .cirrus.yml. I mean this is for devs of the library, you would want to have these files.

Maybe you just got my comment the wrong way around? I said, "it's silly NOT to include (...)", so I'm arguing to include the files in the archive! I think they belong to the repo. Even as a local developer without git, you could potentially be interested in what is run on CI or what the maintainers believe should be in .gitignore (and other tools such as ripgrep use .gitignore, etc...) Happy to hear arguments for the other direction, of course. :)

@hebasto
Copy link
Member Author

hebasto commented Apr 24, 2023

My bad! Sorry.

@real-or-random
Copy link
Contributor

My bad! Sorry.

No worries. :)

@hebasto hebasto deleted the 230421-archive branch April 29, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants