Replies: 1 comment
-
I created a prototype of such a function: (defun borg-sync-drone-remotes (&optional drone)
"Sync drone remotes with optional DRONE."
(interactive (list (if current-prefix-arg
(read-from-minibuffer "Drone: ")
nil)))
(let (remote-added)
(dolist (drone (or drone
(borg-clones)))
(let* ((drone-remote (borg-get drone "remote"))
(drone-remote-str (if drone-remote
(split-string drone-remote " "))))
(if drone-remote-str
(let* ((drone-remote-name (car drone-remote-str))
(drone-remote-url (cadr drone-remote-str))
(default-directory (borg-worktree done)
(magit-remote-add-set-remote.pushDefault drone-remote-name))
(if (file-exists-p default-directory)
(if (not (magit-remote-p drone-remote-name))
(magit-remote-add (car drone-remote-str) (cadr drone-remote-str)))
(message (format "Drone %s is not active, populate first" drone))))))))) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While using borg with multiple machines I noticed for my self that it is tedious to deal with adding my forks remote when I changed a drone.
It would be great if borg would have a function to sync the remotes of a drone from
.gitmodules
to each drone.Ideally the function would be called just before fetching submodules
so that fetching for these wont fails with something like
Could not find <ref>
.Beta Was this translation helpful? Give feedback.
All reactions