emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vc-pull/vc-push support


From: Ævar Arnfjörð Bjarmason
Subject: Re: vc-pull/vc-push support
Date: Tue, 25 May 2010 09:45:17 +0000

On Tue, May 25, 2010 at 07:06, Dan Nicolaescu <address@hidden> wrote:
> This has been sitting on my disk for quite a while, and did not see much 
> progress :-(
> vc-pull/vc-push without any options work for bzr, but that's about it.
> Maybe someone would find this useful and want to help finish the 
> implementation...

These are some hacky enhancements I used to pull/push with Git +
vc. I've now removed them from my ~/.emacs since I use magit. But
perhaps they'll be nice for reference.

They allow you to push with C-u C-x v p, and pull with C-x v p.

    ;; This could be made portable but I'm not interested in that at the
    ;; moment so it's git-only.

    (defun vc-push-or-pull ()
      "`vc-push' if given an argument, otherwise `vc-pull'"
      (interactive)
      (if current-prefix-arg
          (vc-push)
          (vc-pull)))

    (defun vc-push ()
      "Run git-push on the current repository, does a dry-run unless
    given a prefix arg."
      (interactive)
      (shell-command "git push"))

    (defun vc-pull ()
      "Run git-pull on the current repository."
      (interactive)
      (shell-command "git pull"))

    ;; vc.el - add commands to push and pull with git
    (progn
      (define-key vc-prefix-map "p" 'vc-push-or-pull))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]