Re: [PATCH] diff: Support diff.color-words config option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 20, 2009, 20:27 UTC
- Message-ID
- <7vk58pk9k5.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.DEB.1.00.0901201819490.5159@intel-tinevez-2-302>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 11 quoted lines
>> 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?