git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jeff King <peff@peff.net>
Date
Jun 19, 2019, 21:24 UTC
Message-ID
<20190619212411.GB6571@sigill.intra.peff.net>
In-Reply-To
<20190614232946.GF233791@google.com>
On Fri, Jun 14, 2019 at 04:29:46PM -0700, Emily Shaffer wrote:
Show 23 quoted lines
> 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-check <list-output >cat-output &&
> > > +	! grep missing cat-output
> > > +'
> > 
> > Usually we prefer to look for the expected output, rather than making
> > sure we did not find the unexpected. But I'm not sure if that might be
> > burdensome in this case (i.e., if there's a bunch of cruft coming out of
> > "rev-list" that would be annoying to match, and might even change as
> > people add more tests). So I'm OK with it either way.
> 
> My (newbie) opinion is that in this case, we specifically want to know
> that cat-file didn't choke on objects which we know exist (since they
> came from rev-list). I have the feeling that checking for the exact
> objects returned instead (or a sample of them) would be more brittle and
> would also make the wording of the test less direct.
> 
> So if there's no complaint either way, I'd prefer to leave it the way it
> is.

Yeah, that's fine with me if it seems more clear to use grep here (and I was on the fence).

> By the way, rev-list-misc.sh has a number of other existing "! grep ..."
> lines.

It never fails that when I complain about a style issue, the surrounding code is full of the same thing. ;) I'd have to look at each one to determine if they're sensible or not, and it's probably not worth anybody's time to do that cleanup at this point in time.

-Peff
Previous: Emily ShafferNext: Emily Shaffer
Message 13 of 22 in “revision: remove stray whitespace when name empty”
  1. revision: remove stray whitespace when name emptyEmily Shaffer, Jun 7, 2019
  2. Eric SunshineJun 8, 2019
  3. Emily ShafferJun 12, 2019
  4. Jeff KingJun 9, 2019
  5. Junio C HamanoJun 10, 2019
  6. Emily ShafferJun 12, 2019
  7. Jeff KingJun 13, 2019
  8. rev-list: teach --oid-only to enable pipingEmily Shaffer, Jun 13, 2019
  9. Jeff KingJun 14, 2019
  10. Junio C HamanoJun 14, 2019
  11. Emily ShafferJun 14, 2019
  12. Emily ShafferJun 14, 2019
  13. Jeff KingJun 19, 2019
  14. rev-list: teach --no-object-names to enable pipingEmily Shaffer, Jun 14, 2019
  15. Junio C HamanoJun 17, 2019
  16. Emily ShafferJun 18, 2019
  17. rev-list: teach --no-object-names to enable pipingEmily Shaffer, Jun 18, 2019
  18. Junio C HamanoJun 19, 2019
  19. Emily ShafferJun 19, 2019
  20. Jeff KingJun 19, 2019
  21. rev-list: teach --no-object-names to enable pipingEmily Shaffer, Jun 19, 2019
  22. Jeff KingJun 19, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.