Re: [PATCH] diff: Support diff.color-words config option
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 20, 2009, 21:02 UTC
- Message-ID
- <alpine.DEB.1.00.0901202202060.3586@pacific.mpi-cbg.de>
- In-Reply-To
- <7vk58pk9k5.fsf@gitster.siamese.dyndns.org>
Hi,
On Tue, 20 Jan 2009, Junio C Hamano wrote:
Show 22 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > >> By the way, wouldn't it make sense to optimize the precontext of that > >> hunk by doing _something_ like: > >> > >> if (!o->word_regex && strcmp(one->path, two->path)) > >> o->word_regex = userdiff_word_regex(two); > >> > >> "Something like" comes from special cases like /dev/null for new/deleted > >> files, etc. > > > > You mean to avoid the cost of initializing the regex in case one and the > > same file is diffed against itself? > > No. > > What I meant is much simpler than that. > > If one and two are the same filename, and earlier gitattributes lookup for > the path already failed to produce any when you checked one, isn't it very > likely that the gitattributes lookup for two would fail the same way to > produce any result?
Oh, I see!
Thanks, Dscho