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

Re: [PATCH v1] travis-ci: fix "skip_branch_tip_with_tag()" string comparison

From
Lars Schneider <larsxschneider@gmail.com>
Date
Sep 21, 2017, 22:26 UTC
Message-ID
<4FC081C4-355E-4E62-8CD8-89C299485182@gmail.com>
In-Reply-To
<20170921212848.GJ27425@aiede.mtv.corp.google.com>
Show 30 quoted lines
> On 21 Sep 2017, at 23:28, Jonathan Nieder <jrnieder@gmail.com> wrote:
> 
> larsxschneider@gmail.com wrote:
> 
>> 09f5e97 ("travis-ci: skip a branch build if equal tag is present",
>> 2017-09-17) introduced the "skip_branch_tip_with_tag" function with
>> a broken string comparison. Fix it!
>> 
>> Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
>> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
>> ---
> 
> Thanks for the fix.
> 
> 09f5e97 appears to be for the ls/travis-scriptify branch, which is
> already part of "next" (if it weren't, I'd suggest just squashing your
> patch into that commit).
> 
>> --- a/ci/lib-travisci.sh
>> +++ b/ci/lib-travisci.sh
>> @@ -14,7 +14,7 @@ skip_branch_tip_with_tag () {
>> 	# of a tag.
>> 
>> 	if TAG=$(git describe --exact-match "$TRAVIS_BRANCH" 2>/dev/null) &&
>> -		$TAG != $TRAVIS_BRANCH
>> +		[ "$TAG" != "$TRAVIS_BRANCH" ]
> 
> Git style is to use 'test' instead of '[' for this.  See
> https://public-inbox.org/git/2f3cdc85-f051-c0ae-b9db-fd13cac78aed@gmail.com/
> for more on that subject.
Oh, you're right!
> Could you squash in the following?
@Junio: Can you squash it when you apply the patch?

Thank you, Lars

Show 17 quoted lines
> 
> Thanks,
> Jonathan
> 
> diff --git i/ci/lib-travisci.sh w/ci/lib-travisci.sh
> index c3b46f4a7d..b3ed0a0dda 100755
> --- i/ci/lib-travisci.sh
> +++ w/ci/lib-travisci.sh
> @@ -14,7 +14,7 @@ skip_branch_tip_with_tag () {
> 	# of a tag.
> 
> 	if TAG=$(git describe --exact-match "$TRAVIS_BRANCH" 2>/dev/null) &&
> -		[ "$TAG" != "$TRAVIS_BRANCH" ]
> +		test "$TAG" != "$TRAVIS_BRANCH"
> 	then
> 		echo "Tip of $TRAVIS_BRANCH is exactly at $TAG"
> 		exit 0
Previous: Jonathan NiederNext: Junio C Hamano
Message 3 of 4 in “travis-ci: fix "skip_branch_tip_with_tag()" string comparison”
  1. travis-ci: fix "skip_branch_tip_with_tag()" string comparisonlarsxschneider@gmail.com, Sep 21, 2017
  2. Jonathan NiederSep 21, 2017
  3. Lars SchneiderSep 21, 2017
  4. Junio C HamanoSep 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.