Re: [PATCH] git-gui: Implement "Stage/Unstage Line"

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

 



Johannes Sixt <j.sixt@xxxxxxxxxxxxx> wrote:
> From: Johannes Sixt <johannes.sixt@xxxxxxxxxx>
> 
> This adds a context menu entry below "Stage/Unstage Hunk" that stages or
> unstages just the line under the mouse pointer.

Thanks!  After some brief testing this is in now my tree on repo.or.cz.
 
> 	Disclaimer: I'm Tcl/Tk illiterate. Feel free to munge the patch
> 	to your taste.

I wouldn't say illiterate, given this contribution.  :)
 
> 	The 'do_rescan' is probably a bit heavy-weight. But editing the
> 	diff window like we do in "Stage Hunk" would be a bit complex, and
> 	just redisplaying the diff is easier.

Yea, I see why you are doing a do_rescan at the end.  I was going
to suggest just calling reshow_diff but that doesn't get the lists
updated properly when a file is being initially staged as a result
of the current line being added.

Editing the Tk widget is possible, but it can be a pain.

> 	Furthermore, I don't know why I have to do the loop until
> 	"end - 1 chars". If it goes until "end", then the hunk contains
> 	an extra line, so that the patch in general does not apply.
> 	Is there an extra newline in the diff view that is not in the
> 	git diff output?

Yup.  Tk text widgets have an extra "\n" at the end of the content
that was inserted into it.  Thus an empty text widget has a single
LF as its content.  Weird, I know.
 
-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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