All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ντέντος Σταύρος" <stdedos@gmail.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: No clear API/Error message to validate a "revision object" using git rev-parse
Date: Tue, 29 Jan 2019 14:01:09 +0200	[thread overview]
Message-ID: <CAHMHMxU7fzHDqWnqx=d016FFPTpyR_Q9f8=oDt+BPBT2WS5bcA@mail.gmail.com> (raw)
In-Reply-To: <CAP8UFD0eQ0hPkd-wsNR8e0hQSJC+dUQatvV1xgdJOUxtXYqC_g@mail.gmail.com>

On Tue, Jan 29, 2019 at 12:51 PM Christian Couder
<christian.couder@gmail.com> wrote:
> > `--verify`s error message is even more cryptic:
> > $ git rev-parse --verify version.3
> > fatal: Needed a single revision
>
> Yeah, but it works.
>
> The error message could perhaps be improved. On the other hand it has
> been the same for a very very long time and very few people complained
> about it.
>
> [...]
>
> In fact as `git rev-parse` is a "plumbing command" it's supposed to be
> used mostly by scripts and power user who can easily deal with such an
> error message, which explains why there has not been much incentive to
> change this error message.

I understand the points here, and I understand how minor this "issue"
is in a sense.
Maintainers / fixer can decide on it, but I thought I should bring it
to lists' attention.

> As you are writing a script, you can at least easily redirect it to
> /dev/null and output something else.

I like the "expected" output in that way, since:
```
'version.0-false' is not matching. I am asking git ...
80d790c17c9a3f10c156561efc323ac5d4684b16
'version.0' is not matching. I am asking git ... fatal: bad revision 'version.0'
```
it "complements" the previous output, and sounds "fluent enough".
And also that I don't have to patchwork it (I can, obviously).

The reason I mentioned:

> $ git rev-parse --verify version.3
> fatal: Needed a single revision

is that the message sounds counter-intuitive. I already gave (what I
thought was) a revision, and it is "already" one.
I "could" claim that `git rev-parse` is reading 2 arguments
(`--verify` and `version.3`),
and somehow `git rev-parse --verify` checks that `argc == 1`, and
failing due to a bug in the code.

I would understand that message in this context:
> $ git rev-parse --verify version.3 version.4
> fatal: Needed a single revision
since I gave 2 arguments instead of 1.

With regards,
Ντέντος Σταύρος

      reply	other threads:[~2019-01-29 12:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29  9:25 No clear API/Error message to validate a "revision object" using git rev-parse Ντέντος Σταύρος
2019-01-29 10:51 ` Christian Couder
2019-01-29 12:01   ` Ντέντος Σταύρος [this message]

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='CAHMHMxU7fzHDqWnqx=d016FFPTpyR_Q9f8=oDt+BPBT2WS5bcA@mail.gmail.com' \
    --to=stdedos@gmail.com \
    --cc=christian.couder@gmail.com \
    --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 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.