[PATCH v2] buildman: Use git worktrees instead of git clones when possible
Simon Glass
sjg at chromium.org
Sat Sep 5 18:37:25 CEST 2020
On Sat, 5 Sep 2020 at 10:36, Simon Glass <sjg at chromium.org> wrote:
>
> On Thu, 3 Sep 2020 at 06:51, Alper Nebi Yasak <alpernebiyasak at gmail.com> wrote:
> >
> > This patch makes buildman create linked working trees instead of clones
> > of the source repository, but keeps updating the older clones of the
> > repository that might already exist. These worktrees share "everything
> > except working directory specific files such as HEAD, index, etc." with
> > the source repository. See the git-worktree(1) manual page for more
> > information.
> >
> > If git-worktree isn't available, silently falls back to cloning the
> > repository.
> >
> > Signed-off-by: Alper Nebi Yasak <alpernebiyasak at gmail.com>
> > ---
> > I used 'git worktree list's return code, since 'git worktree' returns
> > non-zero (prints usage) even if it's available.
> >
> > This does fall back to git clone on my Ubuntu 14.04 amd64 VM, but all
> > the builds instantly give an error about the Makefile even before this
> > patch. The buildman parts are working as far as I can tell.
> >
> > Changes in v2:
> > - Fall back to cloning if git-worktree isn't available
> > - Add a gitutil.CheckWorktreeIsAvailable(git_dir) function
> > - Refactor the _PrepareThread changes
> > - Make _PrepeareThread's setup_git argument accept 'clone' or 'worktree'
> > - Some comment and docstring changes
> >
> > v1: https://patchwork.ozlabs.org/project/uboot/list/?series=199060
> >
> > tools/buildman/builder.py | 48 ++++++++++++++++++++++++++++++-------
> > tools/buildman/func_test.py | 2 ++
> > tools/patman/gitutil.py | 42 ++++++++++++++++++++++++++++++++
> > 3 files changed, 84 insertions(+), 8 deletions(-)
>
> Reviewed-by: Simon Glass <sjg at chromium.org>
Tested-by: Simon Glass <sjg at chromium.org>
More information about the U-Boot
mailing list