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

RFE: Document "edit" in "git restore --patch"

From
Pierre Ossman <ossman@cendio.se>
Date
Aug 28, 2024, 13:02 UTC
Message-ID
<fddbaeb1-d9eb-4494-b196-94fd4b666471@cendio.se>
Hi,

"git restore --patch" is a very nice tool to clean up temporary gunk from your working directory. It has an "edit" mode, for more complex chunks. But it's confusing how it works, and that confusion is not clearly documented.

What it seems to do is apply the edited diff *in reverse* to the working copy. Technically understandable. But still annoying, and a bit of a brain-teaser, although manageable as long as you are aware of it.

I think it would be helpful if this is more clearly mentioned in the documentation for "git restore".

Regards,
-- 
Pierre Ossman           Software Development
Cendio AB               https://cendio.com
Teknikringen 8          https://twitter.com/ThinLinc
583 30 Linköping        https://facebook.com/ThinLinc
Phone: +46-13-214600

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Message 1 of 1 in “RFE: Document "edit" in "git restore --patch"”
  1. Pierre OssmanAug 28, 2024

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.