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

5 messages from 2014-02-27 to 2014-02-28. Participants: Philip Oakley, Duy Nguyen.
Thread: https://gitlist.dev/t/35980

## Philip Oakley, 2014-02-27 16:18

Subject: How to mark a complete sub-directory assume-unchanged/skip-worktree?
Message-ID: <3A9AA61FDE124808AA25DE3511CF99F1@PhilipOakley>
URL: https://gitlist.dev/e/3A9AA61FDE124808AA25DE3511CF99F1%40PhilipOakley

```
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, 2014-02-27 23:26

Subject: Re: How to mark a complete sub-directory assume-unchanged/skip-worktree?
Message-ID: <CACsJy8DV2uCQbfCP=Mf2qajVAtpTZvKKeCS2H4_o6LA3B96QAA@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8DV2uCQbfCP%3DMf2qajVAtpTZvKKeCS2H4_o6LA3B96QAA%40mail.gmail.com
In-Reply-To: <3A9AA61FDE124808AA25DE3511CF99F1@PhilipOakley>

```
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, 2014-02-27 23:38

Subject: Re: How to mark a complete sub-directory assume-unchanged/skip-worktree?
Message-ID: <DAC4EA00279649D6B3F4DB1B3D662BA6@PhilipOakley>
URL: https://gitlist.dev/e/DAC4EA00279649D6B3F4DB1B3D662BA6%40PhilipOakley
In-Reply-To: <CACsJy8DV2uCQbfCP=Mf2qajVAtpTZvKKeCS2H4_o6LA3B96QAA@mail.gmail.com>

```
From: "Duy Nguyen" <pclouds@gmail.com>
> 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, 2014-02-28 00:58

Subject: Re: How to mark a complete sub-directory assume-unchanged/skip-worktree?
Message-ID: <CACsJy8BJRixFno=Mb-3PGi-+JTq6RO19GdkveGdApdW8G9nKNQ@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8BJRixFno%3DMb-3PGi-%2BJTq6RO19GdkveGdApdW8G9nKNQ%40mail.gmail.com
In-Reply-To: <DAC4EA00279649D6B3F4DB1B3D662BA6@PhilipOakley>

```
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, 2014-02-28 08:37

Subject: Re: How to mark a complete sub-directory assume-unchanged/skip-worktree?
Message-ID: <96570BB66BDF4E96B2A967CF9E5842A8@PhilipOakley>
URL: https://gitlist.dev/e/96570BB66BDF4E96B2A967CF9E5842A8%40PhilipOakley
In-Reply-To: <CACsJy8BJRixFno=Mb-3PGi-+JTq6RO19GdkveGdApdW8G9nKNQ@mail.gmail.com>

```
From: "Duy Nguyen" <pclouds@gmail.com>
> 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 

```
