delta
delta copied to clipboard
🚀 Hyperlink pull request and issue numbers
Hi Dan, first off thanks so much for making Delta. Switched from diff-so-fancy 2 months ago and never looked back!
I make use of the hyperlink feature a lot. I think one way we can enhance it is to support pull request links in the commit log. When you merge PRs on Github, you may have noticed it'll append (#pr-number)
at the end of the commit message. Maybe delta can hyperlink those?
Hi @PatrickF1, that seems like a great idea and very doable. If you have any interest in implementing it then don't hold back!
Hi Dan, happy to take a stab at it. Could you link me to where the feature for hyperlinked sha's is limited?
Hi Patrick, sorry for the slow reply, I was offline. Commit SHAs are hyperlinked here: https://github.com/dandavison/delta/blob/7375f7a165dabe430e12d531fedd84bb3a027c6b/src/handlers/commit_meta.rs#L37
The client can't really tell if #123
is an issue or a pull request, so I think it should linkify all of them as issues, and rely on the server to redirect if the number is a pull request. This would allow supporting commit message lines like Fixes #123
too.
For example, note how https://github.com/dandavison/delta/issues/1573
gets redirected to https://github.com/dandavison/delta/pull/1573
.
Good point. I know GitHub handles redirects well.
On Sat, Dec 30, 2023 at 12:12 PM Daniel Martà @.***> wrote:
The client can't really tell if #123 is an issue or a pull request, so I think it should linkify all of them as issues, and rely on the server to redirect if the number is a pull request. This would allow supporting commit message lines like Fixes #123 too.
For example, note how https://github.com/dandavison/delta/issues/1573 gets redirected to https://github.com/dandavison/delta/pull/1573.
— Reply to this email directly, view it on GitHub https://github.com/dandavison/delta/issues/1482#issuecomment-1872596890, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPAJECTGG7OCHKTDYXQ4YTYMBYSDAVCNFSM6AAAAAA2RZ664WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGU4TMOBZGA . You are receiving this because you were mentioned.Message ID: @.***>
As a slight optimization, we could probably send (#number) to /pull and #number to /issues, since most of the time, pull requests are added by GitHub in the commit with parens around them.
Btw, in case anyone is waiting on me to implement this, I no longer plan on doing it. Learning Rust proved to be too big of a hurdle to jump. I hope someone else will take this on, thanks!