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

Re: How to reset selected lines?

From
Johannes Sixt <j6t@kdbg.org>
Date
Aug 13, 2019, 22:07 UTC
Message-ID
<1f31dd2c-3023-2d13-3466-bffabab703cc@kdbg.org>
In-Reply-To
<20190813141816.yoer6pfjdnlgtj76@localhost.localdomain>
Am 13.08.19 um 16:18 schrieb Pratyush Yadav:
> Now, I want to add a similar feature, but one that discards/resets the 
> selected lines. And I'd like to avoid the hack that git-gui's 
> apply_range_or_line is. So, is there a cleaner way to do this that does 
> not involve generating a diff and then applying it?

Don't waste your time. I'm using this feature since years. It's available in these three commits:

https://github.com/j6t/git/commit/55276690b2bc6a https://github.com/j6t/git/commit/f12b294b68b595 https://github.com/j6t/git/commit/00860615691604

Thanks go to Bert Wesarg. The patches are also available in this thread:
https://public-inbox.org/git/cccd6193cf3bfe170e14270204d735a842bb8563.1326116492.git.bert.wesarg@googlemail.com/#t
-- Hannes
Previous: Jeff KingNext: Pratyush Yadav
Message 6 of 7 in “How to reset selected lines?”
  1. Pratyush YadavAug 13, 2019
  2. Jeff KingAug 13, 2019
  3. Junio C HamanoAug 13, 2019
  4. Pratyush YadavAug 14, 2019
  5. Jeff KingAug 14, 2019
  6. Johannes SixtAug 13, 2019
  7. Pratyush YadavAug 14, 2019

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.