Project

General

Profile

Actions

Defect #1253

closed

Using '*' as keyword for repository referencing keywords doesn't work

Added by Anonymous almost 16 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
Start date:
2008-05-19
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

We've set up Redmine-0.7.1 on a Windows XP machine running under mongrel using an http link to our subversion repository. We set the 'referencing keywords' to just contain '*' as indicated in the FAQ here http://www.redmine.org/wiki/redmine/RedmineSettings#32

When we browse the repository, out commit messages that start with a bug number (e.g. #9999) do get hyperlinked to that bug, but the tickets aren't specifically mentioned as referenced. Also, when we browse to that ticket, it has a comment such as 'committed in r8765' and the r8765 also correctly gets hyperlinked, but the ticket doesn't display #9999 as an associated revision.

I see this is working for the official Redmine site. Have posted this in the help forum but haven't been able to resolve it. See http://www.redmine.org/boards/2/topics/show/875

Running: * redmine-0.7.1 * svn-1.4.6 (over http) * ruby-1.8.6 * rails-2.0.2 * sqlite3-3.5.8 * mongrel-1.1.4

All other parts of redmine appear to be working correctly for us.

Actions #1

Updated by Pierre Paysant-Le Roux almost 16 years ago

The regexp used to detect issue ids in comments with "*" as keyword is (changeset.rb line 78):

([\s\(,-^])#(\d+)(?=[[:punct:]]|\s|<|$)

In a range definition, ^ matches the ^ character and not the beginning of the line. Using

([\s\(,-]|^)#(\d+)(?=[[:punct:]]|\s|<|$)

may solve the problem.

From Programming Ruby The Pragmatic Programmer's Guide :

A character class matches any single character between the brackets. The characters |, (, ), [, ^, $, *, and ?, which have special meanings elsewhere in patterns, lose their special significance between brackets.

Actions #2

Updated by Pierre Paysant-Le Roux almost 16 years ago

Here is a unit test that goes in changeset_test.rb.

  def test_ref_keywords_any_line_start
    Setting.commit_ref_keywords = '*'

    c = Changeset.new(:repository => Project.find(1).repository,
                      :committed_on => Time.now,
                      :comments => '#1 is the reason of this commit')
    c.scan_comment_for_issue_ids

    assert_equal [1], c.issue_ids.sort
  end
Actions #3

Updated by Anonymous almost 16 years ago

Thanks Pierre, the new regex worked. I did have to delete the repository from the project and re-add it to get it to re-associate the revisions, so perhaps a 're-sync revisions' on the repository settings tab would be good (this would also work then if commit comments get altered which they can with subversion). I'll post a separate ticket about this.

Actions #4

Updated by Anonymous almost 16 years ago

Added #1273 to request a repository history resync method.

Actions #5

Updated by Jean-Philippe Lang almost 16 years ago

  • Category set to SCM
  • Status changed from New to Closed
  • Resolution set to Fixed

Fixed in r1451. Pierre, thanks for your patch.

Actions #6

Updated by Anonymous almost 16 years ago

Hi, this hasn't been merged to the 0.7-stable branch but is marked as fixed for 0.7.2. Will this be merged before the release?

Many thanks

Russell

Actions #7

Updated by Anonymous almost 16 years ago

  • Status changed from Closed to Reopened

I've re-opened this because it hasn't been merged to the 0.8 branch (and didn't want it to get forgot if 0.7.2 is released soon). If its not going to be merged, I'll change the target version to 0.8?

Cheers

Russell

Actions #8

Updated by Anonymous almost 16 years ago

Sorry, meant it hadn't been merged to the 0.7-stable branch (in the above comment).

Actions #9

Updated by Jean-Philippe Lang almost 16 years ago

  • Status changed from Reopened to Closed

Merged in 0.7-stable in r1474.

Actions #10

Updated by Anonymous almost 16 years ago

  • Status changed from Closed to Reopened

This still doesn't work fully. We've got a few cases where we're entering commit comments such as

#6,#7 small change to fix to issues

Using changeset.rb from 0.7.1, and also with the fix applied, will still only associate #7 with the commit. It appears to be to do with the ',' after the bug number causing an issue. We've got other commit comments like this:

Fixed #8, removed a bug in the locking code

And this won't be associated with an issue, but if I edit the log message, remove the ',' so the message reads Fixed #8 removed a bug in the locking code, then delete and re-add the repository so the history is re-fetched, then the association with issue 8 works correctly.

FWIW, whatever passes the revision history to display the hyperlinks for the bugs on the repository browser picks all these tickets out correctly. Should they not just use the same regex?

It would be good to get this fixed before 0.7.2 as we have to keep deleting and re-adding our repositories to our projects to re-sync the history as theirs no 're-sync' option.

Thanks

Russell

Actions #11

Updated by Lane Roathe almost 16 years ago

We have also noticed the issue where having a comma after a defect # will prevent redmine from being able to associate the commit with the issue.

Actions #12

Updated by Pierre Paysant-Le Roux almost 16 years ago

Lane, I can't reproduce your bug. I commited a message like "foo #1, bar" and the issue 1 was associated with the commit.

Actions #13

Updated by Anonymous almost 16 years ago

Hi Lane, Piere, do you both have referencing keywords set to *? We also have 'fixes' keywords set to '' and every commit we've got on like this, the issue preceding the ',' isn't associated.

Pierre, have you tried a commit such as #1,#2 foo bar to see if both 1 and 2 are associated?

Cheers

Russell

Actions #14

Updated by Pierre Paysant-Le Roux almost 16 years ago

Hi Lane, hi Russel. I still can't reproduce the bug. I used the 0.7-stable branch with this configuration :
  • Referencing keywords : *
  • Fixing keywords : fixes

Both commits with "#1,#2 foo bar" and "foo #1, bar" messages associate right.

Actions #15

Updated by Anonymous almost 16 years ago

Hi Pierre, can you try with 0.7.1 then? I've applied the above regex fix to our installation and that fixed the issue where the bug number was at the start of the commit, but not the ',' case. Perhaps something else has been changed on the stable branch that has affected this also?

I'll try and get hold of the stable branch at some point and give it a go too.

Cheers

Russell

Actions #16

Updated by Anonymous almost 16 years ago

OK, I've just done a checkout of 0.7-stable and a commit of

#1,#2,#3 Created trunk, branches and tags

associated the revision correctly.

On our production installation, I've edited changeset.rb as you described above, and this did fix the start of line issue, but commas after issue numbers don't work so I wonder if something else went in to 0.7-stable post 0.7.1 that touched this issue.

Anyway, seems to be working on 0.7-stable so looks like this report can be closed again.

Cheers

Russell

Actions #17

Updated by Anonymous almost 16 years ago

  • Status changed from Reopened to Closed
Actions

Also available in: Atom PDF