git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Potential bug in --color-words output
@ 2022-10-28 21:08 Simeon Krastnikov
       [not found] ` <198be0ca-4768-d3ce-caf3-bce4b1bb1e49@gmail.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simeon Krastnikov @ 2022-10-28 21:08 UTC (permalink / raw)
  To: git

Hello,

Given an initial file with the contents "not to be", which I then change 
to "to be", the output of 'git diff --color-words', is

   notto be

with the first three letters colored red. To me this seems incorrect as 
it implies, or at least misleadingly suggests, that there was no space 
between "not" and "to" in the original file. (Even though in that case 
the output is actually "nottoto be" with the "notto" in red and "to" in 
green.)

If instead I start with a file with contents "to be", which I then 
change to "not to be", then the output is as expected:

   not to be

(First three letters colored green.)

Am I correct in seeing this as a bug? If so, any tips on what parts of 
diff.c to look at when starting a patch?

Thanks,

Simeon


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-10 13:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-28 21:08 Potential bug in --color-words output Simeon Krastnikov
     [not found] ` <198be0ca-4768-d3ce-caf3-bce4b1bb1e49@gmail.com>
2022-11-07 23:23   ` Stefan Beller
2022-11-08  7:27 ` Johannes Sixt
2022-11-10 13:51 ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).