Closed nbarrientos closed 1 year ago
Yes in v1 git-link-use-commit
will default to t
. I also think C-u
should toggle in v1 and C-u C-u
should prompt for remote. In the meantime this will due. Thanks!
Thanks for merging! Perfectly fine if the C-u
semantics change in the future :smile:
Nice. but how to change both at the same time?
Nice. but how to change both at the same time?
@liuyinz I don't know, suggestions?
Hi,
I personally tend to prefer setting
git-link-use-commit
tot
globally, but in some cases, when callinggit-link
, I'd love to be able to temporarily change the value ofgit-link-use-commit
tonil
so the generated link points to the checked out branch instead of to the commit hash. I have a function like this in my config:However it'd be cooler and more convenient if it was possible to "request" this behaviour when calling
git-link
.This patch changes a little bit the semantics of the prefix argument, using a single prefix argument to select the remote (trying to make this interface change not hugely painful for users) and adding a double prefix argument to flip the current value of
git-link-use-commit
(only in the context of the current call togit-link
, of course).With this change applied, instead of having to maintain my own function like above, I'd only have to call:
To generate a link to the file pointing to the current branch 😇
It'd be totally acceptable also to make this new feature cumulative with double prefix argument meaning then "select remote" and "invert
git-link-use-commit
".Thanks for considering the patch.