[libcamera-ci,v1] lib: find_base(): Print error messages to stderr
diff mbox series

Message ID 20260803110247.109811-1-barnabas.pocze@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-ci,v1] lib: find_base(): Print error messages to stderr
Related show

Commit Message

Barnabás Pőcze Aug. 3, 2026, 11:02 a.m. UTC
Otherwise they will not be shown when used e.g. as

  base=$(find_base ...)

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 .gitlab-ci/lib.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--
2.55.0

Comments

Kieran Bingham Aug. 4, 2026, 2:16 p.m. UTC | #1
Quoting Barnabás Pőcze (2026-08-03 12:02:47)
> Otherwise they will not be shown when used e.g. as
> 
>   base=$(find_base ...)
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  .gitlab-ci/lib.sh | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/.gitlab-ci/lib.sh b/.gitlab-ci/lib.sh
> index c804eee..4eb7000 100755
> --- a/.gitlab-ci/lib.sh
> +++ b/.gitlab-ci/lib.sh
> @@ -15,14 +15,14 @@ find_base() {
>         local base=$(git merge-base $r1 $r2)
> 
>         if [[ -z $base ]] ; then
> -               echo "No common ancestor between $r1 and $r2."
> -               echo "Make sure your master branch is up-to-date."
> +               echo "No common ancestor between $r1 and $r2." >&2
> +               echo "Make sure your master branch is up-to-date." >&2
>                 exit 1
>         fi
> 
>         if [[ $(git log --oneline $base..$r2 | wc -l) -gt 50 ]] ; then
> -               echo "Common ancestor $base of $r1 and $r2 is too far in history."
> -               echo "Make sure your master branch is up-to-date."
> +               echo "Common ancestor $base of $r1 and $r2 is too far in history." >&2
> +               echo "Make sure your master branch is up-to-date." >&2
>                 exit 1
>         fi
> 
> --
> 2.55.0
Jacopo Mondi Aug. 6, 2026, 8:01 a.m. UTC | #2
Hi Barnabás

On Mon, Aug 03, 2026 at 01:02:47PM +0200, Barnabás Pőcze wrote:
> Otherwise they will not be shown when used e.g. as
>
>   base=$(find_base ...)
>
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

I think I certainly stumped into this

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
   j

> ---
>  .gitlab-ci/lib.sh | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/.gitlab-ci/lib.sh b/.gitlab-ci/lib.sh
> index c804eee..4eb7000 100755
> --- a/.gitlab-ci/lib.sh
> +++ b/.gitlab-ci/lib.sh
> @@ -15,14 +15,14 @@ find_base() {
>  	local base=$(git merge-base $r1 $r2)
>
>  	if [[ -z $base ]] ; then
> -		echo "No common ancestor between $r1 and $r2."
> -		echo "Make sure your master branch is up-to-date."
> +		echo "No common ancestor between $r1 and $r2." >&2
> +		echo "Make sure your master branch is up-to-date." >&2
>  		exit 1
>  	fi
>
>  	if [[ $(git log --oneline $base..$r2 | wc -l) -gt 50 ]] ; then
> -		echo "Common ancestor $base of $r1 and $r2 is too far in history."
> -		echo "Make sure your master branch is up-to-date."
> +		echo "Common ancestor $base of $r1 and $r2 is too far in history." >&2
> +		echo "Make sure your master branch is up-to-date." >&2
>  		exit 1
>  	fi
>
> --
> 2.55.0

Patch
diff mbox series

diff --git a/.gitlab-ci/lib.sh b/.gitlab-ci/lib.sh
index c804eee..4eb7000 100755
--- a/.gitlab-ci/lib.sh
+++ b/.gitlab-ci/lib.sh
@@ -15,14 +15,14 @@  find_base() {
 	local base=$(git merge-base $r1 $r2)

 	if [[ -z $base ]] ; then
-		echo "No common ancestor between $r1 and $r2."
-		echo "Make sure your master branch is up-to-date."
+		echo "No common ancestor between $r1 and $r2." >&2
+		echo "Make sure your master branch is up-to-date." >&2
 		exit 1
 	fi

 	if [[ $(git log --oneline $base..$r2 | wc -l) -gt 50 ]] ; then
-		echo "Common ancestor $base of $r1 and $r2 is too far in history."
-		echo "Make sure your master branch is up-to-date."
+		echo "Common ancestor $base of $r1 and $r2 is too far in history." >&2
+		echo "Make sure your master branch is up-to-date." >&2
 		exit 1
 	fi