If in magit-revision buffer, git-link can open the commit#151
If in magit-revision buffer, git-link can open the commit#151FrostyX wants to merge 1 commit intosshaw:masterfrom
Conversation
|
Considering your screenshot ... If I install a
Which on one hand makes sense and basically tells me that I need to move my cursor on some commit hash and run In the PR I am improving
I did not know that, thank you. That's a nice feature and my PR accidentally breaks that. What I was trying to achieve was ... if in a |
Great, thanks for clarifying. I wanted to understand what is going on high-level before lookin' at the code (too much!
Yes, sounds useful. Currently the PR modifies |
|
Added a Magit Revision Buffer section to the docs d9b375f |
f16ca34 to
51d14e9
Compare
Nice, I think it will be helpful :-)
My apologies, when writing the comment I realized I didn't explain the change in the PR description clearly enough.
I think the change was almost correct, I just improved the condition. Please take a look, I think it works exactly how we want now. |
|
Thanks for the update. Is there a need to modify |
I think this better than printing an error that > Can't figure out what to link to When in a `magit-revision` buffer, people most likely want to link the displayed commit. But this also allows to link a commit that the cursor is pointing to.
51d14e9 to
4985941
Compare
|
It wasn't necessary. I thought of it as a nice helper, allowing to just use |
| (setq commit (word-at-point)) | ||
| (when (and (not (string-match-p "[a-fA-F0-9]\\{7,40\\}" (or commit ""))) | ||
| (derived-mode-p 'magit-revision-mode)) | ||
| (setq commit (magit-buffer-revision))) |
There was a problem hiding this comment.
This function does not exist for me:
setq: Symbol’s function definition is void: magit-buffer-revision
I'm on Emacs 29.4 with Magit 20241001.2052. We should make sure it works on old versions (assuming this is the problem)
There was a problem hiding this comment.
I'm on Emacs 29.4 with Magit 20241001.2052. We should make sure it works on old versions (assuming this is the problem)
If this function was introduced in later versions and there's no alternative we can call (functionp) for the time being to guard against cases where it does not exist.

I think this better than printing an error that
When in a
magit-revisionbuffer, people most likely want to link the displayed commit. But this also allows to link a commit that the cursor is pointing to.