Opened 17 years ago
Closed 16 years ago
#7326 closed defect (wontfix)
post-commit-hook doesn't fire if command and ticket number on different lines
Reported by: | Owned by: | John Hampton | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | version control | Version: | 0.11 |
Severity: | normal | Keywords: | trac-post-commit-hook |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
We were having intermittent mysterious failures of post-commit-hook, where the commit succeeded and seemed correctly worded but the changeset wasn't reflected in the ticket. We finally noticed that in the cases where it wasn't working, something had introduced a line break between the "fixes" or "closes" or "refs" and the ticket number.
The obvious workaround is not to break the command and ticket number across lines, but we don't do it intentionally; svn or something is wrapping things at 80 columns for us, thereby introducing line breaks at arbitrary spots.
In consultation on #trac, we came up with the fix of replacing the .?
(any single character) at the end of the action with \s*
(any whitespace, including newline), which makes a little more sense to me anyway. But that breaks the "fixes:1234" syntax for some reason. This is at the end of this line.
I don't have time to test more permutations, alas. But hopefully this will get someone started on handling multiline commit messages in trac-post-commit-hook.
Attachments (0)
Change History (5)
comment:1 by , 17 years ago
Milestone: | → 0.11.1 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Version: | → 0.11 |
comment:2 by , 17 years ago
Thanks for the new patch! I don't have a current test environment up, but will in a few days (or a couple of weeks) when I get around to upgrading to 0.11 final.
follow-up: 4 comment:3 by , 16 years ago
Component: | general → version control |
---|---|
Milestone: | 0.11.1 |
I'd say wontfix for this one. Doing this kind of regexp parsing on multiple lines is asking for trouble.
Consider:
(...) can't be fixed #4567 OTOH could be, with a similar approach.
et voila, you now closed #4567 …
Anyway, the post-commit-hook is meant to be customized, so feel free to do so with your own copy.
comment:4 by , 16 years ago
Replying to cboos:
I'd say wontfix for this one. Anyway, the post-commit-hook is meant to be customized, so feel free to do so with your own copy
Agreed. That's why it stands and stays in the /contrib directory.
comment:5 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Can you please try the following patch?
contrib/trac-post-commit-hook
.?'I think the main question here is: What should the valid separators be? Whitespace and colon? Any others?