Tracking GIT commit on issue

David Badiola June 12, 2014

I've just started using Bitbucket. I was wondering if there's a way to keep track of all commits pertaining to a particular issue. If this possible using Bitbucket, how?

2 answers

1 accepted

0 votes
Answer accepted
Deleted user June 12, 2014

First you need to decide if you want to use Mercurial or Git. They are both Bitbucket supported DVCSes and thus have similar high-level usage patterns but the details are naturally (very) different.

With both tools the way to group commits is to use branches. Branching with Git is very well explained in http://git-scm.com/book/en/Git-Branching-What-a-Branch-IsIf you choose Git as DVCS to use with Bitbucket I recommend you read the book from cover to coder. I'm not familiar enough with Mercurial to tell you the authorative Mercurial text - Google will find a lot of material (including http://hginit.com/).

David Badiola June 12, 2014

So if I wanted to view all commits related to the issue when I view that issue via Bitbucket, all I need to do is create a branch. Is there a naming convention I should follow?

Deleted user June 12, 2014

There is no branch naming convention enforced by Bitbucket/Git, but naturally you should have a convention so that it's easy for humans to find issue related branches. Bitbucket also seems to have a word about branch workflows: https://confluence.atlassian.com/display/BITBUCKET/Using+Git+branches

I really recommend you to start with http://git-scm.com/book/en/(or similar for Mercurial). DVCSes are versatile powertools that require an initial effort.

David Badiola June 12, 2014

I undestand now. So bascially inorder for me to see all commits related to an issue whenever I view that issue via Bitbucket the procedure below solves it:

  1. Create an issue
  2. Create a branch
  3. Git commit to that branch
  4. View the issue on Bitbucket
  5. All GIT commits are viewed as issue comments

Please correct me if I'm wrong.

Deleted user June 12, 2014

Points #1-#3 seems to be correct but I'm not sure what you mean with points #4-#5. I'm afraid you don't have yet good enough understanding about Bitbucket and Git and Bitbucket's limited issue handling capabilities.

Or do you mean "Including Issues in a Commit Message":

https://confluence.atlassian.com/display/BITBUCKET/Resolve+issues+automatically+when+users+push+code

Now when your commit message includes a string: "see issue #34" the commit will be linked to the issue.

You can just create a test repo and trial the workflow there.

Anyway I think you're now on the right track. Hope this helped you !

David Badiola June 12, 2014

Actually that link got me stuck for days, since I have a little knowledge how Mercurial works. I was hoping for a GIT documentation for it.

I am curious about the limited capabilities of Bitbucket regarding issue handling. So you mean even if I make a git commit like this syntax:

git commit -m "<Issue#> <IssueStatus> <GIT message>"

That commit will never be seen as a comment on that issue I pertained in into?

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 12, 2014

I believe Bitbucket will parse those comments the same way for both Git and Hg.

Also, it appears that the issue number alone is not sufficient, and "<Issue#> <IssueStatus>" is not the expected syntax either.

According to the article Jani H linked to, you should use "<command> <issue id>", with the list of available commands (along with the issue tracker's responses) listed in the table near the end of the article.

0 votes
Deleted user June 12, 2014

Points #1-#3 seems to be correct but I'm not sure what you mean with points #4-#5. I'm afraid you don't have yet good enough understanding about Bitbucket and Git and Bitbucket's limited issue handling capabilities.

Or do you mean mean "Including Issues in a Commit Message":

https://confluence.atlassian.com/display/BITBUCKET/Resolve+issues+automatically+when+users+push+code

Now when your commit message includes a string: "see issue #34" the commit will be linked to the issue.

You can just create a test repo and trial the workflow there.

Anyway I think you're now on the right track. Hope this helped you !

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events