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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 20, 2017 at 08:56:11PM -0400, Kyle Meyer wrote:

> These patches follow up on Peff's suggestion to modernize the style in
> t1400-update-ref.sh.
> 
>     20170217082253.kxjezkxfqkfxjhzr@xxxxxxxxxxxxxxxxxxxxx
> 
> The first two commits aren't concerned with "modernizing" the tests,
> but instead address issues that I noticed while looking more closely
> at t1400.

Looks good overall to me. Thanks for following up.

> I also considered
> 
>   * making the quoting/spacing/breaks around the test descriptions and
>     bodies more consistent, but I think this leads to too much code
>     churn.

I wouldn't mind the churn if you wanted to do it on top, but it's
definitely not necessary. There's nothing in 'pu' right now that touches
the file.

>   * 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.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]