[racket-dev] Splitting the Racket repository
At Sat, 29 Nov 2014 22:00:44 -0500, Eli Barzilay wrote:
> On Sat, Nov 29, 2014 at 8:30 PM, Sam Tobin-Hochstadt
> <samth at cs.indiana.edu> wrote:
> > On Sat, Nov 29, 2014 at 8:16 PM, Eli Barzilay <eli at barzilay.org> wrote:
> >> On Sat, Nov 29, 2014 at 7:14 PM, Sam Tobin-Hochstadt
> >> <samth at cs.indiana.edu> wrote:
> >>> To clone individual repositories, use the new `--clone` option for
> >>> `raco pkg`, such as:
> >>> [...]
> >>
> >> This is very obscure. Is there a compact description of what to do
> >> when you want to make a change in a file that is not on the main
> >> repo?
> >
> > You just need to edit and change the relevant repository -- nothing
> > else is required. You don't have to use --clone or any other
> > mechanism. [...]
>
> This doesn't answer my question -- so I think that I wasn't clear
> enough. Say that I have some change to a specific file. I want to know
> how to do it in the following two ways:
>
> [...]
>
> 2. The thing that is more relevant for others (and that's the important
> one): I have a normal installation, I find a bug -- what do I do now?
> [...]
A strategy is explained in the "Developing Packages with Git" section
of the package-manager documentation. To elaborate for the running
example:
If you have "remote-shell" installed via "pkgs.racket-lang.org" and you
want to modify it, then
raco pkg update --clone <...>/remote-shell
creates a clone at `<...>/remote-shell'. You can then use just
`remote-shell` to make a subdirectory of the current directory.
If you do that with the version of `raco pkg` as of this morning, it
will suggest that you use `--multi-clone ask`. (As of just now,
`--multi-clone ask` is the default.) When you're in `--multi-clone ask`
mode, `raco pkg` will suggest that "remote-shell", "remote-shell-lib",
and "remote-shell-doc", are all cloned together.
The argument after `--clone` is a directory path, but if no other
arguments are provided to `raco pkg update`, a package name is inferred
from the directory path (and a Git repo is inferred from that package
name).
In the example above, if you want to clone "remote-shell" to the
current directory instead of a subdirectory of the current directory,
supply the package name explicitly after "." as the directory path:
raco pkg update --clone . remote-shell
That is, a clone of the package "remote-shell" is made in the current
directory as linked as the package installation.
If you installed a Git-based package via "pkgs.racket-lang.org" using a
version of `raco pkg` that's older than a week or so, then `raco pkg`
didn't record that the package came from a Git-repo URL, and so the
simple `--clone` form above doesn't work. More significantly, if you
install a snapshot of Racket, then the simple `--clone` form won't work
with a package that is provided in built form by the snapshot's
catalog. I'm working on a refinement to better address those
situations.