Re: [PATCH] Teach git-gui to split hunks

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

 



Hi,

On Wed, 12 Dec 2007, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:
> 
> > 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. ...
> 
> I still have conceptual problem with this whole thing.  For example, 
> what does that MEAN to split this hunk from your patch...
> 
> > @@ -296,7 +369,7 @@ proc apply_hunk {x y} {
> >  	if {$current_diff_path eq {} || $current_diff_header eq {}} return
> >  	if {![lock_index apply_hunk]} return
> >  
> > -	set apply_cmd {apply --cached --whitespace=nowarn}
> > +	set apply_cmd {apply --cached --whitespace=nowarn --unidiff-zero}
> >  	set mi [lindex $file_states($current_diff_path) 0]
> >  	if {$current_diff_side eq $ui_index} {
> >  		set failed_msg [mc "Failed to unstage selected hunk."]
> 
> ... by clicking between the '-' and '+' lines, and apply only one half?
> 
> Well, the question was not very well stated.  I know what it means -- 
> remove that old line, without replacing with the corrected/updated one. 
> The real question is how would that be useful?

The thing is: sometimes there is a patch which contains just one garbage 
line.  (I am talking about my current working tree, so you are not allowed 
to be offended by my language in this case.)

The thing I would like to do is right click on that line, start a new 
hunk, then right click on the next line to start yet another hunk, and 
apply this and the first hunk.

It is a lazy way to edit a patch.

Ciao,
Dscho

-
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