From: Junio C Hamano Date: Fri, 14 Jun 2013 13:55:26 GMT Subject: Re: [PATCH] format-patch: remove existing output-directory Message-ID: <7vip1gssoh.fsf@alter.siamese.dyndns.org> In-Reply-To: <20130614130910.GF23890@serenity.lan> John Keeping writes: > On Fri, Jun 14, 2013 at 06:13:33PM +0530, Ramkumar Ramachandra wrote: >> The following command >> >> $ git format-patch -o outgoing master >> >> does not ensure that the output-directory outgoing doesn't already >> exist. As a result, it's possible for patches from two different series >> to get mixed up if the user is not careful. Fix the problem by >> unconditionally removing the output-directory before writing to it. > > I don't think this is the correct behaviour. I can think of cases where > I would want to output multiple things into the same directory. > > It may be better to issue a warning when this happens, or die and > provide a flag to let the user bypass that. Absolutely. I think this too dangeous, and will kill the possibility to further improve "format-patch -v$n". An option (and configuration that expresses the user's wish) to error out when -o diretory exists is probably as far as we would want to go. Removal is way too much to accept without risk of hurting users.