git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David Kågedal" <davidk@lysator.liu.se>
To: Alexandre Julliard <julliard@winehq.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH] git.el: Set process-environment instead of invoking env
Date: Tue, 19 Feb 2008 15:01:53 +0100	[thread overview]
Message-ID: <87r6f958k5.fsf@lysator.liu.se> (raw)

This will make it a little less posix-dependent, and more efficient.

Included is also a minor doc improvement.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
---
 contrib/emacs/git.el |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index a8bf0ef..f69b697 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -185,9 +185,8 @@ if there is already one that displays the same directory."
 
 (defun git-call-process-env (buffer env &rest args)
   "Wrapper for call-process that sets environment strings."
-  (if env
-      (apply #'call-process "env" nil buffer nil
-             (append (git-get-env-strings env) (list "git") args))
+  (let ((process-environment (append (git-get-env-strings env)
+                                     process-environment)))
     (apply #'call-process "git" nil buffer nil args)))
 
 (defun git-call-process-display-error (&rest args)
@@ -204,7 +203,7 @@ if there is already one that displays the same directory."
 
 (defun git-call-process-env-string (env &rest args)
   "Wrapper for call-process that sets environment strings,
-and returns the process output as a string."
+and returns the process output as a string, or nil if the git failed."
   (with-temp-buffer
     (and (eq 0 (apply #' git-call-process-env t env args))
          (buffer-string))))
-- 
1.5.4.2.148.g410dc


-- 
David Kågedal

             reply	other threads:[~2008-02-19 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-19 14:01 David Kågedal [this message]
2008-02-20 11:21 ` [PATCH] git.el: Set process-environment instead of invoking env Alexandre Julliard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r6f958k5.fsf@lysator.liu.se \
    --to=davidk@lysator.liu.se \
    --cc=git@vger.kernel.org \
    --cc=julliard@winehq.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).