All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luke Shumaker <lukeshu@lukeshu.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Luke Shumaker <lukeshu@lukeshu.com>,
	git@vger.kernel.org, Luke Shumaker <lukeshu@datawire.io>
Subject: Re: [RFC PATCH] fast-export, fast-import: Let tags specify an internal name
Date: Wed, 21 Apr 2021 11:26:17 -0600	[thread overview]
Message-ID: <87im4f35xi.wl-lukeshu@lukeshu.com> (raw)
In-Reply-To: <87k0ov38bv.wl-lukeshu@lukeshu.com>

On Wed, 21 Apr 2021 10:34:28 -0600,
Luke Shumaker wrote:
> On Wed, 21 Apr 2021 02:03:57 -0600,
> Ævar Arnfjörð Bjarmason wrote:
> > On Tue, Apr 20 2021, Luke Shumaker wrote:
> > > +	tagname = memmem(buf, message ? message - buf : size, "\ntag ", 5);
> > > +	if (!tagname)
> > > +		die("malformed tag %s", oid_to_hex(&tag->object.oid));
> > > +	tagname += 5;
> > > +	tagname_end = strchrnul(tagname, '\n');
> > 
> > So it's no longer possible to export a reporitory with a missing "tag"
> > entry in a tag? Maybe OK, but we have an escape hatch for it with fsck,
> > we don't need one here?
> > 
> > In any case a test for it would be good to have.
> 
> I hadn't realized that it was possible for a tag object to be missing
> the "tag" entry, I will fix that.

Actually, can you expand on that?  I don't see the escape hatch you
speak of.

`git hash-object` doesn't want to even create such an object ("fatal:
corrupt tag"), and I had to pass `--literally` to even create the
object.

`git update-ref` doesn't want to even acknowledge the object to create
the ref pointing to it ("fatal: cannot update ref 'refs/tags/badtag':
trying to write ref 'refs/tags/badtag' with nonexistent object HASH"),
and I had to `echo HASH > .git/refs/tags/badtag` to create the ref.

And then `git fsck` (even with `--no-tags`) complains about the object
("error: HASH: object could not be parsed: .git/objects/HA/SH").

It is my reading of the code that `parse_tag_buffer` will always fail
to parse such an object, and so `fsck_walk_tag` and `fsck_walk` will
always bubble up an error.

-- 
Happy hacking,
~ Luke Shumaker

  reply	other threads:[~2021-04-21 17:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20 19:05 [RFC PATCH] fast-export, fast-import: Let tags specify an internal name Luke Shumaker
2021-04-20 21:40 ` Junio C Hamano
2021-04-21  8:18   ` Ævar Arnfjörð Bjarmason
2021-04-21 16:17     ` Luke Shumaker
2021-04-21 16:59     ` Junio C Hamano
2021-04-21 18:34     ` Elijah Newren
2021-04-21 18:48       ` Luke Shumaker
2021-04-21 19:24         ` Elijah Newren
2021-04-22  8:41       ` Ævar Arnfjörð Bjarmason
2021-04-21 18:41   ` Elijah Newren
2021-04-21 18:54     ` Junio C Hamano
2021-04-21 19:32       ` Elijah Newren
2021-04-22  8:54         ` Ævar Arnfjörð Bjarmason
2021-04-22 19:37           ` Elijah Newren
2021-04-21  8:03 ` Ævar Arnfjörð Bjarmason
2021-04-21 16:34   ` Luke Shumaker
2021-04-21 17:26     ` Luke Shumaker [this message]
2021-04-21 18:26     ` Elijah Newren
2021-04-21 17:48   ` Junio C Hamano
2021-04-23 16:47 ` Luke Shumaker

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=87im4f35xi.wl-lukeshu@lukeshu.com \
    --to=lukeshu@lukeshu.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=lukeshu@datawire.io \
    /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.