From: Junio C Hamano Date: Wed, 01 Aug 2007 16:58:07 GMT Subject: Re: [NOT-SERIOUS PATCH] Make get_relative_cwd() not accept NULL for a directory Message-ID: <7vmyxb5h0g.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Johannes Schindelin writes: > Okay, I made up my mind. Allowing "dir == NULL" is not > only a matter of convenience. It is the most natural > way to say that "dir" is an invalid or non-existing > directory. That is also fine; it only needs to be clarified somehow to people who might wonder what get_relative_cwd() function is used for and how to use it in their programs. The comment that says "As a convenience" may need to become a bit more elaborate to say why it is convenient for the callers to do so (e.g. "The caller may have called another function that returns a directory to obtain the 'dir', which may have returned NULL as a way to say 'there is nothing applicable in your case', and in such a case, your $(cwd) relative to that 'dir' is also something that cannot be used, hence a NULL is returned").