fix issue with .gitrepo parent field not being updated when using pu…#547
fix issue with .gitrepo parent field not being updated when using pu…#547tsadiko74 wants to merge 1 commit intoingydotnet:masterfrom
Conversation
…l --rebase on a diverged parent repo
|
BTW , I ran the test suite , all tests passed |
|
@admorgan , got a message that there is 1 workflow awaiting approval . could you please approve ? |
admorgan
left a comment
There was a problem hiding this comment.
The big question is what state is the repository in after a rebase. I personally believe this will work out 99.9% of the time. I also don't know how to reliably determine the 0.1% it wouldn't. I feel like this is a positive change, but I am curious what @ingydotnet thinks.
| # In case of pull using rebase, the field subrepo.parent SHA-1 could be wrong. | ||
| #FAIL=false \ | ||
| #SAY=false OUT=true RUN git config --file="$gitrepo" subrepo.parent | ||
| #subrepo_parent=$output |
There was a problem hiding this comment.
Forgot to remove commented out old code
| # Finding the right parent SHA-1 | ||
| SAY=false OUT=true RUN git log --oneline --pretty=format:"%h" -- "$gitrepo" | ||
| gitrepo_commit_list=$output | ||
| found_comm="Empty" |
There was a problem hiding this comment.
This code base likes everything spelled out, I would prefer found_comm be renamed to common_sha or something fully spelled out.
| fi | ||
| done | ||
| if [ "$found_comm" != "Empty" ]; then | ||
| SAY=false OUT=true RUN git rev-parse "$comm^" |
There was a problem hiding this comment.
I disagree that this would be the logical parent. I believe it would be the value + parent found in the grep on line 1365.
|
@ingydotnet How does it go with this proposed PR? Recently I am constantly in the situation where I can't push changes anymore because git-subrepo thinks that there are no commits. I have to pull by force and reapply all the changes that the resulting commit reverted. |
|
Just popping in to say that I'd love to see this get merged, if the maintainers think it solved the issue! |
|
I'll talk to @admorgan about it soon. |
|
(Just wanted to drop in and show my interest in this getting merged if the maintainers believe it's resolved the issue. Thank you a lot!) |
align our approach with ingydotnet/git-subrepo#547
fix issue with .gitrepo parent field not being updated when using
git pull --rebase(or if that option was set in git config) on a diverged parent repoIn case of a
git pullusing rebase on the parent repository , the field subrepo.parent SHA-1 could be wrong.That would cause an error on the next
git subrepo pullcommand , the workaround requires manual change of the .subrepo file, This proposed commit fixes that issueit may also be applicable for this reported issue -- #539 (comment)