From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Johannes Sixt <J.Sixt@eudaptics.com>, git@vger.kernel.org
Subject: Re: [PATCH] Teach git-gui to split hunks
Date: Thu, 26 Jul 2007 15:34:22 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0707261527040.14781@racer.site> (raw)
In-Reply-To: <20070726070744.GD18114@spearce.org>
Hi,
On Thu, 26 Jul 2007, Shawn O. Pearce wrote:
> [talk about the --unidiff-zero stuff]
>
> Yea, there's context there. Junio and I talked about this patch on #git
> a few minutes ago. I really appreciate that Dscho wrote it, especially
> given that he hasn't really been into Tcl hacking for Git much before.
Heh. I did my share of Tcl hacking. In one (closed source) project, I
was in constant awe why the devs chose Tcl as a scripting language, but Qt
as windowing library (back when it was pretty expensive for a startup to
use Qt).
> But I'd really like to save/create context, like `git add -i` does, so
> that we don't have to use --unidiff-zero here.
See below.
> It won't matter if git-apply rejected overlapping context in this case.
> git-gui will only ever feed one hunk at a time to git-apply. And if
> things get really f'd in the diff buffer the user can easily regenerate
> it (right click, Refresh).
But you're right, the other hunk headers should be updated. I'll have a
look at it this weekend.
> Right now git-gui's apply doesn't correctly update the other hunk
> headers when you apply a hunk. I've seen git-apply fail on some hunks
> just for this reason. Refreshing the diff (so git recomputes the
> headers) works around the issue. So I'm a little worried about using
> --unidiff-zero here.
Okay, but just using more context means that you also have to _update_ the
context of another hunk. Imagine this:
--- a/x
+++ a/x
one line
-a removed one
+an added one
another line
Now you split between the "-" and "+" line. If you stage the first hunk,
not only do you have to update the hunk header of the second hunk (now the
only one shown), which you already hinted should be done; you _also_ have
to update the context in the second hunk, since it changed.
This is just tricky enough that I am tempted to have a go at it. Not
today, though, since I have other work to do, and the issues are easier to
work around for the moment than to work around the lack of "Split Hunk"
for me.
BTW did you think about any kind of integrity checking, i.e. see if the
files involved still have the same hashes as when the diff was generated?
It _is_ possible to use git-gui _and_ the command line...
Ciao,
Dscho
next prev parent reply other threads:[~2007-07-26 14:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-26 5:32 [PATCH] Teach git-gui to split hunks Johannes Schindelin
2007-07-26 5:48 ` David Kastrup
2007-07-26 7:07 ` Shawn O. Pearce
2007-07-26 14:34 ` Johannes Schindelin [this message]
2007-07-26 7:32 ` Johannes Sixt
2007-07-26 14:26 ` Johannes Schindelin
-- strict thread matches above, loose matches on Subject: below --
2007-12-11 13:48 [ANNOUNCE] ugit: a pyqt-based git gui // was: Re: If you would write git from scratch now, what would you change? David
2007-12-11 19:14 ` Jason Sewall
2007-12-11 19:33 ` Marco Costalba
2007-12-11 20:54 ` David
2007-12-11 21:29 ` Jason Sewall
2007-12-12 4:10 ` Shawn O. Pearce
2007-12-12 5:13 ` Jason Sewall
2007-12-12 5:23 ` Shawn O. Pearce
2007-12-12 15:02 ` Jason Sewall
2007-12-12 18:15 ` Johannes Schindelin
2007-12-12 18:50 ` Jason Sewall
2007-12-12 19:37 ` [PATCH] Teach git-gui to split hunks Johannes Schindelin
2007-12-12 20:18 ` Junio C Hamano
2007-12-12 20:39 ` Johannes Schindelin
2007-12-12 20:50 ` Jean-François Veillette
2007-12-12 22:54 ` Junio C Hamano
2007-12-12 23:02 ` Wincent Colaiuta
2007-12-13 7:35 ` Johannes Sixt
2007-12-13 7:48 ` Shawn O. Pearce
2007-12-13 12:25 ` Johannes Schindelin
2007-12-13 8:45 ` Junio C Hamano
2007-12-13 9:41 ` Johannes Sixt
2007-12-13 12:49 ` Johannes Schindelin
2007-12-13 14:03 ` Johannes Sixt
2007-12-13 14:18 ` Johannes Schindelin
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=Pine.LNX.4.64.0707261527040.14781@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=J.Sixt@eudaptics.com \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/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 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 NNTP newsgroup(s).