Re: [PATCH] format-patch: remove existing output-directory
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:45
John Keeping [off-list ref] writes:
On Fri, Jun 14, 2013 at 06:13:33PM +0530, Ramkumar Ramachandra wrote:quoted
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.