From: David Turner <dturner@twopensource.com>
To: git mailing list <git@vger.kernel.org>
Subject: mktree: multiple same-named objects
Date: Wed, 27 Aug 2014 00:41:57 -0400 [thread overview]
Message-ID: <1409114517.13351.6.camel@leckie> (raw)
git mktree seems to allow the creation of a tree object with multiple
objects of the same name but different SHAs. This leads to weird
behavior later, unsurprisingly. For instance, if there are two tree
objects with the same name but different SHAs, the checked out tree will
be the union of them (reasonably), but if you do git add $name, some or
all unmodified files under $name will show up in git status as modified
-- since they differ from one of the parent trees, presumably.
And if different git implementations treat this case differently, then
it might be possible to make a repo that appears to contain one thing
when viewed with one implementation, but contains a different thing for
a different implementation.
Summary: git mktree ought to forbid this, and possibly there ought to be
other checks (for instance, when unpacking) to prevent this.
next reply other threads:[~2014-08-27 4:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 4:41 David Turner [this message]
2014-08-27 5:01 ` mktree: multiple same-named objects Duy Nguyen
2014-08-27 21:48 ` David Turner
2014-08-27 5:13 ` Jeff King
2014-08-27 15:17 ` Junio C Hamano
2014-08-27 16:24 ` 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=1409114517.13351.6.camel@leckie \
--to=dturner@twopensource.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 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).