From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Xen-devel" <xen-devel@lists.xenproject.org>
Cc: "Jan Beulich" <JBeulich@suse.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>
Subject: Re: [PATCH] scripts: Refine git-checkout.sh change for different branches
Date: Thu, 31 Oct 2024 14:17:06 +0000 [thread overview]
Message-ID: <D5A20JD5PC3G.22TWXL5RY7PQD@cloud.com> (raw)
In-Reply-To: <20241031134702.2913536-1-andrew.cooper3@citrix.com>
On Thu Oct 31, 2024 at 1:47 PM GMT, Andrew Cooper wrote:
> 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
Can this be shallow (--depth 1) clone instead to avoid pulling for whole
history in CI? There's probably some ENV variable that could be recovered
from.
> 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
next prev parent reply other threads:[~2024-10-31 14:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 13:47 [PATCH] scripts: Refine git-checkout.sh change for different branches Andrew Cooper
2024-10-31 14:17 ` Alejandro Vallejo [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D5A20JD5PC3G.22TWXL5RY7PQD@cloud.com \
--to=alejandro.vallejo@cloud.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=julien@xen.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.