all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Morgan Smith <Morgan.J.Smith@outlook.com>
Cc: 59158@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
Subject: bug#59158: [PATCH] vc-git: Ensure git doesn't try to colorize stashes
Date: Fri, 11 Nov 2022 21:00:00 -0800	[thread overview]
Message-ID: <CADwFkmmw1oqbceJoxJyoie1qcLYdaXxNNGMy1+vp4MnuReUW7g@mail.gmail.com> (raw)
In-Reply-To: <DM5PR03MB3163A214577D525A6F90C9D7C5009@DM5PR03MB3163.namprd03.prod.outlook.com>

[Please use "Reply to all" so that the discussion is recorded in the bug
tracker.]

Morgan Smith <Morgan.J.Smith@outlook.com> writes:

> Stefan Kangas <stefankangas@gmail.com> writes:
>
>> How can I reproduce this issue, starting from emacs -Q?
>
> I'm using emacs from commit d04433b962
>
>
> A little background first:
>
> So when in Emacs using eshell, git won't give us colored output.  In
> "emacs -Q" we can navigate using eshell to a git repo and type "git
> show HEAD" and we will see no color.  This might prompt us to run "git
> config --global color.ui always".  Now we get all the color with no
> issues.
>
>
> The steps:
>
> Go to a git repo with a stash
>
> Run "git config --global color.ui always"
>
> Run M-x vc-dir (C-x C-v d)
>
> Goto stash and hit RET to open the stash
>
> There are now spurious color control characters everywhere

I still can't reproduce this, using this recipe:

0. emacs -Q
1. C-x d ~/wip/emacs RET
2. C-x C-v d

   I'm now looking at a buffer *vc-dir* that looks like this:

       VC backend : Git
       Working dir: ~/wip/emacs/
       Branch     : master
       Remote     : skangas@git.sv.gnu.org:/srv/git/emacs.git
       Stash      : Hide all stashes (11)
                    {0}: On master: assign
                    {1}: On feature/tree-sitter: wip
                    {2}: On master: tree-sitter
       [...snip...]

3. With point on "{0}:", type RET

Now I get a buffer *vc-git-stash* which is using diff-mode, but I don't
see any spurious control characters.

[time passes]

Okay, I see it now, but I had to do this too:

    git config --global color.diff always

But I cannot reproduce it if I use this instead:

    git config --global color.diff auto

However, as Emacs can't process those control characters in any case, I
think we might as well apply the patch you suggest.  This will save
users from shooting themselves in the foot.

Does anyone see any reason not to?

> Thanks,
>
> Morgan





  parent reply	other threads:[~2022-11-12  5:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 21:22 bug#59158: [PATCH] vc-git: Ensure git doesn't try to colorize stashes Morgan Smith
2022-11-11 12:44 ` Stefan Kangas
     [not found]   ` <DM5PR03MB3163A214577D525A6F90C9D7C5009@DM5PR03MB3163.namprd03.prod.outlook.com>
2022-11-12  5:00     ` Stefan Kangas [this message]
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=CADwFkmmw1oqbceJoxJyoie1qcLYdaXxNNGMy1+vp4MnuReUW7g@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=59158@debbugs.gnu.org \
    --cc=Morgan.J.Smith@outlook.com \
    --cc=juri@linkov.net \
    /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.