Duplicate Commit Time Tracking for Git / Atlassian Stash

Added by Lucas J over 5 years ago

I understand that this should not be the direct responsibility of the Redmine team but I have found an issue with the duplication of time tracking events in git commits when using a pull request system.

Due to the merging nature of Git, some tools will re-list the commit messages of the commits which were merged as part of a branch when a Pull Request is initiated. In doing this, any commit-level time tracking events are duplicated.

Do you see anything we can do to get around this? I have attempted in removing the values from the merging tools but they are still committed with the time tracking values.

Perhaps there is a way to parse the commit message and see that a time tracking entry already exists in comparing the hashes, but even while typing this I see that there is no definitive way to do it.

Any suggestions?

Replies (1)

RE: Duplicate Commit Time Tracking for Git / Atlassian Stash - Added by Konstantin Tkachenko about 4 years ago

We have similar problem with subversion merges. The proposed commit message for the commit after merge contains all the commit-messages of the merged commits.

And we are using this autogenerated merged commit messages for our changelogs generation and so on.

So we are currently unable to use time tracking via commits.

The only solution I can imagine is to modify the scm commits processing and disable time tracking in the text parts between start and end of the autogenerated message. Such a commit-messages look like this:

Merged revision(s) 16 from trunk/std/docs/templates:
Issue #5080 @1h20m: abc-svn pre-merge-Test