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

git-xargs doesn't update existing PRs #109

Open
2 tasks
jduan-highnote opened this issue Jan 17, 2023 · 1 comment · May be fixed by #149
Open
2 tasks

git-xargs doesn't update existing PRs #109

jduan-highnote opened this issue Jan 17, 2023 · 1 comment · May be fixed by #149
Labels
bug Something isn't working

Comments

@jduan-highnote
Copy link

Describe the bug
First of all, I recently discovered this amazing tool and I've used it to open a bunch of PRs across a few repos. That worked amazingly!

Now I got some review feedback and I'm trying to update those PRs by using git-xargs again. Here's what I did:

git-xargs \
  --branch-name "test-branch1" \
  --commit-message "Upgrade jira-description-action to use node16" \
  --repos ~/repos.txt \
  --pull-request-title "SINF-522 Upgrade jira-description-action to use node16" \
  --pull-request-description "Because the latest version uses node 16" \
  --loglevel DEBUG \
  /tmp/2.sh

The intention is that I want git-xargs to run /tmp/2.sh to addresses the feedback on the existing PR branch(es) and push the changes. That's the behavior of git-xargs when the branch already exists. However, git-xargs seems to ignore the existing remote branch and creates a new local branch with the same name. When it tries to push the branch to remote, it will report this error:

Error="non-fast-forward update"

Why is git-xargs not making changes to the existing branch?

To Reproduce
See above

// paste code snippets here

Expected behavior
git-xargs should make changes to the existing branch.

Nice to have

  • Terminal output
  • Screenshots

Additional context
Add any other context about the problem here.

@jduan-highnote jduan-highnote added the bug Something isn't working label Jan 17, 2023
@navrkald
Copy link

navrkald commented Feb 14, 2024

I can confirm the bug. I have checked as well the source code and bug is in logic of method checkoutLocalBranch which clones repository, then it creates on top of the remote repository HEAD (usually default branch is configured develop/master/main) new local branch and then it tries to pull remote brach, which might fail if it can't be fast forwarded from locally, created branch on top of HEAD, to remote branch.
Instead code should try to checkout branch locally after clone repo and if it will fail then it should create new branch...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants