Non interactive call to magit-clone with repository name translation to URL #4335
-
Hi, Following the documentation, I'm customising (use-package magit
:config
(add-to-list 'magit-clone-name-alist '("\\(my-prefix-.+\\)" "gitlab.example.org" "namespace"))
:custom
(magit-clone-default-directory "~/dev/")
(magit-clone-url-format "https://%h/%n.git")
(magit-clone-set-remote.pushDefault t)) This works beautifully when I clone repositories using I'd like to go a bit further, though. I'd like to write an interactive custom function receiving what comes after
and defined as: (defun my/clone-module (module-name)
(interactive "sModule name: ")
(magit-clone-internal
(concat "my-prefix-" module-name)
magit-clone-default-directory
nil)) However I cannot find any interface in magit allowing me do pass a repository name so magit translates it using Am I missing something? If not, would it make sense to offer an interface to accomplish this? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Don't let that discourage you! Sure I might change it, but if that happens, then you will notice, investigate and quickly fix. No biggie. "Internal" is relative and its meaning can differ between projects, people and even symbols. I would say that here it means "a low-level thingy you are not going to use directly, unless you actually do, in which case you are taking a small risk of manageable breakage". 😁 |
Beta Was this translation helpful? Give feedback.
Don't let that discourage you! Sure I might change it, but if that happens, then you will notice, investigate and quickly fix. No biggie. "Internal" is relative and its meaning can differ between projects, people and even symbols. I would say that here it means "a low-level thingy you are not going to use directly, unless you actually do, in which case you are taking a small risk of manageable breakage". 😁