Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-15 Thread Matthew DeVore
On Wed, Aug 15, 2018 at 9:17 AM Junio C Hamano wrote: > > Jeff King writes: > > > Right, I'd agree they probably want the minimum for that traversal. And > > for `rev-list --filter`, that's probably OK. But keep in mind the main > > goal for --filter is using it for fetches, and many servers do

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-15 Thread Matthew DeVore
On Wed, Aug 15, 2018 at 9:14 AM Junio C Hamano wrote: > > Matthew DeVore writes: > > > Thank you. I changed it to this: > > awk -e "/tree|blob/{print \$1}" objs >trees_and_blobs > > The "-e" option does not appear in > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html > >

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-15 Thread Junio C Hamano
Jeff King writes: > Right, I'd agree they probably want the minimum for that traversal. And > for `rev-list --filter`, that's probably OK. But keep in mind the main > goal for --filter is using it for fetches, and many servers do not > perform the traversal at all. Instead they use reachability

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-15 Thread Junio C Hamano
Matthew DeVore writes: > Thank you. I changed it to this: > awk -e "/tree|blob/{print \$1}" objs >trees_and_blobs The "-e" option does not appear in http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html and I think you can safely drop it from your command line. If no -f

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Jeff King
On Tue, Aug 14, 2018 at 04:55:34PM -0700, Matthew DeVore wrote: > > - it's expensive to compute, because you have to actually walk all of > > the possible commits and trees that could refer to it. This > > prohibits a lot of other optimizations like reachability bitmaps > > (though

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Matthew DeVore
On Tue, Aug 14, 2018 at 1:01 PM Jeff King wrote: > > On Tue, Aug 14, 2018 at 10:28:13AM -0700, Matthew DeVore wrote: > > > The name "tree:0" allows later filtering based on depth, i.e. "tree:1" > > would filter out all but the root tree and blobs. In order to avoid > > confusion between 0 and

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Matthew DeVore
On Tue, Aug 14, 2018 at 1:55 PM Junio C Hamano wrote: > > Jonathan Tan writes: > > >> - grep -E "tree|blob" objs >trees_and_blobs && > >> - test_line_count = 1 trees_and_blobs > >> + grep -E "tree|blob" objs \ > >> + | awk -f print_1.awk >trees_and_blobs && > >> + git -C r1 rev-parse HEAD:

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Junio C Hamano
Jonathan Tan writes: >> - grep -E "tree|blob" objs >trees_and_blobs && >> - test_line_count = 1 trees_and_blobs >> + grep -E "tree|blob" objs \ >> + | awk -f print_1.awk >trees_and_blobs && >> + git -C r1 rev-parse HEAD: >expected && >> + test_cmp trees_and_blobs expected > > Indent "| awk" (and

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Jonathan Tan
> - grep -E "tree|blob" objs >trees_and_blobs && > - test_line_count = 1 trees_and_blobs > + grep -E "tree|blob" objs \ > + | awk -f print_1.awk >trees_and_blobs && > + git -C r1 rev-parse HEAD: >expected && > + test_cmp trees_and_blobs expected Indent "| awk" (and similar lines in this patch) -

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Jeff King
On Tue, Aug 14, 2018 at 10:28:13AM -0700, Matthew DeVore wrote: > The name "tree:0" allows later filtering based on depth, i.e. "tree:1" > would filter out all but the root tree and blobs. In order to avoid > confusion between 0 and capital O, the documentation was worded in a > somewhat

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Matthew DeVore
On Tue, Aug 14, 2018 at 11:18 AM Jonathan Tan wrote: > > > @@ -743,6 +743,9 @@ specification contained in . > > A debug option to help with future "partial clone" development. > > This option specifies how missing objects are handled. > > + > > +The form '--filter=tree:' omits all

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Jonathan Tan
> @@ -743,6 +743,9 @@ specification contained in . > A debug option to help with future "partial clone" development. > This option specifies how missing objects are handled. > + > +The form '--filter=tree:' omits all blobs and trees deeper than > + from the root tree. Currently, only

[PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Matthew DeVore
Teach list-objects the "tree:0" filter which allows for filtering out all tree and blob objects (unless other objects are explicitly specified by the user). The purpose of this patch is to allow smaller partial clones. The name of this filter - tree:0 - does not explicitly specify that it also