git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Feature request - git add --patch should have an option to discard or drop a hunk Inbox
@ 2021-01-07 16:43 Jon Sagotsky
  2021-01-08  9:10 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Sagotsky @ 2021-01-07 16:43 UTC (permalink / raw)
  To: git

I frequently make changes to a number of files.  I use `git add -p` to
select a number of changes and wrap them up in a commit.  Then I run
it again to build another commit.  Wash, rinse, repeat.

Sometimes I make a change I don't intend to keep.  Maybe it's a typo,
or some debug code, or my linter does something naughty.  As
described, I have to skip that hunk once per commit I'm building.
Usually this is merely inconvenient, but each pass through `git add
-p` runs the risk of me mistakenly adding unintended changes to my
commit.

I could use `e` to edit away that hunk, but for some odd reason that
feels too tedious.  What I'd really like as a small quality of life
enhancement is the ability to discard a hunk so that it's deleted
immediately and I don't have to skip it again.  `d` is taken, so I
suggest `x` as a shortcut.

Thanks!
Jon

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-08 16:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 16:43 Feature request - git add --patch should have an option to discard or drop a hunk Inbox Jon Sagotsky
2021-01-08  9:10 ` Jeff King
2021-01-08 15:21   ` Johannes Schindelin
2021-01-08 16:15     ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).