{"action":"created","issue":{"url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/545","repository_url":"https://api.github.com/repos/gitpython-developers/GitPython","labels_url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/545/labels{/name}","comments_url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/545/comments","events_url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/545/events","html_url":"https://github.com/gitpython-developers/GitPython/issues/545","id":185167796,"number":545,"title":"git.Repo.submodule_update check for remote branch even though \"to_latest_revision=False\"","user":{"login":"jlycke","id":5918737,"avatar_url":"https://avatars.githubusercontent.com/u/5918737?v=3","gravatar_id":"","url":"https://api.github.com/users/jlycke","html_url":"https://github.com/jlycke","followers_url":"https://api.github.com/users/jlycke/followers","following_url":"https://api.github.com/users/jlycke/following{/other_user}","gists_url":"https://api.github.com/users/jlycke/gists{/gist_id}","starred_url":"https://api.github.com/users/jlycke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlycke/subscriptions","organizations_url":"https://api.github.com/users/jlycke/orgs","repos_url":"https://api.github.com/users/jlycke/repos","events_url":"https://api.github.com/users/jlycke/events{/privacy}","received_events_url":"https://api.github.com/users/jlycke/received_events","type":"User","site_admin":false},"labels":[{"id":1180685,"url":"https://api.github.com/repos/gitpython-developers/GitPython/labels/acknowledged","name":"acknowledged","color":"02e10c","default":false}],"state":"closed","locked":false,"assignee":{"login":"Byron","id":63622,"avatar_url":"https://avatars.githubusercontent.com/u/63622?v=3","gravatar_id":"","url":"https://api.github.com/users/Byron","html_url":"https://github.com/Byron","followers_url":"https://api.github.com/users/Byron/followers","following_url":"https://api.github.com/users/Byron/following{/other_user}","gists_url":"https://api.github.com/users/Byron/gists{/gist_id}","starred_url":"https://api.github.com/users/Byron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Byron/subscriptions","organizations_url":"https://api.github.com/users/Byron/orgs","repos_url":"https://api.github.com/users/Byron/repos","events_url":"https://api.github.com/users/Byron/events{/privacy}","received_events_url":"https://api.github.com/users/Byron/received_events","type":"User","site_admin":false},"assignees":[{"login":"Byron","id":63622,"avatar_url":"https://avatars.githubusercontent.com/u/63622?v=3","gravatar_id":"","url":"https://api.github.com/users/Byron","html_url":"https://github.com/Byron","followers_url":"https://api.github.com/users/Byron/followers","following_url":"https://api.github.com/users/Byron/following{/other_user}","gists_url":"https://api.github.com/users/Byron/gists{/gist_id}","starred_url":"https://api.github.com/users/Byron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Byron/subscriptions","organizations_url":"https://api.github.com/users/Byron/orgs","repos_url":"https://api.github.com/users/Byron/repos","events_url":"https://api.github.com/users/Byron/events{/privacy}","received_events_url":"https://api.github.com/users/Byron/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/gitpython-developers/GitPython/milestones/20","html_url":"https://github.com/gitpython-developers/GitPython/milestone/20","labels_url":"https://api.github.com/repos/gitpython-developers/GitPython/milestones/20/labels","id":2072439,"number":20,"title":"v2.1.1 - Bugfixes","description":"","creator":{"login":"Byron","id":63622,"avatar_url":"https://avatars.githubusercontent.com/u/63622?v=3","gravatar_id":"","url":"https://api.github.com/users/Byron","html_url":"https://github.com/Byron","followers_url":"https://api.github.com/users/Byron/followers","following_url":"https://api.github.com/users/Byron/following{/other_user}","gists_url":"https://api.github.com/users/Byron/gists{/gist_id}","starred_url":"https://api.github.com/users/Byron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Byron/subscriptions","organizations_url":"https://api.github.com/users/Byron/orgs","repos_url":"https://api.github.com/users/Byron/repos","events_url":"https://api.github.com/users/Byron/events{/privacy}","received_events_url":"https://api.github.com/users/Byron/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":5,"state":"closed","created_at":"2016-10-16T10:52:33Z","updated_at":"2016-12-08T15:50:09Z","due_on":null,"closed_at":"2016-12-08T15:50:09Z"},"comments":4,"created_at":"2016-10-25T16:27:30Z","updated_at":"2016-12-09T08:38:56Z","closed_at":"2016-12-08T11:48:07Z","body":"As I understand the doc, \"to_latest_revision\" should work similar to --remote as in \"git submodule update --remote\". However, GitPython still check remote branches even though \"to_latest_revision\" is set to False.\n\nBasically I want to do this:\n$ git submodule update --init --recursive\n\nBut since I have a branch in my .gitmodules file that doesn't exist remote then I get the following error:\n\n  File \"C:/Users/myuser/fetch_submodules.py\", line 84, in setup_repo\n    repo.submodule_update(recursive=True, force_reset=True, force_remove=True)\n  File \"C:\\Python27\\lib\\site-packages\\git\\repo\\base.py\", line 305, in submodule_update\n    return RootModule(self).update(_args, *_kwargs)\n  File \"C:\\Python27\\lib\\site-packages\\git\\objects\\submodule\\root.py\", line 327, in update\n    progress=progress, dry_run=dry_run, force=force_reset, keep_going=keep_going)\n  File \"C:\\Python27\\lib\\site-packages\\git\\objects\\submodule\\base.py\", line 529, in update\n    remote_branch = find_first_remote_branch(mrepo.remotes, self.branch_name)\n  File \"C:\\Python27\\lib\\site-packages\\git\\objects\\submodule\\util.py\", line 38, in find_first_remote_branch\n    raise InvalidGitRepositoryError(\"Didn't find remote branch '%r' in any of the given remotes\" % branch_name)\ngit.exc.InvalidGitRepositoryError: Didn't find remote branch ''.'' in any of the given remotes\n\nShould GitPython care about my .gitmodules branch when I don't specify \"to_latest_revision=True\"?\n\nWhy I need to have a branch in .gitmodules that doesn't exist remote maybe doesn't make much sense but it has to do with Gerrit Code-Review submodule subscription that automatically updates the super repo for each submodule commit. See https://gerrit-documentation.storage.googleapis.com/Documentation/2.13.2/user-submodules.html#_defining_the_submodule_branch for further details.\n\n**.gitmodules**\n[submodule \"common\"]\n        path = common\n        url = ssh://gitrepourl/repo\n        branch = .\n\nI hope i don't misunderstand \"to_latest_revision\".\n"},"comment":{"url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/comments/265961767","html_url":"https://github.com/gitpython-developers/GitPython/issues/545#issuecomment-265961767","issue_url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/545","id":265961767,"user":{"login":"jlycke","id":5918737,"avatar_url":"https://avatars.githubusercontent.com/u/5918737?v=3","gravatar_id":"","url":"https://api.github.com/users/jlycke","html_url":"https://github.com/jlycke","followers_url":"https://api.github.com/users/jlycke/followers","following_url":"https://api.github.com/users/jlycke/following{/other_user}","gists_url":"https://api.github.com/users/jlycke/gists{/gist_id}","starred_url":"https://api.github.com/users/jlycke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlycke/subscriptions","organizations_url":"https://api.github.com/users/jlycke/orgs","repos_url":"https://api.github.com/users/jlycke/repos","events_url":"https://api.github.com/users/jlycke/events{/privacy}","received_events_url":"https://api.github.com/users/jlycke/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T08:38:55Z","updated_at":"2016-12-09T08:38:55Z","body":"@Byron I already use repo.git.submodule('update', '--init', '--recursive') which works for me, no problem reverting the commit. And thanks for creating #556 ."}}
{"actor":{"display_login":"jlycke"}}