From 2abbccd18bbbd2d783ea6b1a3d6bfe468f3810c8 Mon Sep 17 00:00:00 2001 From: Ravi R Kiran Date: Sun, 5 Mar 2017 19:52:53 -0800 Subject: Sync to a different host if specified diff --git a/lisp/ravi-init-vc.el b/lisp/ravi-init-vc.el index e464d2f..8ddba5c 100644 --- a/lisp/ravi-init-vc.el +++ b/lisp/ravi-init-vc.el @@ -41,6 +41,14 @@ (setq magit-restore-window-configuration t) (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh) + (defun ravi/sync-top-level () + (when (and (boundp 'ravi/sync-top-level-host) + (not (s-equals? (car s-split-up-to "\\." (system-name) 1) + (car s-split-up-to "\\." ravi/sync-top-level-host 1)))) + (message "Synchronizing with %s" ravi/sync-top-level-host) + (shell-command (concat "rsync -a " (magit-toplevel) " " ravi/sync-top-level-host ":" (magit-toplevel))))) + (add-hook 'magit-post-refresh-hook 'ravi/sync-top-level) + (use-package magit-svn :config (add-hook 'magit-mode-hook 'magit-svn-mode) :ensure t) -- cgit v0.10.1