-
Suggestion
-
Resolution: Unresolved
-
Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.
Using a git fork-clone-pull workflow, it's necessary sometimes to demo the pull request from the forked repository.
Currently you have to make sure you have all the appropriate permissions and pull down the forked repo which uses unnecessary time, space and bandwidth.
I propose a patch url where you could download a git patch that could be applied temporarily to your own pulled repo to demo the pull request.
Form Name |
---|
[BCLOUD-8323] Link to a PR's raw patch from the UI
At least they support useless emojis instead of focusing on important features <:^)
I think they are waiting for the ten-year anniversary of this ticket to offer us the gift of its resolution 🥳
Please add this feature, it's crucial in some cases - when a PR created from a private fork for example.
please add creating patch file from Bitbucket pull request, seems basic enough
Almost all my team members want this feature and everyone confuses this with "Download this commit" option on commit page. To us, this seems like basic feature.
What I want:
- a button to download the exact output of running: git format-patch master..HEAD which would contain the author message, and the unified diff
Yes, this please.
jeffrey_harris just to clarify, what I meant was that it would be useful to have button that generates the zipfile of individual diff files. It doesn’t exist yet, in the same way that there is no button to generate the single diff file for a PR, which is requested in this Issue.
jeffrey_harris it seems like the user also can't download ZIP-file if he do not have access to the PR author’s repository. But there is no rational logic to conceal patch if we could see the same diff in the Bitbucket PR view.
I can’t figure whether the feature 6adb2a866d70 is talking about just doesn’t exist in my corporate installation, or we’re talking about different things, but this seems like it’s got to be about the easiest request ever.
What I see in the “commits” section:
- a button to download a .zip file containing the entire source code, with no diff, and none of the commit author information.
What I want:
- a button to download the exact output of running: git format-patch master..HEAD which would contain the author message, and the unified diff
I run into this practically every day. It means I end up giving other people access to my repository, when I really don’t want to, to just work around this missing feature.
+1 it would be great to do ‘hg pull url-of-pr’ to see changes in different branch locally
I have never been able to find a download button that returns a unified diff. I only find links that download the state of the repository, which is really not what I want.
The raw diffs are already available for each individual commit listed under the Commits button of the PR.
An alternative service which complements this issue is to provide a link to a zipfile or tarball containing all the individual diff files for each commit in the PR.
Depending on why you want access to the raw patch of the PR (or how many commits it contains), in some cases it can be convenient to work with the separate patch files for each commit rather than a single patch file for the whole PR.
Is this feature done?
The patch should can be downloaded and modified by the reviewer.
Gerrit has it too.
+1 yes please! add the UI link to get a patch from a pull request. Github has it
Please, please, please make this easier to do bitbucket? Even if it's just adding fm-admin's 2nd (updated) command from 2017-07-09 to a pull request page? (that just worked for me)
It's really painful not to have this for bitbucket server.
I can't figure out how to construct a XPC-RPC request for this by hand, even. It's really painful to have to use Bitbucket's broken merge feature to accept patches.
Had the same need, but worked around it.
I created a branch, edited pull request destination to be that new branch, merged pull request there and pulled the branch to my local git repo.
Link to download patch would be much more convenient
+1, This is a much needed feature to simplify and ease the patch generation from a pull-request. It will be great if the patch url can be exposed to the users.
+1, seriously. I love the GH feature that any SHA URL can be changed to generate a diff or patch by adding either .diff or .patch to the end of the url. Would love this feature with BB Server.
Is 2.0 api also available for bitbucket server? I cannot find any relevant information on this. Version 1.0 of the rest api seems to work though, but that doesn't give what I need.
Another +1 for changes to the UI to make it -simple-possible to retrieve the URL for the patch file.
Also thanks Andy Postnikov for the curl command as this solved my problem subsequently retrieving the patch file once I knew the URL for it (the destination repo is private).
Using your solution, I was then able to use this one-liner to apply the patch within my local (clean) git directory:
#!bash
curl -u user:password https://bitbucket.org/api/2.0/repositories/{user}/{repo}/pullrequests/{pull_no}/diff -L | git apply -
Update: unbelievable - now https://bitbucket.org/api/2.0/repositories/
{user}/
{repo}/pullrequests/
{pull_no}/diff is just returning me a 403 (Forbidden) response.Latest update 10/7/15: slight change to the URL got this working again. Here's what works for me now:
#!bash
curl -u username:password https://api.bitbucket.org/2.0/repositories/{username}/{reponame}/pullrequests/{pull_no}
/diff -L | git apply -
+1 here
#!bash
curl -u user:password https://bitbucket.org/api/2.0/repositories/{user}/{repo}/pullrequests/{pull_no}/patch -L -o name.patch
+1 here!
Github can use .patch at the end of any commit, BB should also support this in a similar way.
This is definitely a missing feature. It would be even better if the patch contained the correct contributor name <email>, like Github does.
Thanks Erik, works great.
Any idea if/when the UI might include the link?
Thanks guys
@nickspiers That's actually not a link you should be using.
To cut a (very) long story short, you should instead use: https://bitbucket.org/api/2.0/repositories/atlassian/aui/pullrequests/484/diff
(The tl;dr of the long story is that (git) patches on merge commits (which is what happens under the covers for a PR) do not actually generate a diff, but a series of individual patches. Also, that /patch URL will disappear.)
That's awesome, I knew there was a way!
Thanks Jon.
The link in the UI would be money.
Hi Nick,
Thanks for the suggestion. Funnily enough, we do generate raw patches for pull requests, but the URL for these patches is only available through the API.
https://bitbucket.org/api/2.0/repositories/atlassian/aui/pullrequests/484/patch
I'm going to add a feature request to our backlog to get that link added to the UI.
Thanks,
Jon
Suscribe