all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Morgan Smith <Morgan.J.Smith@outlook.com>
To: 59158@debbugs.gnu.org
Subject: bug#59158: [PATCH] vc-git: Ensure git doesn't try to colorize stashes
Date: Wed, 09 Nov 2022 16:22:06 -0500	[thread overview]
Message-ID: <DM5PR03MB316392A0A129BDD0AE79113DC53E9@DM5PR03MB3163.namprd03.prod.outlook.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-vc-git-Ensure-git-doesn-t-try-to-colorize-stashes.patch --]
[-- Type: text/x-patch, Size: 1008 bytes --]

From 3a5b77c93742ea0ad5ad89d8af3531f18411b88a Mon Sep 17 00:00:00 2001
From: Morgan Smith <Morgan.J.Smith@outlook.com>
Date: Wed, 9 Nov 2022 16:16:55 -0500
Subject: [PATCH] vc-git: Ensure git doesn't try to colorize stashes

* lisp/vc/vc-git.el (vc-git-stash-show): Add --color=never to git flags
---
 lisp/vc/vc-git.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 74536309e2..a1ff03144b 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1883,7 +1883,8 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
   "Show the contents of stash NAME."
   (interactive (list (vc-git-stash-read "Show stash: ")))
   (vc-setup-buffer "*vc-git-stash*")
-  (vc-git-command "*vc-git-stash*" 'async nil "stash" "show" "-p" name)
+  (vc-git-command "*vc-git-stash*" 'async nil
+                  "stash" "show" "--color=never" "-p" name)
   (set-buffer "*vc-git-stash*")
   (setq buffer-read-only t)
   (diff-mode)
-- 
2.38.0


[-- Attachment #2: Type: text/plain, Size: 260 bytes --]


Hello,

So if you've configured git with "git config --global color.ui always"
then "git stash show" will create lots of spurious color escape
characters that our stash viewer code cannot deal with.  This patch
makes sure that doesn't happen

Thanks,

Morgan

             reply	other threads:[~2022-11-09 21:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 21:22 Morgan Smith [this message]
2022-11-11 12:44 ` bug#59158: [PATCH] vc-git: Ensure git doesn't try to colorize stashes Stefan Kangas
     [not found]   ` <DM5PR03MB3163A214577D525A6F90C9D7C5009@DM5PR03MB3163.namprd03.prod.outlook.com>
2022-11-12  5:00     ` Stefan Kangas
2022-11-12 17:57       ` Juri Linkov
2022-11-12 19:41         ` Stefan Kangas

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=DM5PR03MB316392A0A129BDD0AE79113DC53E9@DM5PR03MB3163.namprd03.prod.outlook.com \
    --to=morgan.j.smith@outlook.com \
    --cc=59158@debbugs.gnu.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.