From: "René Scharfe" <l.s.r@web.de>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Chris Torek <chris.torek@gmail.com>,
Hugo Osvaldo Barrera <hugo@whynothugo.nl>,
git@vger.kernel.org
Subject: Re: Git trims the last character of content from remotes
Date: Wed, 6 May 2026 18:00:04 +0200 [thread overview]
Message-ID: <4d8aa86f-160a-4f01-beaf-e3f011f875cf@web.de> (raw)
In-Reply-To: <CAHYJk3SW-JwWwk2h=vfDQ4udwQoW2TrmcntiPVwjUJSGiLU2wQ@mail.gmail.com>
On 5/6/26 11:40 AM, Mikael Magnusson wrote:
> On Wed, May 6, 2026 at 11:37 AM Mikael Magnusson <mikachu@gmail.com> wrote:
>>
>> On Tue, May 5, 2026 at 9:46 PM René Scharfe <l.s.r@web.de> wrote:
>>>
>>> On 5/5/26 2:34 AM, Chris Torek wrote:
>>>> On Mon, May 4, 2026 at 10:02 AM Hugo Osvaldo Barrera <hugo@whynothugo.nl> wrote:
>>>> [snippage]
>>>>> When the width of a whole line is the same as my terminal width ...
>>>> [snippage]
>>>>> ... sideband.c prints ANSI_SUFFIX = "\033[K", this escape
>>>>> sequence being "clear the line from the current position until the end of the
>>>>> line", and this is the root cause of the issue.
>>>
>>>> If you have a non-empty prefix
>>>> string before this "clear to end of line" suffix, the solution is more
>>>> obvious: print the ESC [ K as a *prefix* rather than a suffix, but
>>>> that fails with the empty prefix.
>>> We do have a non-empty prefix, but why would it be necessary? What's
>>> wrong with clearing the full line starting from column 1?
>>>
>>> Anyway, do you mean something like this?
>>
>> If the purpose of the clear is to reset the background color on
>> wrapped lines, this will not have any effect, since you clear before
>> the new line is wrapped in. (This is a bit of an obscure edge case, if
>> you set the background color, and wrap the line, the entire new line
>> will be scrolled in with the active background color, then you write
>> perhaps 10 more characters and send the sequence to reset the
>> background color, but the entire rest of the line is still brown, or
>> whatever it was set to when you wrapped).
>>
>> Example command to reproduce locally,
>> % echo -e '\e[43maaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\e[0mhihi'
>> (Add more aaaaaaa if necessary so that the line breaks before they end).
>
> Sorry for the double post, but I forgot an important thing, this only
> happens if you *actually* scroll in a new line, ie if you open a new
> terminal and run this, you won't see any problems until you get to the
> bottom of the screen.
The purpose of clearing here is to avoid leaving local progress line
remnants after the remote line. Original discussion:
https://lore.kernel.org/git/alpine.LFD.0.9999.0711032328490.21255@xanadu.home/
You're right that erasing before filling the whole line and then some
is unnecessary. But it wouldn't hurt, either, no?
René
next prev parent reply other threads:[~2026-05-06 16:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 17:01 Git trims the last character of content from remotes Hugo Osvaldo Barrera
2026-05-05 0:34 ` Chris Torek
2026-05-05 19:41 ` René Scharfe
2026-05-06 9:37 ` Mikael Magnusson
2026-05-06 9:40 ` Mikael Magnusson
2026-05-06 16:00 ` René Scharfe [this message]
2026-05-10 12:42 ` [PATCH] sideband: clear full line when printing remote messages René Scharfe
2026-05-10 23:30 ` Junio C Hamano
2026-05-05 9:38 ` Git trims the last character of content from remotes Mikael Magnusson
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=4d8aa86f-160a-4f01-beaf-e3f011f875cf@web.de \
--to=l.s.r@web.de \
--cc=chris.torek@gmail.com \
--cc=git@vger.kernel.org \
--cc=hugo@whynothugo.nl \
--cc=mikachu@gmail.com \
/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 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.