git-xargs icon indicating copy to clipboard operation
git-xargs copied to clipboard

Question: Can the target branch be specified for the generated PRs?

Open prgx-erodri02 opened this issue 3 years ago • 3 comments

git-xargs seems to be exactly what I need to use. I've been testing it to update files and automatically generate pull requests.

What I have seen is that the pull requests generated are always between the branch specified with "--branch-name" and "master".

Is it possible to specify that target branch to be different to "master"? Or a way to specify that the target should be the default branch (which is not always "master" on some of our repos).

Thanks.

prgx-erodri02 avatar Apr 23 '21 09:04 prgx-erodri02

git-xargs seems to be exactly what I need to use. I've been testing it to update files and automatically generate pull requests.

What I have seen is that the pull requests generated are always between the branch specified with "--branch-name" and "master".

Is it possible to specify that target branch to be different to "master"? Or a way to specify that the target should be the default branch (which is not always "master" on some of our repos).

Thanks.

Hi thanks for your question - unfortunately this is currently hardcoded to master - but as this comment suggests there are definitely ways to improve and make this more configurable. We can look to add that flexibility in the future!

zackproser avatar Apr 23 '21 14:04 zackproser

Proposal: Add the branch to the repo string in the repo file like:

gruntwork-io/infrastructure-as-code-training/tree/main
gruntwork-io/infrastructure-live-acme/tree/some-other-branch

This way you could use different base-branches for every repository and the user can copy the url from his browser. Maybe you could ignore https://github.com/ in the beginning, then the user could just navigate to the branch and copy and paste the url.

radicarl avatar May 07 '21 13:05 radicarl

Quick question for @nirnanaaa or @zackproser about the use of the base branch flag. In the current implementation #64 when overriding with the base-branch flag, is the repo command run against the a branch out from configured base branch or default branch (main/master)?

For example;

git-xargs \
--branch file-update \
--commit-message "file update" \
--repo my-user/my-repo \
--base-branch-name "develop" \
touch file1.txt

Would this be equivalent to the following manual steps?

# clone the repo
git clone my-user/my-repo

# create working branch from provided base branch
git checkout -b file-update develop

# run the provided repo command
touch file1.txt

# commit and push the files
git add .
git commit -m "file update"
git push origin file-update

# create PR from file-update to develop branch

I tried this recently, but I noticed that some additional commits are included in the created PR, while I was expecting only a single commit to be present.

muhannad0 avatar Dec 25 '22 08:12 muhannad0