From: Johannes Schindelin Date: Thu, 26 Jul 2007 14:26:57 GMT Subject: Re: [PATCH] Teach git-gui to split hunks Message-ID: In-Reply-To: <46A84E06.2ED4CFBC@eudaptics.com> Hi, On Thu, 26 Jul 2007, Johannes Sixt wrote: > Johannes Schindelin wrote: > > > > When you select the context menu item "Split Hunk" in the diff area, > > git-gui will now split the current hunk so that a new hunk starts at > > the current position. > > > > For this to work, apply has to be called with --unidiff-zero, since > > the new hunks can start or stop with a "-" or "+" line. > > For chrissake, NO! > > I tried this already, and it immediately corrupted my data. > > The problem case is when the hunk you want to apply is not the first one > and the first one does not add and remove the same number of lines. In > this case, all that git-apply can do is to rely on line numbers. But > they are WRONG and apply the patch at the WRONG spot. > > First, I didn't believe Linus when he preached that --unidiff-zero is > bad; it took only a day to become a follower. ;) Okay, convinced. But I have some issues there, which I will outline in the reply to Shawn. Ciao, Dscho