Skip to content
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

enhance(scripts/termux_pkg_upgrade_version): Fetch before attempting to push. #22818

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TomJo2000
Copy link
Member

closes #22816
Should stop long running autoupdates from getting bounced because a faster autoupdate jumped the queue.

…to push.

Should stop long running autoupdates from getting bounced because a faster autoupdate jumped the queue.
@TomJo2000 TomJo2000 requested a review from Grimler91 as a code owner January 9, 2025 14:47
@TomJo2000 TomJo2000 requested review from truboxl and twaik and removed request for Grimler91 January 9, 2025 14:48
@truboxl
Copy link
Contributor

truboxl commented Jan 9, 2025

I believe that git pull already includes git fetch. It may be better to understand and tackle the error message first.

INFO: Committing package.
INFO: Pushing package.
ERROR: git push failed. See below for details.
error: cannot pull with rebase: You have unstaged changes.
error: Please commit or stash them.
To https://github.com/termux/termux-packages
! [rejected]              master -> master (fetch first)
error: failed to push some refs to 'https://github.com/termux/termux-packages'
hint: Updates were rejected because the remote contains work that you do not
hint: have locally. This is usually caused by another repository pushing to
hint: the same ref. If you want to integrate the remote changes, use
hint: 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

https://stackoverflow.com/questions/23517464/error-cannot-pull-with-rebase-you-have-unstaged-changes

@Grimler91
Copy link
Member

We can add --autostash to the git pull cmd (as is also suggested in the stackoverflow question), it would be the same as

git stash push
git pull --rebase
git stash pop

and should fix rebase error due to uncommitted changes

@TomJo2000
Copy link
Member Author

We can add --autostash to the git pull cmd (as is also suggested in the stackoverflow question), it would be the same as

git stash push
git pull --rebase
git stash pop

and should fix rebase error due to uncommitted changes

What uncommitted changes are we dealing with exactly anyways?
Shouldn't we have already committed the pending auto update at this point in the workflow?

@Grimler91
Copy link
Member

What uncommitted changes are we dealing with exactly anyways?
Shouldn't we have already committed the pending auto update at this point in the workflow?

Possibly from previous failed test builds, we are only committing if build succeed, and not cleaning the packages dir otherwise, I think (and if that is the case maybe git checkout the build.sh for the failed package would fix the issue as well)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants