All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts: Refine git-checkout.sh change for different branches
@ 2024-10-31 13:47 Andrew Cooper
  2024-10-31 14:17 ` Alejandro Vallejo
  2024-10-31 14:33 ` Andrew Cooper
  0 siblings, 2 replies; 9+ messages in thread
From: Andrew Cooper @ 2024-10-31 13:47 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Jan Beulich, Stefano Stabellini, Julien Grall

The change works for divergent branches, but doesn't work for explicit SHAs.

Instead of passing `-b $TAG` to clone, explicitly fetch the $TAG we want after
cloning.

Fixes: c554ec124b12 ("scripts: Fix git-checkout.sh to work with branches other than master")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>

Speculative fix, pending CI:
  https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1521847529
---
 scripts/git-checkout.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/git-checkout.sh b/scripts/git-checkout.sh
index 3796cbfe39a7..9f8f2bd04fca 100755
--- a/scripts/git-checkout.sh
+++ b/scripts/git-checkout.sh
@@ -14,9 +14,10 @@ set -e
 if test \! -d $DIR-remote; then
 	rm -rf $DIR-remote $DIR-remote.tmp
 	mkdir -p $DIR-remote.tmp; rmdir $DIR-remote.tmp
-	$GIT clone -b $TAG $TREE $DIR-remote.tmp
+	$GIT clone $TREE $DIR-remote.tmp
 	if test "$TAG" ; then
 		cd $DIR-remote.tmp
+                $GIT fetch origin $TAG
 		$GIT branch -D dummy >/dev/null 2>&1 ||:
 		$GIT checkout -b dummy $TAG
 		cd -

base-commit: 9a2a50d5de7647bfb529867fdce47ec64b07f06a
prerequisite-patch-id: ef7a8f78a2a3bfb35a2835ce8c2ec97d95f1267e
prerequisite-patch-id: 8c25962203bdb283a9c95328fb0867ffa3da8b95
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-11-01 13:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-31 13:47 [PATCH] scripts: Refine git-checkout.sh change for different branches Andrew Cooper
2024-10-31 14:17 ` Alejandro Vallejo
2024-10-31 14:21   ` Andrew Cooper
2024-10-31 14:33     ` Alejandro Vallejo
2024-10-31 14:33 ` Andrew Cooper
2024-10-31 22:44   ` Stefano Stabellini
2024-10-31 22:52     ` Andrew Cooper
2024-11-01 12:26       ` Jason Andryuk
2024-11-01 13:07         ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.