On 31/10/2024 2:17 pm, Alejandro Vallejo wrote:
> 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 <[email protected]>
>> ---
>> CC: Jan Beulich <[email protected]>
>> CC: Stefano Stabellini <[email protected]>
>> CC: Julien Grall <[email protected]>
>>
>> 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.
Maybe, but not here. One swamp at a time.
More specifically, my first iteration of this fix did use --depth 1, but
it broke QEMU's submodules. I'm not debugging that as a prerequisite of
fixing other CI breakages.
~Andrew