Re: [IGNORETHIS/PATCH] Choosing the sha1 prefix of your commits
- From
Jeff King <peff@peff.net>
- Date
- Oct 20, 2011, 15:44 UTC
- Message-ID
- <20111020154406.GA16114@sigill.intra.peff.net>
- In-Reply-To
- <CACsJy8B7CJ3VO-UKCym2kgfOOPadL25gt2sxApk95nKoWVk2yQ@mail.gmail.com>
On Thu, Oct 20, 2011 at 08:14:56PM +1100, Nguyen Thai Ngoc Duy wrote:
Show 10 quoted lines
> > But you cannot hide from "cat-file commit" ;-) > > > > With the recent push to more (perceived) security, it may probably make > > sense to teach "log" family commands to quote-show ^@ and what is behind > > in their output by default, perhaps with an option to turn it off. > > What about NUL in file name in tree objects? Suppose the original tree > has an entry named "goodthing". With luck, they might be able to > create a new tree object with the entry renamed to "evil\x001234" that > has the same SHA-1. Could that possibly cause any problems?
NUL is already meaningful in a tree object; it is the end of the filename. So after the NUL, we will consider the next 20 bytes to be sha1, and then after that, the mode of the next file entry.
-Peff