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

Re: [PATCH v2] pretty: add "%aL"|"%al|%cL|%cl" option to output local-part of email addresses

From
Prarit Bhargava <prarit@redhat.com>
Date
Oct 24, 2019, 23:05 UTC
Message-ID
<5d9b8cbe-489e-b3eb-873c-4aee2e2015d0@redhat.com>
In-Reply-To
<20191024202947.GN4348@szeder.dev>
On 10/24/19 4:29 PM, SZEDER Gábor wrote:
Show 25 quoted lines
> 
> Just a couple of test nits:
> 
> On Thu, Oct 24, 2019 at 08:53:32AM -0400, Prarit Bhargava wrote:
>> +test_expect_success 'log pretty %an %ae %al %aN %aE %aL' '
>> +	git checkout -b anaeal &&
>> +	test_commit anaeal_test anaeal_test_file &&
>> +	git log --pretty="%an%n%ae%n%al%n%aN%n%aE%n%aL" -1 > actual &&
> 
> Style: no space between redirection and filename, i.e. >actual
> 
>> +	{
>> +		echo "${GIT_AUTHOR_NAME}" &&
>> +		echo "${GIT_AUTHOR_EMAIL}" &&
>> +		echo "${TEST_AUTHOR_LOCALNAME}"
> 
> Broken &&-chain (though with just a bunch of echos it won't really
> make much of a difference)
> 
>> +		echo "${GIT_AUTHOR_NAME}" &&
>> +		echo "${GIT_AUTHOR_EMAIL}" &&
>> +		echo "${TEST_AUTHOR_LOCALNAME}"
> 
> All these variables stand on their own, so the curly braces around
> them are unnecessary.

I've changed this code (based on Peff's suggestions) to other tests, however, AFAIK using braces around is considered "good practice".

It can't harm anything to have braces but if the preferred git coding style is to only use them when necessary I will remove them.

P.
Show 20 quoted lines
> 
>> +	} > expect &&
>> +	test_cmp expect actual
>> +'
>> +
>> +test_expect_success 'log pretty %cn %ce %cl %cN %cE %cL' '
>> +	git checkout -b cncecl &&
>> +	test_commit cncecl_test cncecl_test_file &&
>> +	git log --pretty="%cn%n%ce%n%cl%n%cN%n%cE%n%cL" -1 > actual &&
>> +	{
>> +		echo "${GIT_COMMITTER_NAME}" &&
>> +		echo "${GIT_COMMITTER_EMAIL}" &&
>> +		echo "${TEST_COMMITTER_LOCALNAME}"
>> +		echo "${GIT_COMMITTER_NAME}" &&
>> +		echo "${GIT_COMMITTER_EMAIL}" &&
>> +		echo "${TEST_COMMITTER_LOCALNAME}"
>> +	} > expect &&
>> +	test_cmp expect actual
>> +'
>> +
Previous: SZEDER GáborNext: Junio C Hamano
Message 5 of 7 in “pretty: add "%aL"|"%al|%cL|%cl" option to output local-part of email addresses”
  1. pretty: add "%aL"|"%al|%cL|%cl" option to output local-part of email addressesPrarit Bhargava, Oct 24, 2019
  2. Jeff KingOct 24, 2019
  3. Prarit BhargavaOct 24, 2019
  4. SZEDER GáborOct 24, 2019
  5. Prarit BhargavaOct 24, 2019
  6. Junio C HamanoOct 25, 2019
  7. Prarit BhargavaOct 25, 2019

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.