Thread (7 messages) flat view 7 messages, 3 authors, 2016-07-15

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

From: Mike Hommey <hidden>
Date: 2016-07-15 12:42:18

On Fri, Jul 15, 2016 at 08:37:59AM -0400, Jeff King wrote:
On Fri, Jul 15, 2016 at 09:32:45PM +0900, Mike Hommey wrote:
quoted
quoted
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help