From: Junio C Hamano <gitster@pobox.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: Stefan Beller <sbeller@google.com>, Jeff King <peff@peff.net>,
git@vger.kernel.org
Subject: Re: [PATCH 05/13] delete_refs(): improve error message
Date: Tue, 09 Jun 2015 11:47:56 -0700 [thread overview]
Message-ID: <xmqq38207m77.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: 9f6f3432467c2b12329c16a46c52670f772993e5.1433763494.git.mhagger@alum.mit.edu
Michael Haggerty <mhagger@alum.mit.edu> writes:
> Change the error message from
>
> Could not remove branch %s
>
> to
>
> Could not remove reference %s
>
> This change makes sense even for the existing caller, which uses the
> function to delete remote-tracking branches.
I am 80% convinced ;-)
The existing caller never used this for removing tags, so 'could not
remove branch' was equally correct for it and was more specific than
'could not remove reference'. If you change it to 'could not remove
that thing %s', it would still be correct for the existing caller;
it would be even less specific for them, though ;-)
The new callers you will add in later patch of course cannot live
with 'could not remove branch', so I think that this is an
acceptable compromise we can live with. If somebody later wants to
make the message more specific, they can add code that switches on
the prefix of the ref when coming up with the error message (and use
that code consistently in other error messages e.g. 'could not add
reference').
>
> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
> ---
> refs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/refs.c b/refs.c
> index c413282..2a2a06d 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -2827,7 +2827,7 @@ int delete_refs(struct string_list *refnames)
> const char *refname = refnames->items[i].string;
>
> if (delete_ref(refname, NULL, 0))
> - result |= error(_("Could not remove branch %s"), refname);
> + result |= error(_("Could not remove reference %s"), refname);
> }
>
> return result;
next prev parent reply other threads:[~2015-06-09 18:48 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-08 11:45 [PATCH 00/13] Improve "refs" module encapsulation Michael Haggerty
2015-06-08 11:45 ` [PATCH 01/13] delete_ref(): move declaration to refs.h Michael Haggerty
2015-06-08 16:43 ` Stefan Beller
2015-06-09 10:10 ` Michael Haggerty
2015-06-09 16:42 ` Stefan Beller
2015-06-13 14:30 ` Michael Haggerty
2015-06-08 11:45 ` [PATCH 02/13] remove_branches(): remove temporary Michael Haggerty
2015-06-08 16:45 ` Stefan Beller
2015-06-08 11:45 ` [PATCH 03/13] delete_ref(): handle special case more explicitly Michael Haggerty
2015-06-08 16:48 ` Stefan Beller
2015-06-09 10:17 ` Michael Haggerty
2015-06-08 11:45 ` [PATCH 04/13] delete_refs(): new function for the refs API Michael Haggerty
2015-06-08 11:45 ` [PATCH 05/13] delete_refs(): improve error message Michael Haggerty
2015-06-09 18:47 ` Junio C Hamano [this message]
2015-06-08 11:45 ` [PATCH 06/13] delete_refs(): convert error message to lower case Michael Haggerty
2015-06-08 16:51 ` Stefan Beller
2015-06-09 10:23 ` Michael Haggerty
2015-06-08 11:45 ` [PATCH 07/13] prune_remote(): use delete_refs() Michael Haggerty
2015-06-08 16:57 ` Stefan Beller
2015-06-08 17:12 ` Jeff King
2015-06-09 10:50 ` Michael Haggerty
2015-06-09 11:53 ` Jeff King
2015-06-08 11:45 ` [PATCH 08/13] repack_without_refs(): make function private Michael Haggerty
2015-06-08 11:45 ` [PATCH 09/13] initial_ref_transaction_commit(): function for initial ref creation Michael Haggerty
2015-06-08 11:45 ` [PATCH 10/13] refs: remove some functions from the module's public interface Michael Haggerty
2015-06-08 11:45 ` [PATCH 11/13] initial_ref_transaction_commit(): check for duplicate refs Michael Haggerty
2015-06-08 11:45 ` [PATCH 12/13] initial_ref_transaction_commit(): check for ref D/F conflicts Michael Haggerty
2015-06-08 11:45 ` [PATCH 13/13] refs: move the remaining ref module declarations to refs.h Michael Haggerty
2015-06-08 17:03 ` [PATCH 00/13] Improve "refs" module encapsulation Stefan Beller
2015-06-09 18:47 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq38207m77.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mhagger@alum.mit.edu \
--cc=peff@peff.net \
--cc=sbeller@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.