git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] contrib/emacs/git.el: Add user functions for push, pull, fetch

From
AJAlexandre Julliard <julliard@winehq.org>
Date
Apr 3, 2011, 17:27 UTC
Message-ID
<87mxk7454z.fsf@wine.dyndns.org>
In-Reply-To
<87tyef9uu5.fsf@picasso.cante.net>
Jari Aalto <jari.aalto@cante.net> writes:
Show 11 quoted lines
> @@ -1555,6 +1561,13 @@ amended version of it."
>      (define-key map "x"   'git-remove-handled)
>      (define-key map "\C-?" 'git-unmark-file-up)
>      (define-key map "\M-\C-?" 'git-unmark-all)
> +    ; remotes
> +    (define-key remote-map "\C-a" 'git-push)
> +    (define-key remote-map "R" 'git-pull)  ; retrieve "RR"
> +    (define-key remote-map "r" 'git-pull)  ; retrieve "Rr" (synonym)
> +    (define-key remote-map "p" 'git-push)
> +    (define-key remote-map "f" 'git-fetch)
> +    (define-key remote-map "\C-a" 'git-fetch)
The \C-a things look strange.
Show 10 quoted lines
> +(defun git-push (&optional remote)
> +  "Pull to REMOTE. Use \\[current-prefix-arg] to interactively set REMOTE."
> +  (interactive
> +   (list (or (and current-prefix-arg
> +		  (git-ask-remote "Push to remote: "))
> +	     "origin")))
> +  ;; FIXME: could colled some status data for display
> +  (git-call-process-display-error "push" remote)
> +  (git-update-status-files)
> +  (message "Pushed to remote: %s" remote))

You shouldn't display a success message if the call failed. Also there's no need to refresh the status files on push or fetch.

-- 
Alexandre Julliard
julliard@winehq.org
Previous: Jari AaltoNext: jari.aalto@cante.net
Message 4 of 6 in “git.el: Add new user functions for push, pull, fetch.”
  1. git.el: Add new user functions for push, pull, fetch.jari.aalto@cante.net, Mar 22, 2011
  2. contrib/emacs/git.el: Add user functions for push, pull, fetchjari.aalto@cante.net, Mar 22, 2011
  3. Jari AaltoApr 3, 2011
  4. Alexandre JulliardApr 3, 2011
  5. contrib/emacs/git.el: Add user functions for push, pull, fetchjari.aalto@cante.net, Apr 3, 2011
  6. contrib/emacs/git.el: Add user functions for push, pull, fetchjari.aalto@cante.net, Apr 14, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.