fresh icon indicating copy to clipboard operation
fresh copied to clipboard

Add a command "fresh lock" or similar

Open markgandolfo opened this issue 10 years ago • 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.

markgandolfo avatar Nov 07 '14 05:11 markgandolfo

:+1:

twe4ked avatar Nov 07 '14 18:11 twe4ked

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.

twe4ked avatar Nov 08 '14 08:11 twe4ked

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.

jamesottaway avatar Apr 08 '18 23:04 jamesottaway

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.)

jasoncodes avatar Apr 09 '18 00:04 jasoncodes