git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michal Čihař" <michal@cihar.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: git cat-file -e behavior
Date: Mon, 29 Feb 2016 13:16:34 +0100	[thread overview]
Message-ID: <56D436A2.4090202@cihar.com> (raw)
In-Reply-To: <20160229114455.GD29769@sigill.intra.peff.net>

[-- Attachment #1: Type: text/plain, Size: 892 bytes --]

Hi

Dne 29.2.2016 v 12:44 Jeff King napsal(a):
> It looks like it has been this way forever. The first thing we do with
> the object is resolve its name to a sha1, and that's where the error you
> see comes from. And then we actually check whether we have the object.
> 
> I think the intended use was to feed it a sha1 to see if it exists. Then
> the name-resolution step is a noop.

I found this as best way to check whether file exists in branch.
Checking git ls-tree output seems less error prone than checking return
value of git cat-file -e...

> I'm not sure if the behavior you are seeing is all that bad (the
> documentation could be read as suppressing the normal stdout output, but
> error messages remain), 

I understand this, that's why I'm asking whether it's expected output or
not :-).

-- 
	Michal Čihař | http://cihar.com | http://blog.cihar.com


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-02-29 12:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29  9:58 git cat-file -e behavior Michal Čihař
2016-02-29 11:44 ` Jeff King
2016-02-29 12:16   ` Michal Čihař [this message]
2016-02-29 12:36     ` Jeff King
2016-02-29 12:40   ` Jeff King

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=56D436A2.4090202@cihar.com \
    --to=michal@cihar.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).