[bitbake-devel] [PATCH] fetch2/git.py: try to handle local clone failures by pruning branches

Mikko.Rapeli at bmw.de Mikko.Rapeli at bmw.de
Wed Aug 2 11:43:12 UTC 2017


On Wed, Aug 02, 2017 at 12:32:31PM +0100, Burton, Ross wrote:
> On 2 August 2017 at 10:47, Mikko Rapeli <mikko.rapeli at bmw.de> wrote:
> 
> > +            except bb.fetch2.FetchError:
> > +                # try to recover by pruning deleted remote branches which
> > +                # make cloning local git tree fail in git 2.7.x but not in
> > +                # git 1.9.x
> > +                try:
> > +                    runfetchcmd("%s -C %s remote prune origin" %
> > (ud.basecmd, ud.clonedir), d)
> > +                except bb.fetch2.FetchError:
> > +                    pass
> >
> 
> Would it be best to simplify the logic by aways pruning before fetching?
> Prune doesn't take a long time, and it will keep the size of the mirror
> down.

Depends. Is download directory supposed to be treated read-only for all but
real do_fetch?

I would prefer that pruning happened after the real fetch from remote git tree
since the tree in download dir is modified at that point.

In this exceptional case the pruning is needed when fetching an uptodate git
tree from download dir to workspace, because git has decided to start failing
the local clone. (I guess this was called do_unpack for glibc recipe where we
saw this issue.)

-Mikko


More information about the bitbake-devel mailing list