Re: report on a possible bug: git commit -p myfile.py unexpected output

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

 



On Fri, Mar 24, 2017 at 03:59:07PM +0100, Michael J Gruber wrote:

> > [master 96d1c24] myfile.py -> old unused methods removed...
> >  1 file changed, 182 insertions(+), 302 deletions(-)
> >  rewrite myfile.py (60%)
> [...]
> > myfile.py | 120
> > ---------------------------------------------------------------------------------------------------------------------
> > 1 file changed, 120 deletions(-)
> 
> 182-302 = -120
> 
> Did you make any changes in the lines that you left? Apparantly, that's
> what the rewrite looked like to git commit.

Even without changes to the remaining lines, a rewrite diff would
consider them removed from the preimage and added again in the
post-image.

The difference between the two commands is that "commit" turns on "-B"
break detection by default, and "git show", "tig", etc, do not.

Looking at the actual diff with "git show -B" should show something
like:

  -old
  -lines
  -that
  -weren't
  -touched
  -some
  -lines
  -that
  -were
  -deleted
  +old
  +lines
  +that
  +weren't
  +touched

The change is the same no matter how you view it; the "-B" flag just
asks Git to show a non-minimal diff when the file was substantially
changed.

-Peff



[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]