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

[PATCH] Revert "git.el: Set process-environment instead of invoking env"

From
Karl Hasselström <kha@treskal.com>
Date
Jun 2, 2008, 22:41 UTC
Message-ID
<20080602223907.9612.84564.stgit@yoghurt>
In-Reply-To
<7vod6nk05c.fsf@gitster.siamese.dyndns.org>

This reverts commit dbe48256b41c1e94d81f2458d7e84b1fdcb47026, which caused mis-encoding of non-ASCII author/committer names when the git-status mode is used to create commits.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---
On 2008-05-30 13:27:43 -0700, Junio C Hamano wrote:
Show 7 quoted lines
> Karl Hasselström <kha@treskal.com> writes:
> 
> > How are things going with this fix? Junio, I expect you're waiting
> > for a properly cleaned-up patch, possibly with acks from relevant
> > people?
> 
> You expected correctly.

In case no one who understands how, why, and whether the fix works comes forward, here's a revert of the commit that introduced the problem.

 contrib/emacs/git.el |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 2557a76..4fa853f 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -232,8 +232,10 @@ and returns the process output as a string, or nil if the git failed."
 
 (defun git-run-command-region (buffer start end env &rest args)
   "Run a git command with specified buffer region as input."
-  (unless (eq 0 (let ((process-environment (append (git-get-env-strings env)
-                                                   process-environment)))
+  (unless (eq 0 (if env
+                    (git-run-process-region
+                     buffer start end "env"
+                     (append (git-get-env-strings env) (list "git") args))
                   (git-run-process-region
                    buffer start end "git" args)))
     (error "Failed to run \"git %s\":\n%s" (mapconcat (lambda (x) x) args " ") (buffer-string))))
@@ -248,8 +250,9 @@ and returns the process output as a string, or nil if the git failed."
             (erase-buffer)
             (cd dir)
             (setq status
-                  (let ((process-environment (append (git-get-env-strings env)
-                                                     process-environment)))
+                  (if env
+                      (apply #'call-process "env" nil (list buffer t) nil
+                             (append (git-get-env-strings env) (list hook-name) args))
                     (apply #'call-process hook-name nil (list buffer t) nil args))))
           (display-message-or-buffer buffer)
           (eq 0 status)))))
Previous: Junio C HamanoNext: David Christensen
Message 9 of 10 in “encoding bug in git.el”
  1. Karl HasselströmMay 20, 2008
  2. Clifford CaoileMay 21, 2008
  3. Karl HasselströmMay 21, 2008
  4. Clifford CaoileMay 21, 2008
  5. Karl HasselströmMay 23, 2008
  6. Karl HasselströmMay 25, 2008
  7. Karl HasselströmMay 30, 2008
  8. Junio C HamanoMay 30, 2008
  9. Revert "git.el: Set process-environment instead of invoking env"Karl Hasselström, Jun 2, 2008
  10. David ChristensenJun 3, 2008

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.