Patch #7445

Patch for improved repository commit auto-updates

Added by Brian Lindahl about 8 years ago. Updated over 5 years ago.

Status:ClosedStart date:2011-01-25
Priority:NormalDue date:
Assignee:-% Done:

80%

Category:SCM
Target version:-

Description

I found a need to have multiple forms of auto-updates for issues through repository commits. This patch changes the wording from 'commit_fix' to 'commit_update' to represent the fact that not all repository commits are 'fixes'. In addition, there are now 5 slots for auto-updates through repository commits.

One example of usage is that in my projects, repository commit messages can automatically move an issue through the following an advanced flow if the commit message contains the following keywords:

branches   --> move to 'In Progress'   used to indicate that work has started on an issue
implements --> move to 'Implemented'   used to indicate that an issue has been implemented
integrates --> move to 'Integrated'    used to indicate that an issue has been integrated back into an integration branch to await a future release
releases   --> move to 'Released'      used to indicate that an issue has made it into a release that has passed acceptance test
verifies   --> move to 'Closed'        used for internal verification before a release is given to a receiver

Having a large number of slots for commit message auto-updates has drastically reduced the burden on software engineers when it comes to using a defect tracking system, while still allowing a useful number of issue states from a management and lead perspective.

commit-update-1.0.4.patch Magnifier (11.6 KB) Brian Lindahl, 2011-01-25 19:55

commit-update-1.1.0.patch Magnifier (9.91 KB) Brian Lindahl, 2011-01-26 22:14

commit-update-1.2.1.patch Magnifier (10.2 KB) Russell Frank, 2012-01-25 20:42

commit-update-1.4-stable.patch Magnifier (10.5 KB) Déja Augustine, 2012-05-18 22:13


Related issues

Related to Redmine - Feature #1232: Referencing and fixing issues in commit messages New 2008-05-13
Related to Redmine - Feature #4911: Multiple issue update rules with different keywords in co... Closed 2010-02-23

History

#1 Updated by Brian Lindahl about 8 years ago

should have read:

branches   --> move to 'In Progress'   used to indicate that work has started on an issue
implements --> move to 'Implemented'   used to indicate that an issue has been implemented
integrates --> move to 'Integrated'    used to indicate that an issue has been integrated back into an integration branch to await a future release
releases   --> move to 'Released'      used to indicate that an issue has made it into a release that has passed acceptance test
verifies   --> move to 'Closed'        used for internal verification before a release is given to a receiver

Description updated accordingly on 2013-03-29

#2 Updated by Brian Lindahl about 8 years ago

Improvements:
  • migrated to Redmine 1.1.0
  • improved the code to be a bit 'ruby' smarter

#3 Updated by Adarsh Carter about 8 years ago

Excellent; thank you! Tested with 1.1.1; seems to work perfectly.

#4 Updated by Troex Nevelin about 8 years ago

That is very useful, I would like to see it in redmine by default. I would suggest something like done10 #7445 to set progress 10%, done20 and so on, should be implemented by default and set 'Assigned'

#5 Updated by Terence Mill about 8 years ago

Brian Lindahl wrote:

should have read:
[...]

Static strings are never a good solution at least in terms of localization.

A more general implementation would be to update the tickets in similar way as doing via email, mean you have to reference a ticket id and use the standard email update syntax on that.
eh.
status: In Progress

To have a better integration someone could define alias words for status in in the main workflow configuration, e.g

Status => Alias
In Progress => branches, working
Implemented => implements, coded
Released => releases
verifies => Closed

This way several alias for the status definition can be used in emails and commit messages to update tickets.

#6 Updated by Etienne Massip about 8 years ago

  • Category set to SCM

#7 Updated by Brian Lindahl about 8 years ago

Terence Mill wrote:

Static strings are never a good solution at least in terms of localization.

Which is why Redmine allows you to have multiple trigger words. For example, for French (not sure about translation accuracy) and English users:
verify, vérifier => Closed

#8 Updated by Terence Mill over 7 years ago

+1

#9 Updated by Russell Frank about 7 years ago

Here's the patch for 1.2.1

#10 Updated by William Roush almost 7 years ago

+1 on this one, should be in Redmine by default.

#11 Updated by Déja Augustine almost 7 years ago

Rolled a patch against Redmine 1.4-stable

I'm still testing it, but everything seems to be working just fine.

#12 Updated by gc cg over 6 years ago

Can some one please help me with this issue.
I've just downloaded
1.4-stable: svn co http://redmine.rubyforge.org/svn/branches/1.4-stable redmine
cd to redmine dir
and download commit-update-1.4-stable.patch

then i run this command: patch -p0 < commit-update-1.4-stable.patch

I got lots of errors. What did i do wrong?

sh-4.1$ patch p0 < commit-update-1.4-stable.patch
patching file b/app/models/changeset.rb
Hunk #1 FAILED at 119.
Hunk #2 FAILED at 132.
Hunk #3 FAILED at 217.
Hunk #4 FAILED at 231.
4 out of 4 hunks FAILED -
saving rejects to file b/app/models/changeset.rb.rej
patching file b/app/views/settings/_repositories.html.erb
Hunk #1 FAILED at 68.
1 out of 1 hunk FAILED -- saving rejects to file b/app/views/settings/_repositories.html.erb.rej
patching file b/config/locales/en.yml
Hunk #1 FAILED at 343.
Hunk #2 FAILED at 932.
2 out of 2 hunks FAILED -- saving rejects to file b/config/locales/en.yml.rej
patching file b/config/settings.yml
Hunk #1 FAILED at 94.
1 out of 1 hunk FAILED -- saving rejects to file b/config/settings.yml.rej

thanks a lot

#13 Updated by gc cg over 6 years ago

I manually apply the patch (by hand on each file0 and it works.

thanks

#14 Updated by Carlo Ruggiero almost 6 years ago

this patch saved my life! (And its warking even on 2.3-stable)
should be integrated as a fix!

Thanks

#15 Updated by Etienne Massip almost 6 years ago

  • Description updated (diff)

#16 Updated by Jean-Philippe Lang over 5 years ago

  • Status changed from New to Closed

Superseded by r12197 which allows unlimited keywords/rules.

Also available in: Atom PDF