freshshell/fresh

Add a command "fresh lock" or similar

markgandolfo opened this issue · 4 comments

Add a command "fresh lock" or similar that will grab the revisions of each external file to lock everything in place.

I often roll out vm's and fresh only to find a file in a remote repo has changed substaintially or been removed. I then go search the repo for the version I need.

It would be great if I can "lock" my fresh file somehow and push that to github.

👍

Okay, what are the things we need to think about with this @jasoncodes?

  • Local sources
  • Non git sources (future)

I'm guessing running fresh install would only write a lock file if it doesn't already exist.
And fresh update would always write the lock file.
--ref= would still apply in all cases.

What would the structure of the lock file be? It would need to know about every file (even inside directories) and what ref they're locked at. Perhaps a git url, file path and SHA?

I could be missing a lot here.

I'm setting up my new work laptop and this would be amazing. So many broken refs given I (and likely most people) don't lock their refs.

This and #47 are my 2 most desired new features.

I think we only need to store a canonical representation for the fresh line (anything which can change the effective commit we are looking at which seems to be repo, path, and ref) and the resolved commit for that which will be the HEAD if no --ref was supplied. I don’t think we need to track the last commit for every file in a glob/dir fresh line like we output in fresh show. (We do need to make sure fresh show still does this resolution with a lock file present though.)