automatic merge commit when PR is approved

Chason Choate February 14, 2015

I've created a plugin that drops a new page into the repository view. For this page I am retrieving commits with the "commitService.traverse" method.

I'm noticing a strange issue where once I approve a PR my new page shows a commit that is neither on the "commits" page nor in the "git log" of a fresh clone.

Here's the screenshot of my page using the "traverse" method.

Screen Shot 2015-02-14 at 12.24.22 PM.png

Here's the screenshot of the "commits" tab.

Screen Shot 2015-02-14 at 12.24.53 PM.png

Anyone know what's going on here?

5 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 16, 2015

Chason,

Stash's traversal is the equivalent of git rev-list --all. That means everything under refs is considered, not just refs/heads/master. In addition to the branches and tags, Stash repositories also have refs/pull-requests entries, which includes merge for pull requests that are able to be merged cleanly. The "Automatic merge" you're seeing is one of those. (If you do a git clone --mirror of the repository, which will include the pull request refs, and run git rev-list --all --pretty=oneline --topo-order you'll see the same "Automatic merge" in that list.)

On your TraversalRequest you are not specifying any includes or excludes, which means every commit in the repository will be streamed, including those for open pull requests. If you only want a traversal of refs/heads/master (or any other branch), you should specify the commit hash for it (not the name) as an explicit include.

Hope this helps,
Bryan Turner
Atlassian Stash

0 votes
Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 16, 2015

Chason, I'd love to help you improve your plugin. Please reach out to me at bturner-at-atlassian-dot-com.

0 votes
Chason Choate February 16, 2015

Did that link help at all?

0 votes
Adam
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 15, 2015

Can you give more detail about your call to traverse? What are you passing in, exactly?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events