git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Workflow for GitHub branch model interop: advice?

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 13, 2019, 10:20 UTC
Message-ID
<nycvar.QRO.7.76.6.1902131115230.41@tvgsbejvaqbjf.bet>
In-Reply-To
<CAFW+GMDA9gkih-7n=R2N_5edNK=b4X28qqPgRd7soGG160t94w@mail.gmail.com>
Hi William,
On Sat, 9 Feb 2019, William Chargin wrote:
> [...] creating a whole worktree is a bit heavy-handed.  Creating a new
> worktree for linux.git takes about 6 seconds on my laptop, which is not
> terrible considering that repository’s size, but would be nice to avoid
> if possible.
Agreed.
> It would be great if I could create a “lazy worktree” and only check out
> files actually needed for the merge.

I do use the `git worktree add --no-checkout` trick in one of my scripts to have a "super light-weight" worktree.

To make it work in your case, you'd then have to inspect the changes you want to replay, e.g. via `git log --name-only <range>` to craft an appropriate `sparse-checkout` file (but don't forget to *also* set the config variable `core.sparseCheckout`) before checking out any files. I am sure you can even automate generating that `sparse-checkout`.

> Would the partial clone feature added in v2.19 be helpful here?

I doubt it. The partial clone still needs you to know which files you want.

VFS for Git would help you here. But something tells me that you're on Linux, and there is no official VFS for Git on Linux yet.

Ciao, Johannes

Previous: William Chargin
Message 2 of 2 in “Workflow for GitHub branch model interop: advice?”
  1. William CharginFeb 10, 2019
  2. Johannes SchindelinFeb 13, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.