-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1349,10 +1349,32 @@ read-gitrepo-file() { | |
|
||
SAY=false OUT=true RUN git config --file="$gitrepo" subrepo.commit | ||
subrepo_commit=$output | ||
|
||
FAIL=false \ | ||
SAY=false OUT=true RUN git config --file="$gitrepo" subrepo.parent | ||
subrepo_parent=$output | ||
|
||
# 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 | ||
|
||
# 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 commentThe 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. |
||
for comm in $gitrepo_commit_list; do | ||
parent_change_commit=$( | ||
git diff -U0 $comm^! "$gitrepo" | | ||
grep "parent = " | ||
) || true | ||
if [ ! -z "$parent_change_commit" ]; then | ||
found_comm=$comm | ||
break | ||
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 commentThe 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. |
||
subrepo_parent=$output | ||
else | ||
subrepo_parent= | ||
fi | ||
|
||
FAIL=false \ | ||
SAY=false OUT=true RUN git config --file="$gitrepo" subrepo.method | ||
|
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