ingydotnet / git-subrepo

MIT License
3.27k stars 270 forks source link

git subrepo branch --remote %parent_repo% --fetch --force #501

Open elmpp opened 4 years ago

elmpp commented 4 years ago

Thanks for this library - it's really helped me see into git machinations that have always scared me

I've a subrepo A. A is a fork of B. All pulls/pushes will be to A (and then synced by other processes A->B/B->A) so the meta file remains pointed to A (following initial subrepo clone)

However, for my project, i'm looking to compute the commit diffs from the subrepo with respect to B. Currently, i can very easily run git subrepo branch %package_path% --fetch --force and find the commit diffs using the ref subrepo/%package_path%/fetch against the branch head ref but this is for repo A obviously

I am wondering if there is any way to recreating the result of a --remote option on branch (or otherwise). This is the only repo B operation so am hoping to achieve my goal using command options rather that affecting the meta file

elmpp commented 4 years ago

friendly ping @admorgan @grimmySwe

elmpp commented 4 years ago

I'm wondering what's the best way to proceed here.

I could probably hack something together but it having a branch --remote maybe could be useful for other scenarios 🤷

admorgan commented 4 years ago

I am going to have to admit that I am having trouble visualizing what is going on here. subrepo fetch already supports a -b and -r option. It does not update your .gitrepo and does everything that you have requested as far as I can tell.