{"action":"created","issue":{"url":"https://api.github.com/repos/ingydotnet/git-subrepo/issues/98","labels_url":"https://api.github.com/repos/ingydotnet/git-subrepo/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/ingydotnet/git-subrepo/issues/98/comments","events_url":"https://api.github.com/repos/ingydotnet/git-subrepo/issues/98/events","html_url":"https://github.com/ingydotnet/git-subrepo/issues/98","id":114548037,"number":98,"title":"Pull twice from subrepo loses changes from main repo","user":{"login":"grimmySwe","id":6480514,"avatar_url":"https://avatars.githubusercontent.com/u/6480514?v=3","gravatar_id":"","url":"https://api.github.com/users/grimmySwe","html_url":"https://github.com/grimmySwe","followers_url":"https://api.github.com/users/grimmySwe/followers","following_url":"https://api.github.com/users/grimmySwe/following{/other_user}","gists_url":"https://api.github.com/users/grimmySwe/gists{/gist_id}","starred_url":"https://api.github.com/users/grimmySwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grimmySwe/subscriptions","organizations_url":"https://api.github.com/users/grimmySwe/orgs","repos_url":"https://api.github.com/users/grimmySwe/repos","events_url":"https://api.github.com/users/grimmySwe/events{/privacy}","received_events_url":"https://api.github.com/users/grimmySwe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-11-02T08:31:50Z","updated_at":"2015-11-06T14:37:20Z","closed_at":null,"body":"Using subrepo v0.2.3 (679ad12fd684bd72feff90d445c373d9a3d2aa0f)\r\ngit version 1.9.3, 2.6.0\r\nAlso tested dzzh fork (f21fb34c676ea9949d870f38b1f934d89772c148)\r\n\r\nThe following workflow seems to lose things:\r\n\r\nI start with this\r\n```\r\nbar\r\n-----------------\r\nfoo\r\nfoo/bar\r\n```\r\n```cd foo; git add foo/bar/foo1```\r\n```cd bar; git add bar/bar1```\r\n\r\n```\r\nbar\r\nbar/bar1\r\n-----------------\r\nfoo\r\nfoo/bar\r\nfoo/bar/foo1\r\n```\r\n```cd foo; git subrepo pull bar```\r\n```\r\nbar\r\nbar/bar1\r\n-----------------\r\nfoo\r\nfoo/bar\r\nfoo/bar/bar1\r\nfoo/bar/foo1\r\n```\r\n```cd bar; git add bar/bar2```\r\n```cd foo; git subrepo pull bar```\r\n```\r\nbar\r\nbar/bar1\r\nbar/bar2\r\n-----------------\r\nfoo\r\nfoo/bar\r\nfoo/bar/bar1\r\nfoo/bar/bar2\r\n```\r\nSo where did foo/bar/foo1 go!!!!\r\n\r\nI will see if I can create a test case for this."},"comment":{"url":"https://api.github.com/repos/ingydotnet/git-subrepo/issues/comments/154425406","html_url":"https://github.com/ingydotnet/git-subrepo/issues/98#issuecomment-154425406","issue_url":"https://api.github.com/repos/ingydotnet/git-subrepo/issues/98","id":154425406,"user":{"login":"dzzh","id":1190663,"avatar_url":"https://avatars.githubusercontent.com/u/1190663?v=3","gravatar_id":"","url":"https://api.github.com/users/dzzh","html_url":"https://github.com/dzzh","followers_url":"https://api.github.com/users/dzzh/followers","following_url":"https://api.github.com/users/dzzh/following{/other_user}","gists_url":"https://api.github.com/users/dzzh/gists{/gist_id}","starred_url":"https://api.github.com/users/dzzh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzzh/subscriptions","organizations_url":"https://api.github.com/users/dzzh/orgs","repos_url":"https://api.github.com/users/dzzh/repos","events_url":"https://api.github.com/users/dzzh/events{/privacy}","received_events_url":"https://api.github.com/users/dzzh/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T14:37:20Z","updated_at":"2015-11-06T14:37:20Z","body":"You're right, it seems that doing several pulls without pushes will discard the changes made between them. I don't use this flow myself, so I didn't notice this issue. It looks like it might help if in my fork we remove previous_pull_commit (either from everywhere or from nearly all places) and use previous_push_parent instead. This is especially important during `subrepo:branch`. If we do so, then a cherry-pick commit applied on top of `upstream_head` will include all the changes you made no matter how many subrepo pulls were there before them. I'll try to find time in the weekend to change the code of my fork."}}