Re: [PATCH v3] diff: generate prettier filenames when using GIT_EXTERNAL_DIFF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Aguilar <davvid@xxxxxxxxx> 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 <davvid@xxxxxxxxx>
> ---
>
> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]