From: Junio C Hamano <gitster@pobox.com>
To: Matthieu Moy <Matthieu.Moy@imag.fr>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2 v2] verify_filename: ask the caller to chose the kind of diagnosis
Date: Mon, 18 Jun 2012 15:25:04 -0700 [thread overview]
Message-ID: <7vipeo2r7j.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1340043501-6170-2-git-send-email-Matthieu.Moy@imag.fr> (Matthieu Moy's message of "Mon, 18 Jun 2012 20:18:21 +0200")
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
> verify_filename can be called in two different contexts. Either we just
> tried to interpret a string as an object name, and it fails, so we try
> looking for a working tree file as a fallback, or we _know_ that we are
> looking for a filename, and shouldn't even try interpreting the string as
> an object name.
>
> For example, with this change, we get:
>
> $ git log COPYING HEAD:inexistant
> fatal: HEAD:inexistant: no such path in the working tree.
> Use '-- <path>...' to specify paths that do not exist locally.
> $ git log HEAD:inexistant
> fatal: Path 'inexistant' does not exist in 'HEAD'
>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> ---
Thanks; both patches look sensible (modulo minor nits below).
Will queue with a local fix-up.
> @@ -80,14 +86,28 @@ static void NORETURN die_verify_filename(const char *prefix, const char *arg)
> * as true, because even if such a filename were to exist, we want
> * it to be preceded by the "--" marker (or we want the user to
> * use a format like "./-filename")
> + *
> + * The "diagnose_misspelt_rev" is used to provide a user-friendly
> + * diagnosis. If 0, the diagnosis will try to diagnose "name" as an
> + * invalid object name (e.g. HEAD:foo). If non-zero, the diagnosis
> + * will only complain about an inexisting file.
I have a feeling that "if 0/if non-zero" above are backwards.
next prev parent reply other threads:[~2012-06-18 22:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-15 4:03 "Detailed diagnosis" perhaps broken Junio C Hamano
2012-06-17 18:34 ` Matthieu Moy
2012-06-17 18:39 ` [PATCH 1/2] sha1_name: don't trigger detailed diagnosis for file arguments Matthieu Moy
2012-06-17 18:39 ` [PATCH 2/2 RFC] verify_filename: ask the caller to chose the kind of diagnosis Matthieu Moy
2012-06-17 20:22 ` Junio C Hamano
2012-06-18 6:42 ` Matthieu Moy
2012-06-18 16:27 ` Junio C Hamano
2012-06-18 18:18 ` [PATCH 1/2 v2] sha1_name: don't trigger detailed diagnosis for file arguments Matthieu Moy
2012-06-18 18:18 ` [PATCH 2/2 v2] verify_filename: ask the caller to chose the kind of diagnosis Matthieu Moy
2012-06-18 22:25 ` Junio C Hamano [this message]
2012-06-19 11:17 ` Matthieu Moy
2012-06-18 17:23 ` [PATCH 1/2] sha1_name: don't trigger detailed diagnosis for file arguments Junio C Hamano
2012-06-18 17:42 ` Matthieu Moy
2012-06-18 17:50 ` Junio C Hamano
2012-06-18 17:56 ` Matthieu Moy
2012-06-18 18:01 ` 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=7vipeo2r7j.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Matthieu.Moy@imag.fr \
--cc=git@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).