Re: [PATCH v2 10/10] tag: don't misreport type of tagged objects in errors

2 messages, 2 authors, 2021-03-31 · open the first message on its own page

Re: [PATCH v2 10/10] tag: don't misreport type of tagged objects in errors

From: Junio C Hamano <hidden>
Date: 2021-03-31 18:42:16

Jeff King [off-list ref] writes:
quoted hunk
+			if (flags & OBJECT_AS_TYPE_EXPECT_PARSED)
+				error(_("object %s is a %s, but was referred to as a %s"),
+				      oid_to_hex(&obj->oid), type_name(obj->type),
+				      type_name(type));
+			else
+				error(_("object %s referred to as both a %s and a %s"),
+				      oid_to_hex(&obj->oid),
+				      type_name(obj->type), type_name(type));
+		}
Am I correct to understand that the latter is after we read a tree
that refers to an object with 100644 (blob) and then another tree
that refers to the same object with 40000 (tree), before we have a
need/chance to actually find out what that object is?  The error
would trigger while reading the second tree and find the second
mention of the object that conflicts with the earlier one?

Re: [PATCH v2 10/10] tag: don't misreport type of tagged objects in errors

From: Jeff King <hidden>
Date: 2021-03-31 19:01:01

On Wed, Mar 31, 2021 at 11:41:18AM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
+			if (flags & OBJECT_AS_TYPE_EXPECT_PARSED)
+				error(_("object %s is a %s, but was referred to as a %s"),
+				      oid_to_hex(&obj->oid), type_name(obj->type),
+				      type_name(type));
+			else
+				error(_("object %s referred to as both a %s and a %s"),
+				      oid_to_hex(&obj->oid),
+				      type_name(obj->type), type_name(type));
+		}
Am I correct to understand that the latter is after we read a tree
that refers to an object with 100644 (blob) and then another tree
that refers to the same object with 40000 (tree), before we have a
need/chance to actually find out what that object is?  The error
would trigger while reading the second tree and find the second
mention of the object that conflicts with the earlier one?
Yes, exactly (or two tags, or a tag and a tree, or a commit and a tree,
etc).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help