All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] git-gui: Implement "Stage/Unstage Line"
Date: Wed, 2 Jul 2008 01:23:42 -0400	[thread overview]
Message-ID: <20080702052342.GN11793@spearce.org> (raw)
In-Reply-To: <48649519.1010307@viscovery.net>

Johannes Sixt <j.sixt@viscovery.net> wrote:
> From: Johannes Sixt <johannes.sixt@telecom.at>
> 
> 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.

      reply	other threads:[~2008-07-02  5:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-27  7:22 [PATCH] git-gui: Implement "Stage/Unstage Line" Johannes Sixt
2008-07-02  5:23 ` Shawn O. Pearce [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080702052342.GN11793@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.