Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

push to skip nested subrepos (as mentioned in Issue #553) #554

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

michelemartone
Copy link

No description provided.

Assuming both bar/ and bar/baz/ have been created with 'git-subrepo clone',
a 'git-subrepo push bar' takes contents of bar/baz/* as well, as if
bar/baz/ were not another subrepo.
This test confirms this current style.
With such expectation, git-subrepo would fail the test.
Assuming "bar" and "baz" in "bar/baz" are both subrepos, make
 "git-subrepo push bar" to skip "baz" -- for that, one would use
 "git-subrepo push bar/baz" instead.

See also test/push-nested.t.
@jfrey-xx
Copy link

jfrey-xx commented Jul 25, 2022

Hello,

I have been using git-subrepo for several personal and professional projects for a couple years. This is a very handy tool 👍 I just came across a situation where I need the feature proposed in this PR (I want to keep several repositories separated and cannot avoid having one inside a subfolder of the other). Because I don't want to break my existing use of git-subrepo (where sometimes I do leverage on the fact that nested subrepo are pushed), I added an option to enable the "skip nested subrepos on push". This option is passed upon clone or init and resides within the .gitrepo file (it can also be updated with git subrepo config).

The option is (ill?)named "shallow" at the moment, (-w or --shallow flag upon clone or init).

The commit is probably rough on the edges, I just began using it (so far so good), the documentation and test suite should be updated, but it might interest others, and maybe help to get this PR merged at some point.

The code is here: jfrey-xx@5579694 (edit: actually I just spotted a bug with existing subrepo, prefer https://github.com/jfrey-xx/git-subrepo/tree/nested )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants