• 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

            Suscribe 

            Pedro Fructuoso added a comment - Suscribe 

            yes please add this just as github

            Stevie Dean added a comment - yes please add this just as github

            At least they support useless emojis instead of focusing on important features <:^)

            Ludovic Delafontaine added a comment - 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 🥳

            Miguel Santamaria added a comment - I think they are waiting for the ten-year anniversary of this ticket to offer us the gift of its resolution 🥳

            definitely a needed and useful feature

            Вячеслав Калякин added a comment - definitely a needed and useful feature

            Please add this feature, it's crucial in some cases - when a PR created from a private fork for example.

            Aliaksei Kaniaveha added a comment - 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

             

            Jim Baldetti added a comment - please add creating patch file from Bitbucket pull request, seems basic enough  

            Please add this feature.

            Connor Crothers added a comment - Please add this feature.

            I guess we still need some more years for this?

            ilja.reznik added a comment - I guess we still need some more years for this?

            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.

            Ravindra Reddy Bhavanam added a comment - - edited 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.

            MirceaD added a comment -

            Still evaluating, heh?

            MirceaD added a comment - Still evaluating, heh?

            JeffreyHarris2

            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.

            Neal McConachie added a comment - JeffreyHarris2 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.

            drewparsons added a comment - 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.

            n-skiba added a comment -

            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.

            n-skiba added a comment - 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.

            JeffreyHarris2 added a comment - 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.

            n-skiba added a comment -

            +1 it would be great to do ‘hg pull url-of-pr’ to see changes in different branch locally

            n-skiba added a comment - +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.

            JeffreyHarris2 added a comment - 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.

            drewparsons added a comment - 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.

            Ying-wen Zhang added a comment - Is this feature done? The patch should can be downloaded and modified by the reviewer. Gerrit has it too.

            ferchis added a comment -

            +1 yes please! add the UI link to get a patch from a pull request. Github has it

            ferchis added a comment - +1 yes please! add the UI link to get a patch from a pull request. Github has it

            jogwen added a comment -

            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)

            jogwen added a comment - 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)

            ph2m_vma added a comment -

            Any news on this? Would be really appreciated.

            ph2m_vma added a comment - Any news on this? Would be really appreciated.

            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.

            JeffreyHarris2 added a comment - 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.

            any solutions arrived ???

            Thaniyarasu Kannusamy added a comment - any solutions arrived ???

            podsiadly added a comment -

            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

            podsiadly added a comment - 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 for this feature

            erikpallhansen added a comment - +1 for this feature

            +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.

            Kalpit_Jain added a comment - +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.

            Silas added a comment -

            +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.

            Silas added a comment - +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.

            AlanB added a comment -

            +1, seriously.

            AlanB added a comment - +1, seriously.

            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.

            Legacy Bitbucket Cloud User (Inactive) added a comment - 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.

            +1

            tersmitten added a comment - +1

            Missing this feature now.

            Nelson Castillo added a comment - Missing this feature now.

            chamil_sanjeewa added a comment - https://chrome.google.com/webstore/detail/bitbucket-patch-download/kmjcnbdahgjagapjigblfpkggohhceka?hl=en

            gchazot added a comment -

            +1 to also have this in Stash/Bitbucket Server

            gchazot added a comment - +1 to also have this in Stash/Bitbucket Server

            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 -

            
            

            Legacy Bitbucket Cloud User (Inactive) added a comment - 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 for adding this to the UI

            Ian Neubert added a comment - +1 for adding this to the UI

            +1 for the UI

            +1 here

            #!bash
            
             curl -u user:password https://bitbucket.org/api/2.0/repositories/{user}/{repo}/pullrequests/{pull_no}/patch -L -o name.patch
            

            andy_postnikov added a comment - +1 here #!bash curl -u user:password https: //bitbucket.org/api/2.0/repositories/{user}/{repo}/pullrequests/{pull_no}/patch -L -o name.patch

            cicku added a comment -

            +1 here!

            Github can use .patch at the end of any commit, BB should also support this in a similar way.

            cicku added a comment - +1 here! Github can use .patch at the end of any commit, BB should also support this in a similar way.

            +1 for the link to be added to the UI

            logicia_dot_net added a comment - +1 for the link to be added to the UI

            gnotaras added a comment -

            This is definitely a missing feature. It would be even better if the patch contained the correct contributor name <email>, like Github does.

            gnotaras added a comment - This is definitely a missing feature. It would be even better if the patch contained the correct contributor name <email> , like Github does.

            nickspiers added a comment -

            Thanks Erik, works great.
            Any idea if/when the UI might include the link?
            Thanks guys

            nickspiers added a comment - Thanks Erik, works great. Any idea if/when the UI might include the link? Thanks guys

            evzijst added a comment -

            @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.)

            evzijst added a comment - @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.)

            nickspiers added a comment -

            That's awesome, I knew there was a way!
            Thanks Jon.

            The link in the UI would be money.

            nickspiers added a comment - 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

            moo (Inactive) added a comment - 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

              Unassigned Unassigned
              f23ddc66b768 nickspiers
              Votes:
              71 Vote for this issue
              Watchers:
              53 Start watching this issue

                Created:
                Updated: