-
Notifications
You must be signed in to change notification settings - Fork 277
fix issue with .gitrepo parent field not being updated when using pu… #547
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
base: master
Are you sure you want to change the base?
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 ? |
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!) |
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 pull
using rebase on the parent repository , the field subrepo.parent SHA-1 could be wrong.That would cause an error on the next
git subrepo pull
command , 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)