Re: [PATCH 12/19] tree-diff: remove special-case diff-emitting code for empty-tree cases

2014-03-25 Thread Kirill Smelkov
On Mon, Mar 24, 2014 at 02:18:10PM -0700, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: via teaching tree_entry_pathcmp() how to compare empty tree descriptors: Drop this line, as you explain the pretend empty compares bigger than anything else idea later anyway? This

Re: [PATCH 12/19] tree-diff: remove special-case diff-emitting code for empty-tree cases

2014-03-25 Thread Junio C Hamano
Kirill Smelkov k...@navytux.spb.ru writes: static int tree_entry_pathcmp(struct tree_desc *t1, struct tree_desc *t2) { struct name_entry *e1, *e2; int cmp; + if (!t1-size) + return t2-size ? +1 /* +∞ c */ : 0 /* +∞ = +∞ */; + else if (!t2-size) +

Re: [PATCH 12/19] tree-diff: remove special-case diff-emitting code for empty-tree cases

2014-03-25 Thread Junio C Hamano
Kirill Smelkov k...@navytux.spb.ru writes: On Mon, Mar 24, 2014 at 02:18:10PM -0700, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: via teaching tree_entry_pathcmp() how to compare empty tree descriptors: Drop this line, as you explain the pretend empty compares bigger

Re: [PATCH 12/19] tree-diff: remove special-case diff-emitting code for empty-tree cases

2014-03-24 Thread Junio C Hamano
Kirill Smelkov k...@mns.spb.ru writes: via teaching tree_entry_pathcmp() how to compare empty tree descriptors: Drop this line, as you explain the pretend empty compares bigger than anything else idea later anyway? This early part of the proposed log message made me hiccup while reading it.

[PATCH 12/19] tree-diff: remove special-case diff-emitting code for empty-tree cases

2014-02-24 Thread Kirill Smelkov
via teaching tree_entry_pathcmp() how to compare empty tree descriptors: While walking trees, we iterate their entries from lowest to highest in sort order, so empty tree means all entries were already went over. If we artificially assign +infinity value to such tree entry, it will go after all