Re: [PATCH v2] rev-list: teach --oid-only to enable piping

2019-06-19 Thread Jeff King
On Fri, Jun 14, 2019 at 04:29:46PM -0700, Emily Shaffer wrote: > On Fri, Jun 14, 2019 at 12:07:28PM -0400, Jeff King wrote: > > On Thu, Jun 13, 2019 at 02:51:03PM -0700, Emily Shaffer wrote: > > > > +test_expect_success 'rev-list --objects --oid-only is usable by > > > cat-file' ' > > > + git re

Re: [PATCH v2] rev-list: teach --oid-only to enable piping

2019-06-14 Thread Emily Shaffer
On Fri, Jun 14, 2019 at 12:07:28PM -0400, Jeff King wrote: > On Thu, Jun 13, 2019 at 02:51:03PM -0700, Emily Shaffer wrote: > > +test_expect_success 'rev-list --objects --oid-only is usable by cat-file' ' > > + git rev-list --objects --oid-only --all >list-output && > > + git cat-file --batch-

Re: [PATCH v2] rev-list: teach --oid-only to enable piping

2019-06-14 Thread Emily Shaffer
On Fri, Jun 14, 2019 at 01:25:59PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > But I wonder if things would be simpler if we did not touch the commit > > code path at all. I.e., if this were simply "--no-object-names", and it > > touched only show_object(). > > Yeah, that sounds more

Re: [PATCH v2] rev-list: teach --oid-only to enable piping

2019-06-14 Thread Junio C Hamano
Jeff King writes: > But I wonder if things would be simpler if we did not touch the commit > code path at all. I.e., if this were simply "--no-object-names", and it > touched only show_object(). Yeah, that sounds more tempting. And the refined code structure you suggested ... >> @@ -255,6 +262

Re: [PATCH v2] rev-list: teach --oid-only to enable piping

2019-06-14 Thread Jeff King
On Thu, Jun 13, 2019 at 02:51:03PM -0700, Emily Shaffer wrote: > It didn't appear that using an existing --pretty string would do the > trick, as the formatting options for --pretty apply specifically to > commit objects (you can specify the commit hash and the tree hash, but > I didn't see a way

[PATCH v2] rev-list: teach --oid-only to enable piping

2019-06-13 Thread Emily Shaffer
Allow easier parsing by cat-file by giving rev-list an option to print only the OID of an object without any additional information. This is a short-term shim; later on, rev-list should be taught how to print the types of objects it finds in a format similar to cat-file's. Before this commit, the