threads / discuss / 35980

How to mark a complete sub-directory assume-unchanged/skip-worktree?

Subject: How to mark a complete sub-directory assume-unchanged/skip-worktree?

## tl;dr

5 messages between Feb 27, 2014 and Feb 28, 2014.

replies: 4people: 2as markdown or json

Philip Oakley· Feb 27, 2014, 16:18 UTC · lore

I'm having a long think (sickness R&R) about the possible options for a narrow clone implementation.

Is there currently any way in the code base that a complete sub-directory can be marked as 'missing' as could be the case for a narrow clone? The assume-unchanged/skip-worktree are close but only applies to filepaths/blobs, rather than trees.

At the moment 'Cached tree' index extension does list the sha1 for unchanged sub-drectories for ease of creating tree's for new commits, but I couldn't see if it could be (ab)used to support a narrow clone.

Have there been previous attempts to look at marking sub-dirs as --skip-worktree, or some other sentinel value for the missing tree?

--- Philip Oakley

Duy Nguyen· Feb 27, 2014, 23:26 UTC · re: Philip Oakley · lore

Re: How to mark a complete sub-directory assume-unchanged/skip-worktree?

On Fri, Feb 28, 2014 at 12:25 AM, Philip Oakley <philipoakley@iee.org> wrote:
> Have there been previous attempts to look at marking sub-dirs as
> --skip-worktree, or some other sentinel value for the missing tree?

I dealt with this by creating partial index, that only contains entries for interested subtrees. The index also stores the base tree SHA-1, so write-tree can still create (full) new trees correctly from partial index.

-- 
Duy
Philip Oakley· Feb 27, 2014, 23:38 UTC · re: Duy Nguyen · lore

Re: How to mark a complete sub-directory assume-unchanged/skip-worktree?

From: "Duy Nguyen" <pclouds@gmail.com>
Show 11 quoted lines
> On Fri, Feb 28, 2014 at 12:25 AM, Philip Oakley <philipoakley@iee.org> 
> wrote:
>> Have there been previous attempts to look at marking sub-dirs as
>> --skip-worktree, or some other sentinel value for the missing tree?
>
> I dealt with this by creating partial index, that only contains
> entries for interested subtrees. The index also stores the base tree
> SHA-1, so write-tree can still create (full) new trees correctly from
> partial index.
> -- 
> Duy

Is there a particular bit of code I'd be worth studying for the partial index example to see how well it might fit my ideas?

-- Philip

Duy Nguyen· Feb 28, 2014, 00:58 UTC · re: Philip Oakley · lore

Re: How to mark a complete sub-directory assume-unchanged/skip-worktree?

On Fri, Feb 28, 2014 at 6:46 AM, Philip Oakley <philipoakley@iee.org> wrote:
> Is there a particular bit of code I'd be worth studying for the partial
> index example to see how well it might fit my ideas?

My last attempt was http://git.661346.n2.nabble.com/PATCH-00-17-Narrow-clone-v3-was-subtree-clone-tt5499879.html If you're interested in the index part then see 15/17 and maybe 03/17 and 04/17. I can try to rebase and publish the series somewhere if you want to try it out.

-- 
Duy
Philip Oakley· Feb 28, 2014, 08:37 UTC · re: Duy Nguyen · lore

Re: How to mark a complete sub-directory assume-unchanged/skip-worktree?

From: "Duy Nguyen" <pclouds@gmail.com>
Show 14 quoted lines
> On Fri, Feb 28, 2014 at 6:46 AM, Philip Oakley <philipoakley@iee.org> 
> wrote:
>> Is there a particular bit of code I'd be worth studying for the 
>> partial
>> index example to see how well it might fit my ideas?
>
> My last attempt was
> http://git.661346.n2.nabble.com/PATCH-00-17-Narrow-clone-v3-was-subtree-clone-tt5499879.html
> If you're interested in the index part then see 15/17 and maybe 03/17
> and 04/17. I can try to rebase and publish the series somewhere if you
> want to try it out.
> -- 
> Duy
> --

Thanks for that pointer. I'll look it out and see how well it matched my ideas, and reflect on any differences to pick up learning points early!

Philip 

← back to recent threads