Re: git-diff: --ignore-matching-lines has no effect on the output when --name-only is used

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

 



hi@arnes.space writes:
> 
>> it does not make sense for the answer to be different depending on the
>> presense of -w or --ignore-matching options.
> 
> does it really not? i thought of `--name-only` as changing the
> formatting of the output, as doing something similar to this:
> 
> git diff --no-ext-diff ... | grep -P "^(---|\+\+\+)" | cut -d/ -f2- | uniq

Git computes a SHA value for each file, so when using --name-only to
check which files have changed, it only needs to compare the SHA values.
There's no need to generate and then filter the full diff content.

Of course, the implementation of git diff is more complex, but I hope you
can roughly understand that --name-only usually doesn't need the actual
diff content.

Thanks,
Lidong





[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