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

Re: [PATCH] blame: Allow to blame paths freshly added to the index

From
Mike Hommey <mh@glandium.org>
Date
Jul 15, 2016, 12:42 UTC
Message-ID
<20160715124201.mrz5ze32s7koevww@glandium.org>
In-Reply-To
<20160715123758.GA22395@sigill.intra.peff.net>
On Fri, Jul 15, 2016 at 08:37:59AM -0400, Jeff King wrote:
Show 36 quoted lines
> On Fri, Jul 15, 2016 at 09:32:45PM +0900, Mike Hommey wrote:
> 
> > > > +test_expect_success 'blame wholesale copy and more in the index' '
> > > > +
> > > > +	{
> > > > +		echo ABC
> > > > +		echo DEF
> > > > +		echo XXXX
> > > > +		echo YYYY
> > > > +		echo GHIJK
> > > > +	} >horse &&
> > > 
> > > A more common way to do this in our test scripts is by using here
> > > documents. However, in this case I would suggest
> > > 
> > > 	test_write_lines ABC DEF XXXX YYYY GHIJK >horse
> > 
> > I merely copied the pattern used in other places in the same test file.
> > Using test_write_lines or something else (what are "here documents"?)
> > would break consistency. I can also change the other similar blocks at
> > the same time, though, whichever you prefer.
> 
> A here document is this:
> 
>    cat <<-\EOF
>    ABC
>    DEF
>    XXXX
>    YYYY
>    GHIJK
>    EOF
> 
> The "<<" starts the here-doc. The "-" tells the shell to strip leading
> tabs (so you can keep it indented with the rest of the code. The "\"
> tells the shell not to interpolate (not a big deal here, but great for
> more complicated input). The "EOF" tells it where to stop.

Oh, so that's what they are called! I've used them for 20 years without knowing :) TIL.

Mike
Previous: Jeff KingNext: Mike Hommey
Message 5 of 15 in “blame: Allow to blame paths freshly added to the index”
  1. blame: Allow to blame paths freshly added to the indexMike Hommey, Jul 15, 2016
  2. Johannes SchindelinJul 15, 2016
  3. Mike HommeyJul 15, 2016
  4. Jeff KingJul 15, 2016
  5. Mike HommeyJul 15, 2016
  6. blame: Allow to blame paths freshly added to the indexMike Hommey, Jul 15, 2016
  7. Johannes SchindelinJul 15, 2016
  8. Junio C HamanoJul 15, 2016
  9. Junio C HamanoJul 15, 2016
  10. Mike HommeyJul 15, 2016
  11. Junio C HamanoJul 18, 2016
  12. 1/2 blame: Allow to blame paths freshly added to the indexMike Hommey, Jul 15, 2016
  13. 2/2 t/t8003-blame-corner-cases.sh: Use here documentsMike Hommey, Jul 15, 2016
  14. Johannes SchindelinJul 16, 2016
  15. Junio C HamanoJul 18, 2016

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.