-
Notifications
You must be signed in to change notification settings - Fork 15
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
git.py: Allow setting of submodule push branch #228
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The synchronization of submodule.<name>.branch
with the --push-branch
API makes sense in the context of the new feature introduced in #225.
One question about the default contract when modifying .gitmodules
. As for the previous improvements to support tracking branches, we could also capture the expected behavior via integration tests.
scc/git.py
Outdated
@@ -1007,7 +1007,8 @@ def find_candidate_branches(self, filters, | |||
|
|||
class GitRepository(object): | |||
|
|||
def __init__(self, gh, path, remote="origin", repository_config=None): | |||
def __init__(self, gh, path, remote="origin", push_branch="origin", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case where --push-branch
is not passed to the original command, am I correct that with the current implementation scc merge <xxx> --update-gitmodules
would unconditionally write branch = origin
in the .gitmodules
?
My expectation would be that in that case, we might not want to modify this key i.e. set the default here to None
and conditionally skip the setting of submodule.<name>.branch
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the additional commit.
Functionally tested using the sandbox repository. Without (venv) sbesson@ls30630:snoopys-sandbox ((aed9f2f...)) $ python /opt/ome/snoopycrimecop/scc/main.py merge dev_4_4 --update-gitmodules
2018-02-14 13:56:42,538 [ scc.merge] INFO Merging Pull Request(s) based on dev_4_4
...
2018-02-14 13:56:55,976 [ scc.merge] INFO
(venv) sbesson@ls30630:snoopys-sandbox ((3ea130c...)) $ git diff HEAD^
diff --git a/snoopys-sandbox-2 b/snoopys-sandbox-2
index 33abb18..1b59ef2 160000
--- a/snoopys-sandbox-2
+++ b/snoopys-sandbox-2
@@ -1 +1 @@
-Subproject commit 33abb18f09519d2174a86e1933a6d62dc959f2f9
+Subproject commit 1b59ef2408a95c22030614b3be75a50e658f6cd0 With
Using my local As a side note, I realized that the submodule URL are not updated for this sandbox repository. This is likely related to pattern of the URL which does not match the expectation from the library (not ending in |
Reading that as good to go for 0.9.2. Merging & releasing. |
--push is used to set the branch in
.gitmodules
.