[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] scripts: Refine git-checkout.sh change for different branches



On Thu Oct 31, 2024 at 2:21 PM GMT, Andrew Cooper wrote:
> 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 <andrew.cooper3@xxxxxxxxxx>
> >> ---
> >> CC: Jan Beulich <JBeulich@xxxxxxxx>
> >> CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> >> CC: Julien Grall <julien@xxxxxxx>
> >>
> >> 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

Fair. From inspection, pending an ok from some pipelines:

  Reviewed-by: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>

Cheers,
Alejandro



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.