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

Re: [RFC] revision: Add --sticky-default option

From
Jeff King <peff@peff.net>
Date
Oct 17, 2018, 18:11 UTC
Message-ID
<20181017181156.GA28326@sigill.intra.peff.net>
In-Reply-To
<alpine.DEB.2.21.1810170620260.166761@matvore-linux.svl.corp.google.com>
On Wed, Oct 17, 2018 at 06:24:05AM -0700, Matthew DeVore wrote:
Show 17 quoted lines
> > Yuck, t4202 is a mix of older and newer styles. I'm OK with this as-is
> > because you've matched the surrounding code, but these days I'd probably
> > write:
> > 
> >  test_expect_success '--sticky-default ^<rev>' '
> > 	{
> > 		echo sixth
> > 		echo fifth
> > 	} >expect &&
> > 	git log --format=%s --sticky-default ^HEAD~2 >actual &&
> > 	test_cmp expect actual
> >  '
> > 
> 
> How about test_write_lines? That is a little more readable to me than
> the echos in a subshell. A patch was recently queued with a usage of
> that function:

Ah, yeah, that would be fine. I was trying to avoid a cat/here-doc combo since it incurs a process, but test_write_lines is readable and fast.

The main style things I wanted to show are:
  - setting up the expect file should go in the test_expect block
  - no space between ">" and the filename

Those are both present in the surrounding code, but we're slowly cleaning them up.

-Peff
Previous: Matthew DeVoreNext: Andreas Gruenbacher
Message 4 of 12 in “[RFC] revision: Add --sticky-default option”
  1. Andreas GruenbacherOct 16, 2018
  2. Jeff KingOct 17, 2018
  3. Matthew DeVoreOct 17, 2018
  4. Jeff KingOct 17, 2018
  5. Andreas GruenbacherOct 17, 2018
  6. Jeff KingOct 17, 2018
  7. Junio C HamanoOct 18, 2018
  8. Jeff KingOct 18, 2018
  9. Junio C HamanoOct 18, 2018
  10. Andreas GruenbacherOct 18, 2018
  11. Junio C HamanoOct 18, 2018
  12. Andreas GruenbacherOct 18, 2018

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.