#2556 RFE: have the Git server output the link to create or update a Pull Request
Closed: Fixed 4 years ago Opened 4 years ago by abompard.

GitLab has a very cool feature: when you push to a new branch of your fork, the git backend outputs the URL to create a new pull request on that branch. Simple and time saving. The URL is different if there is no existing pull request for that branch or if it's an update.

Example with a new branch:

$     git push --set-upstream origin dirty-patches
Décompte des objets: 26, fait.
Delta compression using up to 4 threads.
Compression des objets: 100% (26/26), fait.
Écriture des objets: 100% (26/26), 2.37 KiB | 221.00 KiB/s, fait.
Total 26 (delta 18), reused 0 (delta 0)
remote: 
remote: To create a merge request for dirty-patches, visit:
remote:   https://gitlab.com/abompard/mailman/merge_requests/new?merge_request%5Bsource_branch%5D=dirty-patches
remote: 
To gitlab.com:abompard/mailman.git
 * [new branch]          dirty-patches -> dirty-patches
La branche dirty-patches est paramétrée pour suivre la branche distante dirty-patches depuis origin.

Example when rebasing a branch with an existing pull request:

$ git push --force
Décompte des objets: 26, fait.
Delta compression using up to 4 threads.
Compression des objets: 100% (26/26), fait.
Écriture des objets: 100% (26/26), 2.79 KiB | 2.79 MiB/s, fait.
Total 26 (delta 19), reused 0 (delta 0)
remote: 
remote: View merge request for fix-incoming-invalid-addresses:
remote:   https://gitlab.com/mailman/mailman/merge_requests/61
remote: 
To gitlab.com:abompard/mailman.git
 + b0134bf87...c602770e5 fix-incoming-invalid-addresses -> fix-incoming-invalid-addresses (forced update)

The remote lines are output by the git server, it's probably just a hook (I don't know the implementation details).


Metadata Update from @pingou:
- Issue tagged with: RFE

4 years ago

This would be something to add to the default hook file and would require something somewhat similar to what is done in https://pagure.io/pagure/blob/master/f/pagure/internal/__init__.py#_297-306 to figure out if the branch is already part of a PR or not.

Metadata Update from @pingou:
- Issue assigned to pingou

4 years ago

Login to comment on this ticket.

Metadata