delta icon indicating copy to clipboard operation
delta copied to clipboard

๐Ÿ› --hyperlinks can't parse GitHub Enterprise URL

Open kanbara opened this issue 3 years ago โ€ข 5 comments

I have a case that I think is not solved with just --hyperlinks and --hyperlinks-commit-link-format. I was excited to emit hyperlinks, but --hyperlinks-commit-link-format doesn't really make sense to me, as one has to specify the entire path to a repo, making it useless unless it's replicated across multiple .gitconfig files, which is quite prohibitive.

I have a URL like

ยป git remote get-url origin
[email protected]:ORG/repo.git

looking at src/git_config/git_config_entry.rs#L23 I would expect the REGEX to be able to take any github.*\.com and then it could be parsed completely for any GitHub Enterprise URL. Unless I'm missing something, there's no way to do this currently, as one can only put the {commit} in a custom URL.

kanbara avatar Jul 10 '22 03:07 kanbara

Hi @kanbara, can you use repo-specific git config (file at .git/config)? Just for this one setting; everything else can carry on using the usual place. This is what I do for the commit hyperlinks setting.

dandavison avatar Jul 10 '22 09:07 dandavison

I considered that as a possibility, but with 94+ repos, it would certainly take way more time than I'd like. And I'd rather not fork the project just to edit a single regex. I could of course provide a patch, unless you have some reason that checking github.foo.com or foo.github.foo.com would be a bad idea.

kanbara avatar Jul 10 '22 09:07 kanbara