Re: [PATCH v2] Support "core.excludesfile = ~/.gitignore"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 27, 2008, 05:01 UTC
- Message-ID
- <7vy72jrr00.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <quack.20080826T2012.lthvdxn2ls4@roar.cs.berkeley.edu>
Karl Chen <quarl@cs.berkeley.edu> writes:
Show 9 quoted lines
>>>>>> On 2008-08-26 17:25 PDT, Jeff King writes: > > Jeff> 1. It should probably re-use path.c:user_path, as > Jeff> Johannes mentioned. > > That function has the wrong interface for this task (requires > extra strdup, imposes PATH_MAX, conflates all error conditions > into returning NULL, also returns NULL if input doesn't have "~"). > Do you still think it should re-use that function?
On the other hand you have a pair of ugly "casting a const pointer down, temporarily modifying what is const" in your version.
In any case, I think their point is that these two functions are meant to do the same thing, and a unified interface would be desirable.
You do not necessarily have to use user_path() from path.c, but user_path(), if its interface is coarser, could become a thin wrapper around yours, don't you think? Even better, perhaps the current callers of user_path() may benefit from finer distinction among error conditions (I didn't look, though).