Project

General

Profile

Actions

Feature #4052

open

Cross-project redmine links with alternate link text for source and export links.

Feature #4052: Cross-project redmine links with alternate link text for source and export links.

Added by William Baum about 17 years ago. Updated almost 11 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Text formatting
Target version:
-
Resolution:

Description

In Feature #3346 (Support for cross-project revision links), James Wells and Babar O'Cap collaborated to make it possible to create commit and revision links across projects.

I have now extended the project: syntax to source: and export: links and also extended them with the ability to specify alternate link text: "Download filename" instead of projectname:export:foo/bar/path/filename.

I have also corrected the issue causing source and export links to not be properly converted to absolute links in issue update emails. (See Defect #3483)

So... Source and export links now work in emails, can be cross project, and can have alternate display text for the link.

Syntax:

  • ["Link alternate display title"=][project:]source:some/path[/file][@52][#L120]
  • ["Link alternate display title"=][project:]export:some/path/file[@52]

Note: For the link text, the double-quotes are currently required, even if the text is only one word. I chose to implement the alternate link name functionality in a way that altered the primary regex as little as possible. It's getting a bit unwieldy.

091018-cross-project_redmine_links-tests.patch contains changes to test/* files as provided in:

  • #3346 cross-project_revision_and_commit_links_v5.diff - Patch v5 - from Babar O'Cap, 2009-08-26 03:27

    I have no idea how to use, extend, or test this test/* functionality, so I didn't attempt to..

091018-cross-project_redmine_links.patch contains no test/* file modifications.


Files

091018-cross-project_redmine_links.patch (12.4 KB) 091018-cross-project_redmine_links.patch functional changes (revision 2879) William Baum, 2009-10-19 05:43
091018-cross-project_redmine_links-tests.patch (16.9 KB) 091018-cross-project_redmine_links-tests.patch functional changes plus partial test functionality. (revision 2879) William Baum, 2009-10-19 05:43
091021-cross-project_redmine_links.patch (12.5 KB) 091021-cross-project_redmine_links.patch William Baum, 2009-10-22 02:59
100328-_r3618_-cross-project_redmine_links.patch (12.3 KB) 100328-_r3618_-cross-project_redmine_links.patch updated patch against r3618 William Baum, 2010-03-29 00:47
100805-1.0.0_r3854-cross-project_redmine_links.patch (12.2 KB) 100805-1.0.0_r3854-cross-project_redmine_links.patch William Baum, 2010-08-06 01:22
100806-0.9.6_add_cross_project_links_with_changesets.patch (771 Bytes) 100806-0.9.6_add_cross_project_links_with_changesets.patch Patch to add cross-project references when fixing via repository commit keywords Pieter Smith, 2010-08-06 14:25

Related issues 7 (2 open — 5 closed)

Related to Redmine - Feature #779: Multiple SCM per projectClosedJean-Philippe LangActions
Related to Redmine - Feature #7409: Cross project Redmine linksClosedActions
Related to Redmine - Feature #3346: Support for cross-project revision linksClosedActions
Related to Redmine - Defect #3483: Relative url for source links in notificationsClosedJean-Philippe LangActions
Related to Redmine - Feature #10248: Specific text instead of addresses to the Redmine internal linksNewActions
Related to Redmine - Feature #21443: Links to resources in MarkdownNewActions
Has duplicate Redmine - Feature #4667: Ability to link to a revision in a subprojects repositoryClosedActions

Updated by William Baum about 17 years ago Actions #1

oops.. image links don't work for attachments.. that last part was supposed to be:

091018-cross-project_redmine_links-tests.patch contains changes to test/* files as provided in:

  • #3346 cross-project_revision_and_commit_links_v5.diff - Patch v5 - from Babar O'Cap, 2009-08-26 03:27

    I have no idea how to use, extend, or test this test/* functionality, so I didn't attempt to..

091018-cross-project_redmine_links.patch contains no test/* file modifications.

Updated by William Baum about 17 years ago Actions #2

I have discovered an issue with this, which hopefully can be easily resolved...

This patch currently breaks the !version#6 syntax. Instead of being a link to the version in the roadmap, it becomes a link to an issue by that number (#6).

Updated by William Baum about 17 years ago Actions #3

Updated patch file, corrects issues with attachment, document, and version links.

Updated by Babar O'Cap about 17 years ago Actions #4

+1

Updated by Alexey Palazhchenko over 16 years ago Actions #5

Any news?

Updated by William Baum over 16 years ago Actions #6

Here's an svn formatted patch against r3618.

It's functional, but could use some refactoring.

Updated by Pieter Smith over 16 years ago Actions #8

+1

This is so damn useful! Why has nobody added it to the roadmap yet!?

Updated by Pieter Smith over 16 years ago Actions #9

Hi William,
Any chance that you can update the patch for redmine 0.9.6 or later?
Thanks in advance!

Updated by Pieter Smith over 16 years ago Actions #10

O'h... I forgot to mention that I tried merging the patch with 0.9.6, but got more merge conflicts than I can safely solve with my limited Ruby knowledge.

Updated by William Baum over 16 years ago Actions #11

My apologies.. I actually started to do this weeks ago and got pulled off on something else..

Attached is 100805-1.0.0_r3854-cross-project_redmine_links.patch, which is a patch against 1.0.0 (source:/trunk@3854).

I did actually generate patches against 0.9.5 (source:/trunk@3815) and 0.9.6 (source:/trunk@3815) as well, but I'm not uploading them because they are identical except for the revision references in the patch. This patch should apply without issue against any trunk or release between r3602 and r3894.

The functional changes in this patch are all in app/helpers/application_helper.rb, which has had a couple of recent revisions that would affect line numbers, but the patch should still apply properly to a current trunk. Let me know if you need a patch against a more recent trunk..

Updated by Pieter Smith over 16 years ago Actions #12

Thanks. Can't we get a Target Version for this? How can we convince the core team to integrate this?

I am also adding 100806-0.9.6_add_cross_project_links_with_changesets.patch to use the cross-project wiki formats (project:r1234 and project:commit:ab34cd) when fixing issues via repository commit keywords.

Updated by Pieter Smith over 16 years ago Actions #13

By the way... 100805-1.0.0_r3854-cross-project_redmine_links.patch doesn't play well with 0.9.6. The trouble starts with:

text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|,|\s|<|$)}) do |m|

in 0.9.6 versus the expected
text.gsub!(%r{([\s\(,\-\[\>]|^)(!)?(attachment|document|version|commit|source|export|message|project)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|,|\s|\]|<|$)}) do |m|

which is what the patch expects.

Updated by Blake Williams almost 16 years ago Actions #14

Subprojects in Redmine are effectively useless without this feature.

Updated by Toshi MARUYAMA over 15 years ago Actions #15

  • Category set to Text formatting

Updated by Stefan Lindner about 14 years ago Actions #16

Still no plans to include this in near future? Wikis look awful without th ability to display a homan readable text for repository links.

Updated by Sébastien Aubry about 14 years ago Actions #17

The syntax: [[project:page|text]] should indeed work. It is even weird that it is not the case by default. Probably a problem with the regexp?

Updated by Thomas Robbs over 13 years ago Actions #18

+1

Updated by Arthur Zalevsky over 12 years ago Actions #19

Yep, it's definitely necessary feature.

Updated by Toshi MARUYAMA over 12 years ago Actions #20

  • Related to Defect #3483: Relative url for source links in notifications added

Updated by Toshi MARUYAMA about 12 years ago Actions #21

  • Related to Feature #10248: Specific text instead of addresses to the Redmine internal links added

Updated by Toshi MARUYAMA almost 11 years ago Actions #22

Updated by Hans Ginzel almost 11 years ago Actions #23

Please, also for Markdown formatting, #15520.

Actions

Also available in: PDF Atom