From: Nguyen Thai Ngoc Duy Date: Wed, 23 Mar 2011 15:41:47 GMT Subject: Re: Relative ls-files Message-ID: In-Reply-To: <7v39mdhni3.fsf@alter.siamese.dyndns.org> On Wed, Mar 23, 2011 at 10:20 PM, Junio C Hamano wrote: > Nguyen Thai Ngoc Duy writes: > >> (off topic?) >> >> "ls-tree -r" does not understand wildcards. Maybe it should not, but I >> think read_tree_recursive() should use tree_entry_interesting(). The >> function it uses for matching, match_tree_entry, looks like another >> variant of t_e_interesting. > > I thought that you already did that within the scope of your earlier > topic. > > "ls-tree" is quite a low-level plumbing, and until we absolutely know that > all the old scripts people wrote relying on its original behaviour are > extinct, we shouldn't touch it without a reasonable breakage protection. > > It is Ok to give it a command line option to make it in line with other > pathspec users, namely, that causes the command to missing pathspec should > automatically mean the whole tree and to honor globs.  No existing script > would be using that option, so that is a safe thing to do. This read_tree_recursive() affects 'archive' and 'checkout -- paths' (ie. no wildcard awareness). I will probably move match_tree_entry() to ls-tree.c to preserve its behavior, then change read_tree_recursive() to use tree_entry_interesting(). -- Duy