tsrc icon indicating copy to clipboard operation
tsrc copied to clipboard

Create helpers for managing untracked repos

Open mkjmdski opened this issue 4 years ago • 7 comments

Is your feature request related to a problem? Please describe. Sometimes I clone repositories inside tsrc workdir that are not tracked in manifest and it would be great if tsrc had some tools that could help manage this repositories.

Describe the solution you'd like tsrc list-untracked ideally would walk recursively through the filetree and print git repositories that are not managed by tsrc. This way I could add them to manifest in easy way. tsrc delete-untracked could work like tsrc list-untracked but would delete untracked repositories instead.

mkjmdski avatar Sep 11 '21 07:09 mkjmdski

Looks nice. I think we need to implement breadth-first search for untracked git repository (a simple call to os.walk maybe too slow). Wanna try working on a PR ?

dmerejkowsky avatar Sep 11 '21 12:09 dmerejkowsky

I think I could try with os.walk, breadth-first search might be too much time consuming for me.

mkjmdski avatar Sep 11 '21 18:09 mkjmdski

Could you recommend what would be the best approach to implement that in terms of repository structure?

mkjmdski avatar Sep 11 '21 19:09 mkjmdski

I think I could try with os.walk, breadth-first search might be too much time consuming for me.

No problem. Go for it :) We can merge a first patch with some simple code and worry about performance later.

Could you recommend what would be the best approach to implement that in terms of repository structure?

Not sure what you mean. Do you want to talk about architecture (where to put the code in terms of modules/classes/functions) ?

dmerejkowsky avatar Sep 11 '21 19:09 dmerejkowsky

Yeah, exactly this is what my question is about. :).

mkjmdski avatar Sep 13 '21 08:09 mkjmdski

This is a bit hard to discuss on GitHub. I've created a room on Gitter - it should be easier to talk about architecture there.

dmerejkowsky avatar Sep 16 '21 09:09 dmerejkowsky

Just a quick comment to give a usage case that could be fixed thanks to this ticket:

  • Current manifest:
  - url: [email protected]:foo/bar
    dest: bar
  • Modified manifest:
  - url: [email protected]:foo/bar
    dest: new/path/here/bar
  • tsrc sync:

We have two folders: bar/ and new/path/here/bar/ Therefore tsrc list-untracked should be called by sync

Lecrapouille avatar Jan 15 '22 10:01 Lecrapouille