vscode-git-graph icon indicating copy to clipboard operation
vscode-git-graph copied to clipboard

Expand or Add to Issue Linking

Open Repooc opened this issue 4 years ago • 8 comments

Describe the improvement that you'd like Would like to expand the Issue Linking so we can link to other things other than issues which only need a small change in the url from issues to merge_requests for example. Merge requests are tagged with ! and tickets are tagged with # and we can add only one link right now so its basically one or the other.

I am sure you can either add another section for custom links like what Fork (Git Client) does which lets you add multiple rules with the + button. Like the screenshot below. image or a way to manipulate the url string to replace issues with merge_requests based on matching ! or #

Repooc avatar May 29 '20 03:05 Repooc

We have made a slight change to /web/utils.ts around line 302 by adding an additional replace before the original replace on config.url as temporary solution until we hear back from you. It's prob not 100% correct the way it was handled but it works. We can now use the one Issue Linking to handle our use case with the settings below: Issue Regex: ([#|!])(\d+) Issue URL: https://git.example.org/userhere/projecthere/($1=='!'?'merge_requests':'issues')/$2

Repooc avatar May 29 '20 05:05 Repooc

Thanks for raising this improvement request, it's an interesting use case that I haven't come across before! I can see how useful it might be to users that distinguish between issues and merge requests in commit messages.

Although the code change you've mentioned will work for you, the proper solution would definitely be to expand the Issue Linking functionality to be more flexible (like how you mention Fork does it).

I'm unsure how many Git Graph users would use this functionality, so if you're another user who would like this functionality please like the first comment in this thread. I'll gauge user interest in this functionality and prioritise the implementation of this capability accordingly (as the ideal, highly flexible solution has a decent amount of complexity to it)!

mhutchie avatar May 29 '20 08:05 mhutchie

I mean it is how gitlab references them. So in the commit message when you reference a ticket it's reference with #ticketnum and the same with merge requests... if we add a merge request we can reference the merge request with ! in our commit which. With it being clickable its nice to go directly to the merge request that was added or referenced (assuming the merge request itself wasnt added) in the commit. For reference what was changed: image We know its prob not ideal but was easier to do this than add one more section like Issue Linking as none of use touched typescript before lol.

It was either this or try to figure out how to do a redirect in nginx but this was easier as the redirect was a bit harder than I thought it would be.

Repooc avatar May 29 '20 08:05 Repooc

Sorry to expand the scope of this issue - I can create a new one if you'd prefer.

Would we be able to get named variable in the issue urls? (for instance $repo_name, $repo_project etc..) that would allow us to configure global links for entire sites instead of per-repo

bassforce86 avatar Mar 03 '21 09:03 bassforce86

Hi @bassforce86,

That's a great idea! It's definitely within the scope of this improvement / feature request!

mhutchie avatar Mar 03 '21 09:03 mhutchie

I just came looking for this image

#650 links the pull request HOLO-1016 links the ticket

I can see how using global setting for github specifically would make it easier as it is used in most of my repos, which would allow me to additionally add repo-specific issue tracker, however, setting it right for multiple repos might be tricky only using regular expressions. Named variables would definitely come handy.

ackvf avatar Jun 28 '23 11:06 ackvf

I would love if this setting was available from the VSCode extension settings instead of only being available in the extension UI.

robellegate avatar Jul 13 '23 16:07 robellegate

We also would like to see this implemented.

ericbf avatar Nov 17 '23 03:11 ericbf