POST hook missing branch name on push with multiple commits

Steve Muskiewicz avatarSteve Muskiewicz created an issue

I've been testing Bitbucket POST hooks and found an issue when I push multiple commits from a branch. The POST data that I'm getting back is showing "branch: null" for the first commit in the set, even though the commit was against my master branch.

(The subsequent commit entry did contain the proper "branch: master" data so it's not entirely broken).

Here's a sample of the POST data that shows the issue:

'{"repository": {"website": "https://plexxi.jira.com/wiki/display/PXAP/Plexxi+Control+Home", "fork": false, "name": "PROTO_PXAP_1", "scm": "git", "owner": "plexxi", "absolute_url": "/plexxi/proto_pxap_1/", "slug": "proto_pxap_1", "is_private": true}, "truncated": false, "commits": [{"node": "213e69924726", "files": [{"type": "modified", "file": "PlexxiControl/pom.xml"}], "branch": null, "utctimestamp": "2013-08-29 15:07:54+00:00", "timestamp": "2013-08-29 17:07:54", "raw_node": "213e69924726c17486b8818302dba6edac15f962", "message": "Change dependency plugin version\n", "size": -1, "branches": [], "author": "joe_plexxi", "parents": ["ccee8c389890"], "raw_author": "Joe Plexxi sourcecode@plexxi.com", "revision": null}, {"node": "ed5b516d865f", "files": [{"type": "modified", "file": "PlexxiControl/pom.xml"}], "branch": "master", "utctimestamp": "2013-08-29 15:14:16+00:00", "timestamp": "2013-08-29 17:14:16", "raw_node": "ed5b516d865f7454029e7cd61497a38326d6d533", "message": "updated release plugin version\n", "size": -1, "author": "joe_plexxi", "parents": ["213e69924726"], "raw_author": "Joe Plexxi sourcecode@plexxi.com", "revision": null}], "canon_url": "https://bitbucket.org", "user": "joe_plexxi"}'

This also manifests itself in the email hook, the email shows "None" on one of the changesets:

2 new commits in PROTO_PXAP_1:

https://bitbucket.org/plexxi/proto_pxap_1/commits/213e69924726/
Changeset:   213e69924726
Branch:      None
User:        joe_plexxi
Date:        2013-08-29 17:07:54
Summary:     Change dependency plugin version

Affected #:  1 file

https://bitbucket.org/plexxi/proto_pxap_1/commits/ed5b516d865f/
Changeset:   ed5b516d865f
Branch:      master
User:        joe_plexxi
Date:        2013-08-29 17:14:16
Summary:     updated release plugin version

Affected #:  1 file

Repository URL: https://bitbucket.org/plexxi/proto_pxap_1/

Please let me know if I can provide any additional info.

Comments (4)

  1. Brian Nguyen

    Hi Tim,

    The fact that a branch is only applied to the last commit is a feature of git's light-weight branching system, and this is not something we intend to change.

    Cheers, Brian

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.