Search code examples
gitpull-requestbitbucket-servergit-fetch

Why is there a delay between a pull request and the possibility to fetch it (in stash)?


I am trying Stash, and I observe something that I cannot understand:

  • I push a new branch;
  • I create a pull request (from the browser);
  • Then I am trying to do:

    $ git fetch origin +refs/pull-requests/*:refs/remotes/origin/pr/* --dry-run
    

Sometimes, it is working immediately, but sometimes, the pull request only shows up after a long delay (30 minutes or so).

Stash is installed locally, so the delay doesn't come from the network, and the other interactions are ok.


Solution

  • Pull request refs are calculated lazily based on people viewing the diff in the UI or certain other operations. This is done for performance reasons, and the refs you're fetching aren't officially part of Stash API. This is something we're considering changing, buy we need to be mindful of the performance impact.

    May I ask what it is that you're trying to do with the theoretical merge ref? Perhaps there's an alternative approach.

    (I'm a product manager for Stash)