add/update command
michaelpj opened this issue · 2 comments
michaelpj commented
Thinking about making the workflow as slick as possible for people trying to add/update versions.
It might be nice to have a foliage command for that. Usage patterns I can imagine:
-- Add a package from the specified github repo at the given rev, reading the version from the cabal file
foliage add --github-repo input-output-hk/cardano-base --rev v1.0.0 --subdir cardano-crypto-class
-- Add all the packages from the given repository at the given rev
foliage add --github-repo input-output-hk/cardano-base --rev v1.0.0
-- Go look at the github repo where cardano-crypto-class comes from, pull the latest sha, and add a version at that sha.
-- This is kind of questionable, you need both some additional metadata that this package came from a particular github repo,
-- and the behaviour depends on the current tip of master or whatever.
foliage update cardano-crypto-class
--- Slightly less questionable version where you have to give the rev
foliage update cardano-crypto-class --rev v1.0.0
For the "update" commands to work we'd have to have some recorded state that tells us the provenance of the package, which would complicate things for sure. We might end up reinventing niv
a bit... and it doesn't actually cut down the command length that much. So perhaps not worth it.
michaelpj commented
We discussed this a bit:
- It seems like we only really need
add
:update
just saves you a CLI argument, at the cost of having to have metadata in the repo to support it - Handling timestamps continues to be irritating, probably we just take the timestamp when the command is run
andreabedini commented
We decided to implement this outside foliage. E.g. as a script in the metadata repository.