From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git@vger.kernel.org,
Ilari Liusvaara <ilari.liusvaara@elisanet.fi>,
Jakub Narebski <jnareb@gmail.com>,
"Dmitry S. Kravtsov" <idkravitz@gmail.com>,
Shawn Pearce <spearce@spearce.org>
Subject: Re: [PATCH] cache-tree: do not cache empty trees
Date: Sat, 5 Feb 2011 17:32:05 +0700 [thread overview]
Message-ID: <AANLkTingZB_+3W-PBATCVywjR31ft_AH+e0Z+4rsUR45@mail.gmail.com> (raw)
In-Reply-To: <20110205101412.GB1685@elie>
2011/2/5 Jonathan Nieder <jrnieder@gmail.com>:
> Nguyễn Thái Ngọc Duy wrote:
>> +
>> +T1=f4ec99e8174c01eab488469b4c2680500bbb18da
>> +T2=4b825dc642cb6eb9a060e54bf8d69288fbee4904
>
> What are these trees? Do they need to be hardcoded?
I have uneasy feeling constructing a tree manually. Hardcoding it (or
less automatic check) makes me feel better. I'm cooking a patch to
make hash-object reject malformed trees/commits/tags. Then I'll remove
these SHA-1.
>> +
>> +test_expect_success 'setup' '
>> + printf "40000 empty\0\x4b\x82\x5d\xc6\x42\xcb\x6e\xb9\xa0\x60\xe5\x4b\xf8\xd6\x92\x88\xfb\xee\x49\x04" >newtree &&
>
> printf '\xab' is unfortunately unportable. I suppose
> this should rather say something like
>
> test_unequal () {
> printf '%s\n' "$1" >bad &&
> printf '%s\n' "$2" >actual &&
> ! test_cmp bad actual
> }
>
> empty_tree=$(git mktree </dev/null) &&
> tree_with_empty_subtree=$(
> echo "040000 tree $empty_tree empty" |
> git mktree
> ) &&
> test_unequal "$empty_tree" "$tree_with_empty_subtree"
Hah! Was wondering how the heck they could create trees manually. So
it's mktree. Thanks!
> ...
>
> Sane?
Don't know. But it's definitely saner than my version.
--
Duy
next prev parent reply other threads:[~2011-02-05 10:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-05 8:30 [PATCH] cache-tree: do not cache empty trees Nguyễn Thái Ngọc Duy
2011-02-05 9:50 ` Nguyễn Thái Ngọc Duy
2011-02-05 10:14 ` Jonathan Nieder
2011-02-05 10:32 ` Nguyen Thai Ngoc Duy [this message]
2011-02-05 14:07 ` Nguyễn Thái Ngọc Duy
2011-02-07 2:09 ` Junio C Hamano
2011-02-07 2:36 ` Nguyen Thai Ngoc Duy
2011-02-07 8:17 ` [PATCH] correct type of EMPTY_TREE_SHA1_BIN Jonathan Nieder
2011-02-09 23:33 ` Junio C Hamano
2011-02-07 9:17 ` [PATCH] cache-tree: do not cache empty trees Jonathan Nieder
2011-02-07 9:57 ` Nguyen Thai Ngoc Duy
2011-02-07 12:18 ` Ilari Liusvaara
2011-02-07 12:29 ` Nguyen Thai Ngoc Duy
2011-02-07 12:32 ` Jonathan Nieder
2011-02-07 20:48 ` Junio C Hamano
2011-02-08 4:11 ` Nguyen Thai Ngoc Duy
2011-02-08 4:30 ` Jonathan Nieder
2011-02-15 10:19 ` Yann Dirson
2011-02-16 14:29 ` Jakub Narebski
2011-02-08 10:40 ` Ilari Liusvaara
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTingZB_+3W-PBATCVywjR31ft_AH+e0Z+4rsUR45@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=idkravitz@gmail.com \
--cc=ilari.liusvaara@elisanet.fi \
--cc=jnareb@gmail.com \
--cc=jrnieder@gmail.com \
--cc=spearce@spearce.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).