Question

I am currently considering moving from a svn/bugzilla system using scmbug to integrate the two to a git/redmine system. I have been having trouble trying to find a way to require commits to be associated with an "issue" in the redmine system. Does anyone know if this is even possible?

thanks! Brian

Was it helpful?

Solution

As eykanal noted, Redmine can be configured to recognize issue numbers in commit messages. When it does so, it will automatically link the commits on the issue page, it works quite well. But note that this will not require a commit to have an issue reference. If you want to force that (i.e., to explicitly disallow commits that don't reference an issue) then you'll have to write your own pre-commit hook which queries the Redmine database and exits with a failure status if none is found.

Given that, I'm not sure I'd have it fail, because you're always going to have commits here and there that legitimately don't reference a ticket. I'd probably just issue a warning message. E.g.:

"Warning, your commit did not reference an issue. Please update the commit message appropriately. This can be done with: git commit --amend -m "New commit message"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top