Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyperlink #123 to the respective issue/ticket #214

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

muhqu
Copy link

@muhqu muhqu commented Jul 5, 2013

Adding this pull request in response to Issue #187.

I added this a very long time ago to another fork of GitX. Now I rebased this commit onto GitX-dev master.

Here is how it works, just add gitx.ticketurl to your repositorys .git/config.

[gitx]
   ticketurl = "http://trac.example.org/ticket/{id}"

To point to github issues just use:

$ git config gitx.ticketurl 'https://github.com/rowanj/gitx/issues/{id}'

ToDo:

  • change pattern matching to: replace {id} or just append
  • auto detect GitHub "origin" for a default
  • always make #123 links, if not configured show message how to do it
  • change [PBGitHistoryController showConfigureGitxTicketUrl] to not only show a hint, instead let the user configure the Ticket URL right away...

configure-ticket-url

@rowanj
Copy link
Owner

rowanj commented Jul 8, 2013

Thanks! I'll look at merging this soon.

Just some notes for myself when I look at this:

  • It should be quite simple to add a Preferences option to add this
  • Perhaps the match pattern also needs to be configurable
  • Auto-detect and default to GitHub pattern if a remote has a GitHub URL

@muhqu
Copy link
Author

muhqu commented Jul 8, 2013

I don't think the pattern needs to be configurable, but the pattern should be dead simple. I know replacing * with the issue id is not that obvious. I'll change it to look for a placeholder like {id} to replace it.If the placeholder is not found the id will just be appended.

Auto-detection for GitHub pattern would be great. But I think it should be sufficient to just check the remote named "origin".

A preference option doesn't make much sense here, as it is a per-repository setting. Does GitX already allow to modify git-config settings?

If no gitx.ticketurl is configured auto-detection failed the numbers could still be linked. When clicked, they could open a popup to configure gitx.ticketurl (something like the one used for tag info). Maybe right-click context-menu on a #123 link could list an entry like "Configure URL..".

@rowanj
Copy link
Owner

rowanj commented Jul 8, 2013

The preference can be stored/read from the repository (i.e. non-global git config) rather than the user defaults; there are a few other things I'd like to store against the repo; and this may be a good excuse for a repo inspector/settings window.

muhqu added 4 commits July 8, 2013 09:57
…u which shows a help message on how to configure gitx.ticketurl.
and..
- moved logic away from javascript
- added a "Copy URL" context menu item
@muhqu
Copy link
Author

muhqu commented Jul 11, 2013

@rowanj I added a custom view PBGitXConfigureTicketURLSheet that lets the user set the gitx.ticketurl config setting. maybe some methods are not properly named because I have not much objective-c knowledge... bear with me. ;-)

ssp pushed a commit to ssp/gitx that referenced this pull request May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants