So based on this article, my team and I have started using forked repositories and pull requests to work on our application.
We have one main repository, this has our "master" branch and a "staging" branch. The staging branch is used when new pull requests are merged in, and once we have completed a working sprint within JIRA/GreenHopper, we test staging and merge it into master as our new version of the application. Each developer has their own fork of this main repository, and each of their repositories keeps its master branch tracking the main repository's staging branch. We branch off the master branch on our forked repositories for each new task we work on in JIRA.
This works great. Code is completely reviewed and tested and we can muck around in our local forks without worry of affecting the main repository.
However, we have JIRA linked to all of the repositories, and as such, git commit messages are repeated in said JIRA tasks many, many times. I think this is because JIRA adds the message for every merge and copy of the message in each of the forks. This is becoming troublesome since it will also add to the time logged and make looking through a tasks commit history confusing.
What's the best way to deal with this? I could stop tracking the fork's with JIRA, but then how will we keep updates on the tasks through commit messages (we'd have to login and log our work, add comments, etc, manually) and even then, when we merge into the main repository (which JIRA would still be tracking), the commit messages will add to the time again.
We want to be able to view progress on our tasks no matter what repository it originates from, but we don't want these duplications all over the place.
This behaviour is an unfortunate limitation of the current version of the DVCS connector. JIRA treats each forked Repository as a new repo and thus processes all commit messages again. Our developers are aware of this, but until a fix is made there are two workarounds.
You can set JIRA to not enable Smart Commits in new Repos, this will make sure that any forked Repo is not processed. But this is not useful if you want to track any changes made in your forks, in which case you can disable Smart Commits in your Master Repo. However, this will still process smart commits if you create new forks frequently.
Gits branches are properly handled by JIRA, JIRA will not process smart commits multiple times in Branches created in git with the Git Branch command. JIRA will display an icon for all commits made within Branches and you can still use Bitbuckets Pull requests to merge branches into your Master branch.
Lastly, which isn't really a workaround, is to disable smart commits alltogether and have users log their time manually in JIRA.
Well we do not fork new repos, its just done once per developer. Does the method in which we merge remote branches affect the way git messages are imported into JIRA? That is, if I upload a fix in my forked repository, do a pull request into the main repository, and then the other devs merge the fix from the main repostiory into their respective forked repos, will JIRA import said git commit message from every single repo or just once from my repo? It certainly feels like this happens, but not everytime (might be due to the way I merge in changes).
Switching to built in branches and sharing one repository seems like a possible solution, but I like the built-in saftey of code review and allowing only the lead developer write access to the main repository to ensure every line of code is reviewed before making it live. If we all share a repository, it can become burdensome if one person were to accidentally commit changes on branches they shouldn't be committing to and reverting those changes or branching the changes off.
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs