git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* How to reset selected lines?
@ 2019-08-13 14:18 Pratyush Yadav
  2019-08-13 15:42 ` Jeff King
  2019-08-13 22:07 ` Johannes Sixt
  0 siblings, 2 replies; 7+ messages in thread
From: Pratyush Yadav @ 2019-08-13 14:18 UTC (permalink / raw)
  To: git

Hi,

To put things into context of why I am asking this, git-gui has a 
feature where you can select parts of a displayed diff, and can 
stage/unstage those parts. That feature is implemented in git-gui by 
just generating a diff from the selected lines, and then applying it. 
Check git-gui/lib/diff.tcl:643 for the implementation.

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?

Also, if there is a better way of staging and unstaging selected lines 
as well, do let me know, and I will try to fix git-gui's hacky way of 
doing it.

-- 
Regards,
Pratyush Yadav

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

end of thread, other threads:[~2019-08-14 14:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13 14:18 How to reset selected lines? Pratyush Yadav
2019-08-13 15:42 ` Jeff King
2019-08-13 17:32   ` Junio C Hamano
2019-08-14 11:48   ` Pratyush Yadav
2019-08-14 14:52     ` Jeff King
2019-08-13 22:07 ` Johannes Sixt
2019-08-14 11:11   ` Pratyush Yadav

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).