buildinspace / peru

a generic package manager, for including other people's code in your projects
MIT License
1.11k stars 69 forks source link

Option to copy the full git clone, not just the files? #247

Open jankap opened 12 months ago

jankap commented 12 months ago

During development, there's often a going back and forth between dependencies (e.g. libraries) and its consuming parts, let's call them app.

This paragraph is written from the app's perspective and the lib folder is the target folder of my dependencies:

I understand that there's a (global - if set so) caching directory, where peru clones all deps into. Then it copies the required files to the lib directory. Making changes in the libs then is complicated because there's not git tracking information anymore. I understand that the option override can be used to temporarily copy files from another local location to the lib folder, but that means that

  1. the original lib has to be cloned manually somewhere
  2. there are two locations with the same file names and very similar folder structure

Number 1. is just a bit annoying, but very often the clone exists somewhere anyways, but 2. is error prone - it happens to me that I made some changes to the original lib location and at the same time to the copied lib location, because I'm working on both projects at the same time. Because debugging takes place in the lib copy, development has to take place in the original cloned location if I want to avoid manual copy & paste or folder compares

A probable fix would be to add another option materialize, or make_full_clone, or whatever, that copies the full git folder of the dependencies (which exists in the cache anyways) to the lib folder. Or maybe a flag dev or so, similar to recursive could be reasonable, too.

What do you think?