Re: [PATCH] git-format-patch: add --output-directory long option again

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

 



Hi,

what idiot wrote that part of the code originally? ;-)

On Tue, 6 Jun 2006, Dennis Stosberg wrote:

> @@ -243,6 +241,12 @@ int cmd_format_patch(int argc, const cha
>  	if (argc > 1)
>  		die ("unrecognized argument: %s", argv[1]);
>  
> +	if (output_directory && !stdout) {
> +		if (mkdir(output_directory, 0777) < 0 && errno != EEXIST)
> +			die("Could not create directory %s",
> +			    output_directory);
> +	}
> +
>  	if (rev.pending_objects && rev.pending_objects->next == NULL) {
>  		rev.pending_objects->item->flags |= UNINTERESTING;
>  		add_head(&rev);

Would it not be better to

	if (output_directory && stdout)
		die("What do you want: stdout or a directory?");

Ciao,
Dscho

-
: 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]