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

Git trims the last character of content from remotes

From
HBHugo Osvaldo Barrera <hugo@whynothugo.nl>
Date
May 4, 2026, 17:01 UTC
Message-ID
<2d3f5504-f5dd-4171-96e8-b5633b6a1f5e@app.fastmail.com>
Hi all,

When I push content to GitLab, the remote server sends back some text which git then prints to stderr:

  remote:
  remote: To create a merge request for zk, visit:
  remote:   https://gitlab.alpinelinux.org/WhyNotHugo/aports/-/merge_requests/new?merge_request%5Bsource_branch%5D=zk
  remote:

When the width of a whole line is the same as my terminal width, the last digit gets trimmed off. E.g.: if I resize my terminal for the above to fix exactly, and re-run the same command, git prints:

  remote:   https://gitlab.alpinelinux.org/WhyNotHugo/aports/-/merge_requests/new?merge_request%5Bsource_branch%5D=z

From what I can tell, 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.

When piping to cat or to a file, this sequence is not printed, so the output is fine.

Is this a bug?
Thanks,
PS: please CC me, as I am not subscribed to the list.
-- 
Hugo
Next: Chris Torek
Message 1 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.