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

git-gui patch staging errors

From
J. Paul Reed <preed@sigkill.com>
Date
May 12, 2020, 01:07 UTC
Message-ID
<20200512010750.GA7127@sigkill.com>
Hey all,

I ran into an interesting problem this week where git gui was erroring out on staging partial patches in a particular file I was working on.

I worked around it with "git add -i," which worked like a champ.

I later realized the source file has some special characters (Unicode, probably) in it to print emojis (or colors or whatever fun animations the kids want on their terminals these days).

Interestingly, lines/hunks before the first Unicode character will partial-stage appropriately, but attempting to stage any hunks/lines after the characters produces a "Failed to stage selected line. error: patch failed ... error: ... patch does not apply" error dialog.

This can be reproduced by cloning https://github.com/debek/aws-glacier-multipart-upload.git and editing glacierupload.sh; the special characters are in echo statements on lines 60, 74, and 97.

Removing these control characters seems to calm git gui's indigestion on this file.

[preed@underworld ~]$ git --version git version 2.26.2 [preed@underworld ~]$ git gui --version git-gui version 0.21.0.66.ga5728

best, preed

-- 
J. Paul Reed
https://jpaulreed.com
PGP: 0xDF8708F8
Next: Pratyush Yadav
Message 1 of 7 in “git-gui patch staging errors”
  1. J. Paul ReedMay 12, 2020
  2. Pratyush YadavMay 12, 2020
  3. Kerry, RichardMay 12, 2020
  4. Pratyush YadavMay 12, 2020
  5. J. Paul ReedMay 12, 2020
  6. Pratyush YadavMay 25, 2020
  7. J. Paul ReedJul 26, 2020

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.