Re: [PATCH 4/5] mv: improve overwrite warning
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 12, 2011, 19:57 UTC
- Message-ID
- <7vobvd36ms.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20111212075227.GD17532@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> This message looks overly long to me, but I wanted to match the existing > messages. Another option would be just: > > warning: overwriting 'three/one'
Yes, I think it makes perfect sense to drop the ugly "source=one destination=two" cruft, both for single-source and multiple-source cases.
Show 17 quoted lines
> builtin/mv.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/builtin/mv.c b/builtin/mv.c
> index ae6c30c..c9ecb03 100644
> --- a/builtin/mv.c
> +++ b/builtin/mv.c
> @@ -177,7 +177,8 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
> * check both source and destination
> */
> if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {
> - warning(_("%s; will overwrite!"), bad);
> + warning(_("%s (will overwrite), source=%s, destination=%s"),
> + bad, src, dst);
> bad = NULL;
> } else
> bad = _("Cannot overwrite");