At Thu, 13 Jun 2019 11:24:03 -0600, Eric Eide wrote:
> As described here <https://docs.racket-lang.org/pkg/git-workflow.html>,
> 
> > When a Git repository is specified as a package source, then a copy of the
> > repository content is installed as the package implementation. That
> > installation mode is designed for package consumers, who normally use a
> > package without modifying it.
> 
> My understanding is that "the copy of the repository content" is
> produced simply, e.g., by checking out the repository at the
> appropriate commit and then discarding the `.git` directory.

In case it helps clarify: The repository content is obtained not using
`git` in a shell, which would create portability and dependency
problems for Racket, but using `git-checkout` from the
`net/git-checkout` library. The `git-checkout` function doesn't create
a ".git" subdirectory for metadata.

Since only the "content" (is there a better technical term?) of a
commit is checked out, there's no ".git" to remove. Operationally,
though, I think you mean that it's equivalent to `git clone` followed
by removing the ".git" directory, which sounds right.

> An alternative would be to produce the repository content by running `git
> archive`.  This would allow certain transformations to be made on the content,
> e.g., inserting the commit hash into one of the exported files.  One could do
> other minor tricks as well, like excluding "junk" files.  See the ATTRIBUTES
> section of the man page at <https://git-scm.com/docs/git-archive>.
> 
> Is there a reason why the Racket package system doesn't run `git archive` to
> produce the content for the "non-developer" version of a package?

The simplistic answer is that `git-checkout` doesn't support a `git
archive`-like mode. And a practical answer is that no one is likely to
implement it in the near term. :)

Note that there's a notion of "source package" and "built package"
pruning at the Racket package-system level, and it at least includes a
`git archive`-like option in "info.rkt" for omitting files.[*] By
default, bundling a package skips a ".git" subdirectory. There could be
a `git archive` layer in addition, though.

[*] https://docs.racket-lang.org/pkg/strip.html

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20190613182959.10F60650110%40mail-svr1.cs.utah.edu.
For more options, visit https://groups.google.com/d/optout.

Reply via email to