Feature request - git add --patch should have an option to discard or drop a hunk Inbox

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux