pkg update and first config fix
org-brain not working, add org-roam
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
;;; magit-clone.el --- clone a repository -*- lexical-binding: t -*-
|
||||
;;; magit-clone.el --- Clone a repository -*- lexical-binding:t -*-
|
||||
|
||||
;; Copyright (C) 2008-2022 The Magit Project Contributors
|
||||
;;
|
||||
;; You should have received a copy of the AUTHORS.md file which
|
||||
;; lists all contributors. If not, see http://magit.vc/authors.
|
||||
;; Copyright (C) 2008-2022 The Magit Project Contributors
|
||||
|
||||
;; Author: Jonas Bernoulli <jonas@bernoul.li>
|
||||
;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
|
||||
|
||||
;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
;; Magit is free software; you can redistribute it and/or modify it
|
||||
;; Magit is free software: you can redistribute it and/or modify it
|
||||
;; under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 3, or (at your option)
|
||||
;; any later version.
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
;;
|
||||
;; Magit is distributed in the hope that it will be useful, but WITHOUT
|
||||
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
@@ -21,7 +18,7 @@
|
||||
;; License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with Magit. If not, see http://www.gnu.org/licenses.
|
||||
;; along with Magit. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
@@ -72,7 +69,8 @@ directly."
|
||||
|
||||
(defcustom magit-clone-name-alist
|
||||
'(("\\`\\(?:github:\\|gh:\\)?\\([^:]+\\)\\'" "github.com" "github.user")
|
||||
("\\`\\(?:gitlab:\\|gl:\\)\\([^:]+\\)\\'" "gitlab.com" "gitlab.user"))
|
||||
("\\`\\(?:gitlab:\\|gl:\\)\\([^:]+\\)\\'" "gitlab.com" "gitlab.user")
|
||||
("\\`\\(?:sourcehut:\\|sh:\\)\\([^:]+\\)\\'" "git.sr.ht" "sourcehut.user"))
|
||||
"Alist mapping repository names to repository urls.
|
||||
|
||||
Each element has the form (REGEXP HOSTNAME USER). When the user
|
||||
@@ -89,19 +87,30 @@ default user specified in the matched entry is used.
|
||||
If USER contains a dot, then it is treated as a Git variable and
|
||||
the value of that is used as the username. Otherwise it is used
|
||||
as the username itself."
|
||||
:package-version '(magit . "3.0.0")
|
||||
:package-version '(magit . "3.4.0")
|
||||
:group 'magit-commands
|
||||
:type '(repeat (list regexp
|
||||
(string :tag "hostname")
|
||||
(string :tag "user name or git variable"))))
|
||||
(string :tag "Hostname")
|
||||
(string :tag "User name or git variable"))))
|
||||
|
||||
(defcustom magit-clone-url-format "git@%h:%n.git"
|
||||
"Format used when turning repository names into urls.
|
||||
%h is the hostname and %n is the repository name, including
|
||||
the name of the owner. Also see `magit-clone-name-alist'."
|
||||
:package-version '(magit . "3.0.0")
|
||||
(defcustom magit-clone-url-format
|
||||
'(("git.sr.ht" . "git@%h:%n")
|
||||
(t . "git@%h:%n.git"))
|
||||
"Format(s) used when turning repository names into urls.
|
||||
|
||||
In a format string, %h is the hostname and %n is the repository
|
||||
name, including the name of the owner.
|
||||
|
||||
The value can be a string (representing a single static format)
|
||||
or an alist with elements (HOSTNAME . FORMAT) mapping hostnames
|
||||
to formats. When an alist is used, the t key represents the
|
||||
default. Also see `magit-clone-name-alist'."
|
||||
:package-version '(magit . "3.4.0")
|
||||
:group 'magit-commands
|
||||
:type 'regexp)
|
||||
:type '(choice (string :tag "Format")
|
||||
(alist :key-type (choice (string :tag "Host")
|
||||
(const :tag "Default" t))
|
||||
:value-type (string :tag "Format"))))
|
||||
|
||||
;;; Commands
|
||||
|
||||
@@ -139,7 +148,7 @@ the name of the owner. Also see `magit-clone-name-alist'."
|
||||
("m" "mirror" magit-clone-mirror)]
|
||||
(interactive (list (or magit-clone-always-transient current-prefix-arg)))
|
||||
(if transient
|
||||
(transient-setup #'magit-clone)
|
||||
(transient-setup 'magit-clone)
|
||||
(call-interactively #'magit-clone-regular)))
|
||||
|
||||
(transient-define-argument magit-clone:--filter ()
|
||||
@@ -147,7 +156,7 @@ the name of the owner. Also see `magit-clone-name-alist'."
|
||||
:class 'transient-option
|
||||
:key "-f"
|
||||
:argument "--filter="
|
||||
:reader 'magit-clone-read-filter)
|
||||
:reader #'magit-clone-read-filter)
|
||||
|
||||
(defun magit-clone-read-filter (prompt initial-input history)
|
||||
(magit-completing-read prompt
|
||||
@@ -233,7 +242,7 @@ Then show the status buffer for the new repository."
|
||||
(setq directory (file-name-as-directory (expand-file-name directory)))
|
||||
(when (file-exists-p directory)
|
||||
(if (file-directory-p directory)
|
||||
(when (> (length (directory-files directory)) 2)
|
||||
(when (length> (directory-files directory) 2)
|
||||
(let ((name (magit-clone--url-to-name repository)))
|
||||
(unless (and name
|
||||
(setq directory (file-name-as-directory
|
||||
@@ -314,16 +323,24 @@ Then show the status buffer for the new repository."
|
||||
'magit-clone-name-alist)))
|
||||
|
||||
(defun magit-clone--format-url (host user repo)
|
||||
(format-spec
|
||||
magit-clone-url-format
|
||||
`((?h . ,host)
|
||||
(?n . ,(if (string-match-p "/" repo)
|
||||
repo
|
||||
(if (string-match-p "\\." user)
|
||||
(if-let ((user (magit-get user)))
|
||||
(concat user "/" repo)
|
||||
(user-error "Set %S or specify owner explicitly" user))
|
||||
(concat user "/" repo)))))))
|
||||
(if-let ((url-format
|
||||
(cond ((listp magit-clone-url-format)
|
||||
(cdr (or (assoc host magit-clone-url-format)
|
||||
(assoc t magit-clone-url-format))))
|
||||
((stringp magit-clone-url-format)
|
||||
magit-clone-url-format))))
|
||||
(format-spec
|
||||
url-format
|
||||
`((?h . ,host)
|
||||
(?n . ,(if (string-search "/" repo)
|
||||
repo
|
||||
(if (string-search "." user)
|
||||
(if-let ((user (magit-get user)))
|
||||
(concat user "/" repo)
|
||||
(user-error "Set %S or specify owner explicitly" user))
|
||||
(concat user "/" repo))))))
|
||||
(user-error
|
||||
"Bogus `magit-clone-url-format' (bad type or missing default)")))
|
||||
|
||||
;;; _
|
||||
(provide 'magit-clone)
|
||||
|
||||
Reference in New Issue
Block a user