In a scenario where onee has several parallel PRs, one needs to use
several local branches, and when updating PRs, _needs to provide PR
branch name explicitly_ each time (my-PR-name-* in the example):
git checkout featureFoo
[ edit session ]
git commit
./g review my-PR-name-1
git checkout featureBar
[ edit session ]
git commit
./g review my-PR-name-2
This changes the processing, so that when the user's local branch name
is different from the tracked branch name, it is treated as if user
used that name explicitly in a call:
git checkout -b featureFoo origin/master
git checkout -b featureBar origin/distro/collabora/co-6-4
[ ... ]
git checkout featureFoo
[ edit session ]
git commit
./g review # this uses "featureFoo" as implicit second argument
git checkout featureBar
[ edit session ]
git commit
./g review # this uses "featureBar" as implicit second argument
so no need to remember which PR name was used where.
This only works for local branch names that are not equal to a remote
branch name, or to the last part (after last /) of any distro branch.
Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I8b95f92f6e205e3c93ef30f4813f3549c2315872
In case the local branch name and the remote branch name is different.
E.g. if you had co-6-4 tracking origin/distro/collabora/co-6-4, then the
correct advice is './g review distro/collabora/co-6-4', not './g review
co-6-4'.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I6b5556f992e30756542ed8e1f1cc15e61ce9bffa
And make the pull request query a bit more generic, so this can be
reused for other repos as well.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic231367bcf50f86b41430b48f752bb05d4e8d25f
This helps in case you deleted a remote branch using the GitHub web UI,
so the local view is outdated.
Change-Id: I98be33ea5712c66589f42b64e3462b76b84fbcc5
E.g. local branch is OK to be 'co-4-2' while it tracks
origin/distro/collabora/co-4-2.
Previously this was only working when the local branch was not renamed.
Change-Id: I11c24d71e903d27d34ec498604190d6b436b593d
Use-case: create a commit, submit to CI, then forget about it (git reset
--hard origin/master). Then create a next commit, and submit that to CI
as well -- instead of silently updating the previous PR.
Now the silent update doesn't happen anymore:
- If the update is intentional, have to specify the same branch name
explicitly. (E.g. you're on master, then specify 'master'.)
- If the update is not intentional, choose a different name.
Change-Id: Iee9d9ef13286a6a5083c6f9a28682ba65b8504ff
Similar to gerrit's 'git review' which creates/updates a change without
clicking anywhere in a browser.
Also add a './g pull' to help those who are used to that.
Change-Id: I240ff55c7480d0a2cd6de3f2ea3cd84ca0556af4