So fricking annoying that git doesn't support `git archive` to a directory
@r0k i don't want to clone. i mean yes it would work but it would be about as inconvenient as creating a zip, either i create a zip and then i throw away the .zip or i create a clone and i throw away the .git
@mcc you mean copying out the current repo state into a directory someplace else? Do you mean like this?
https://github.com/git/git/blob/master/Documentation/git-archive.adoc?plain=1#L190-L194
@mcc @gnomon I was gonna suggest this direction (pipe to archive-extraction command) before squinting harder at the examples section and going "ah. they thought of that already!"
As to why that isn't a built-in option…yeaaaa…
TBF: I'd literally not even heard of `git archive` before today so maybe it doesn't get a lot of love?
@bitprophet @mcc `git archive` is pretty often used to by projects I follow to create release archives in a repeatable way. The export-ignore and export-subst facilities¹ offer hooks and tooling to streamline this use case. I think git-archive does get care and polish to support the specific use cases it's currently aimed to fulfill, but it's not a long list, and perhaps the docs focus more on how the features work than why they were created.
¹: https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#_exporting_your_repository
@gnomon @bitprophet one thing I do feel is missing versus the mercurial equivalent is a dotfile documenting which hash it was built from
@mcc @bitprophet I think that's what the export-subst feature provides in the link above? That's how I've used it, anyhow. I agree it would be nicer if that feature were built in and named rather than provided as a bucket of tools though.
(edit: lol there's a markup error in the Pro Git 2nd. Ed. book at that link in the final example of the export-subst section! Right, filing a pull request to fix that up.)
@mcc @gnomon @bitprophet I'm sure you know, but you can mark a file with export-subst in .gitattributes then use a magic placeholder that is replaced with the output of git describe:
https://github.com/endlessm/moddable-platformer/blob/824ebb1756283c108ea975f095127c540fc4d254/.gitattributes#L15
https://github.com/endlessm/moddable-platformer/blob/824ebb1756283c108ea975f095127c540fc4d254/project.godot#L14
@wjt @gnomon @bitprophet I did not know this, I don't use git. Actually I'm still not entirely sure I understand it