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

Re: Git trims the last character of content from remotes

From
MMMikael Magnusson <mikachu@gmail.com>
Date
May 6, 2026, 09:40 UTC
Message-ID
<CAHYJk3SW-JwWwk2h=vfDQ4udwQoW2TrmcntiPVwjUJSGiLU2wQ@mail.gmail.com>
In-Reply-To
<CAHYJk3Q6xjW8mBvbQkN3vsDb2e9Em6PuDinFoTFwqkTXaKK=rQ@mail.gmail.com>
On Wed, May 6, 2026 at 11:37 AM Mikael Magnusson <mikachu@gmail.com> wrote:
Show 33 quoted lines
>
> 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.

-- 
Mikael Magnusson
Previous: Mikael MagnussonNext: René Scharfe
Message 5 of 10 in “Git trims the last character of content from remotes”
  1. Hugo Osvaldo BarreraMay 4, 2026
  2. Chris TorekMay 5, 2026
  3. René ScharfeMay 5, 2026
  4. Mikael MagnussonMay 6, 2026
  5. Mikael MagnussonMay 6, 2026
  6. René ScharfeMay 6, 2026
  7. sideband: clear full line when printing remote messagesRené Scharfe, May 10, 2026
  8. Junio C HamanoMay 10, 2026
  9. Mikael MagnussonMay 5, 2026
  10. Junio C HamanoAug 3, 2026

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.