From: Junio C Hamano Date: Tue, 26 May 2009 06:12:15 GMT Subject: Re: [PATCH v3] diff: generate prettier filenames when using GIT_EXTERNAL_DIFF Message-ID: <7vr5ycqtog.fsf@alter.siamese.dyndns.org> In-Reply-To: <1243316165-99065-1-git-send-email-davvid@gmail.com> David Aguilar writes: > Naturally, prep_temp_blob() did not care about filenames. > As a result, scripts that use GIT_EXTERNAL_DIFF ended up > with filenames such as ".diff_XXXXXX". > > This specializes the GIT_EXTERNAL_DIFF code to generate > prettier filenames. > > Diffing "name.ext" now generates "name.XXXX.ext". > Diffing files with no extension now generates "name_XXXX". > > Signed-off-by: David Aguilar > --- > > I renamed a few variables and unrolled the inner loop in > git_mkstemps() since the last patch to make things easier to read/review. Thanks. I actually think using mkstemps() where the function is natively available, and using compat/mkstemps.c implementation where it is not, is a saner approach. It would make the implementation of git_mkstemps() easier to read, because the interface to mkstemps(), even though it may not be in POSIX (nor in glibc), is a well known quantity and people do not need to follow into its implementation when they want to follow the logic of higher level code.