diff mbox series

libxfs-apply: fix stgit detection

Message ID 20250220175600.3728574-2-aalbersh@kernel.org (mailing list archive)
State New
Headers show
Series libxfs-apply: fix stgit detection | expand

Commit Message

Andrey Albershteyn Feb. 20, 2025, 5:56 p.m. UTC
stgit top doesn't seem to return 0 if stack is created for a branch
but no patches applied. The code is 2 as when no 'stgit init' was
run.

Replace top with log which always has at least "initialize" action.

Stacked Git 2.4.12

Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
 tools/libxfs-apply | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Darrick J. Wong Feb. 20, 2025, 6:36 p.m. UTC | #1
On Thu, Feb 20, 2025 at 06:56:01PM +0100, Andrey Albershteyn wrote:
> stgit top doesn't seem to return 0 if stack is created for a branch
> but no patches applied. The code is 2 as when no 'stgit init' was
> run.
> 
> Replace top with log which always has at least "initialize" action.
> 
> Stacked Git 2.4.12
> 
> Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>

Works for me,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  tools/libxfs-apply | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/libxfs-apply b/tools/libxfs-apply
> index 097a695f942b..480b862d06a7 100755
> --- a/tools/libxfs-apply
> +++ b/tools/libxfs-apply
> @@ -100,7 +100,7 @@ if [ $? -eq 0 ]; then
>  fi
>  
>  # Are we using stgit? This works even if no patch is applied.
> -stg top &> /dev/null
> +stg log &> /dev/null
>  if [ $? -eq 0 ]; then
>  	STGIT=1
>  fi
> -- 
> 2.47.2
> 
>
diff mbox series

Patch

diff --git a/tools/libxfs-apply b/tools/libxfs-apply
index 097a695f942b..480b862d06a7 100755
--- a/tools/libxfs-apply
+++ b/tools/libxfs-apply
@@ -100,7 +100,7 @@  if [ $? -eq 0 ]; then
 fi
 
 # Are we using stgit? This works even if no patch is applied.
-stg top &> /dev/null
+stg log &> /dev/null
 if [ $? -eq 0 ]; then
 	STGIT=1
 fi