git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] parse_tag: fail, if tagged objected would be NULL
Date: Sat, 16 Feb 2008 11:13:56 -0800	[thread overview]
Message-ID: <7vpruw90jv.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <12031670802582-git-send-email-mkoegler@auto.tuwien.ac.at> (Martin Koegler's message of "Sat, 16 Feb 2008 14:04:40 +0100")

Martin Koegler <mkoegler@auto.tuwien.ac.at> writes:

> The cause of a NULL in tag->tagged can be:
> * a unknown object type is used
> * the tag points to a object with an other type as stated
>   in the tag.
>
> Both situations are most likley be caused by a not welformed
> tag. Catching this error here avoids doing tag->tagged!=NULL
> checks in the rest of git.

Honestly, I am torn on this.

The approach certainly is attractive if you care only about
working in a perfectly well connected repository of a known
vintage.

On the other hand, however, this robs from callers the clue that
the tag itself was Ok but it points at something we do not know
about.  Maybe the caller was only interested in the tag itself
but did not care about the pointee, and erroring out like this
may make it impossible for the caller to act on the tag itself.
Maybe the caller even knew about the breakage of the repository
and wanted to salvage as much as possible, but because this
errors out, it would now consider this tag object itself is bad
and give up, salvaging one less object.  It looks to me that
this, along with other "tighten parse_X_buffer()" changes you
sent earlier, closes door to them.  That's why I think that
parse_X_buffer() should be more lenient than fsck and keep
saying it.

  reply	other threads:[~2008-02-16 19:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-16 13:04 [PATCH] parse_tag: fail, if tagged objected would be NULL Martin Koegler
2008-02-16 19:13 ` Junio C Hamano [this message]
2008-02-17 17:48   ` Martin Koegler

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=7vpruw90jv.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mkoegler@auto.tuwien.ac.at \
    /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).