On Tue, Nov 30, 2010 at 23:20, Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx> wrote: > On Tue, Nov 30, 2010 at 22:19, Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx> wrote: >> On Mon, Sep 15, 2008 at 09:08, Johannes Sixt <j.sixt@xxxxxxxxxxxxx> wrote: >>> Ânew file mode 100644 >>> Â--- /dev/null >>> Â+++ b/foo >>> Â@@ -0,0 +1 @@ >>> Â+foo >> >> I just noticed the same, and ask me why this report wasn't honored. >> >> Also git may spill out 2 diffs for type changes (file to symlink, for >> example). In this case the we should probably disable any hunk- or >> line-level (un)staging. > > Here is a proposal which fixes this case. Not tested on the OPs report. > > --8<-- > diff --git a/lib/diff.tcl b/lib/diff.tcl > index 8fea947..b3901c3 100644 > --- a/lib/diff.tcl > +++ b/lib/diff.tcl > @@ -398,7 +398,6 @@ proc read_diff {fd conflict_size cont_info} { >        Âif {$line eq {deleted file mode 120000}} { >            Âset line "deleted symlink" >        Â} > -        set ::current_diff_inheader 0 > >        Â# -- Automatically detect if this is a 3 way diff. >        Â# > @@ -414,6 +413,7 @@ proc read_diff {fd conflict_size cont_info} { >            Â|| [regexp {^\* Unmerged path } $line]} { >            Âset tags {} >        Â} elseif {$is_3way_diff} { > +            set ::current_diff_inheader 0 >            Âset op [string range $line 0 1] >            Âswitch -- $op { >            Â{ Â} {set tags {}} > @@ -440,6 +440,7 @@ proc read_diff {fd conflict_size cont_info} { >            Â} >            Â} >        Â} elseif {$is_submodule_diff} { > +            set ::current_diff_inheader 0 >            Âif {$line == ""} continue >            Âif {[regexp {^Submodule } $line]} { >                Âset tags d_@ > @@ -459,6 +460,7 @@ proc read_diff {fd conflict_size cont_info} { >                Â} >            Â} >        Â} else { > +            set ::current_diff_inheader 0 >            Âset op [string index $line 0] >            Âswitch -- $op { >            Â{ } {set tags {}} > Please ignore this proposal. I have a better solution in the pipe (which solves both problems reported here). Bert ÿô.nÇ·®+%˱é¥wÿº{.nÇ· ßØnr¡öë¨è&£ûz¹Þúzf£¢·h§~Ûÿÿïÿê_èæ+v¨þ)ßø