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

Re: [PATCH 0/5] t1400: modernize style

From
Kyle Meyer <kyle@kyleam.com>
Date
Mar 22, 2017, 01:58 UTC
Message-ID
<87fui6kr7h.fsf@kyleam.com>
In-Reply-To
<20170321020155.dx5juulntg5k6fpr@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> On Mon, Mar 20, 2017 at 08:56:11PM -0400, Kyle Meyer wrote:
[...]
Show 27 quoted lines
>>   * moving the here-documents for log creation into the following
>>     tests, but I don't think it's worth it because it makes already
>>     long lines even longer.
>
> Yeah, they're quite long. Probably something like:
>
>   # arguments: <from> <to> <time> <msg>
>   reflog () {
> 	printf '%s %s %s <%s> %s +0000\t%s' \
> 		"$1" "$2" \
> 		"$GIT_COMMITTER_NAME" "$GIT_COMMITTER_EMAIL" \
> 		"$3" "$4"
>   }
>
>   test_expect_success 'verify $m log' '
> 	{
> 		reflog $Z $A 1117150200 "Initial Creation" &&
> 		reflog $A $B 1117150260 "Switch" &&
> 		reflog $B $A 1117150860 &&
> 	} >expect &&
> 	test_cmp expect .git/logs/$m
>   '
>
> wouldn't be too bad. Or maybe it's worse, because the actual format is
> all tangled up in that printf statement. ;)
>
> I'm OK with it either way.

Heh, I didn't consider that option. I suppose I'll stick with the here-document for now because, to my eyes, it seems a bit easier to read.

-- 
Kyle
Previous: Kyle Meyer
Message 16 of 16 in “t1400: modernize style”
  1. 0/5 t1400: modernize styleKyle Meyer, Mar 21, 2017
  2. 1/5 t1400: rename test descriptions to be uniqueKyle Meyer, Mar 21, 2017
  3. Jeff KingMar 21, 2017
  4. 2/5 t1400: set core.logAllRefUpdates in "logged by touch" testsKyle Meyer, Mar 21, 2017
  5. Jeff KingMar 21, 2017
  6. Kyle MeyerMar 22, 2017
  7. 3/5 t1400: use test_path_is_* helpersKyle Meyer, Mar 21, 2017
  8. Jeff KingMar 21, 2017
  9. 4/5 t1400: remove a set of unused output filesKyle Meyer, Mar 21, 2017
  10. Jeff KingMar 21, 2017
  11. 5/5 t1400: use test_when_finished for cleanupKyle Meyer, Mar 21, 2017
  12. Jeff KingMar 21, 2017
  13. Jeff KingMar 21, 2017
  14. Junio C HamanoMar 21, 2017
  15. Kyle MeyerMar 22, 2017
  16. Kyle MeyerMar 22, 2017

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.