Re: [PATCH 02/11] tree-diff: consolidate code for emitting diffs and recursion in one place

2014-02-13 Thread Kirill Smelkov
On Thu, Feb 13, 2014 at 09:43:27AM -0800, Junio C Hamano wrote: > Kirill Smelkov writes: > > > +static void show_path(struct strbuf *base, struct diff_options *opt, > > + struct tree_desc *t1, struct tree_desc *t2) > > { > > unsigned mode; > > const char *path; > > - co

Re: [PATCH 02/11] tree-diff: consolidate code for emitting diffs and recursion in one place

2014-02-13 Thread Junio C Hamano
Kirill Smelkov writes: > +static void show_path(struct strbuf *base, struct diff_options *opt, > + struct tree_desc *t1, struct tree_desc *t2) > { > unsigned mode; > const char *path; > - const unsigned char *sha1 = tree_entry_extract(desc, &path, &mode); > -

[PATCH 02/11] tree-diff: consolidate code for emitting diffs and recursion in one place

2014-02-07 Thread Kirill Smelkov
Currently both compare_tree_entry() and show_path() invoke opt diff callbacks (opt->add_remove() and opt->change()), and also they both have code which decides whether to recurse into sub-tree, and whether to emit a tree as separate entry if DIFF_OPT_TREE_IN_RECURSIVE is set. I.e. we have code dup