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

Re: [RFC PATCH 0/9] Narrow/Sparse checkout round 3: "easy mode"

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Aug 17, 2008, 13:36 UTC
Message-ID
<fcaeb9bf0808170636j3c273ef9sfa55c8e432ab1293@mail.gmail.com>
In-Reply-To
<7v3al49nos.fsf@gitster.siamese.dyndns.org>
On 8/17/08, Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>  > "Nguyen Thai Ngoc Duy" <pclouds@gmail.com> writes:
>
> > ...
>
> >> The problem is "narrow rules" may change over time in a way that git
>  >> may handle it wrong. Assume that you have a directory with two files:
>  >> a and b. You first narrow checkout a (which would save the rule
>  >> "checkout a"). Then you do "git checkout b". When you update HEAD,
>  >> what should happen?
>  >
>  > I'd expect that this sequence:
>
> > ...
>
> > you can record list of pathspecs (with positive and negative) to implement
>  > that semantics, no?
>
> By the way, I was just mentioning the index extension area as a means to
>  store the rules if _you wanted to_.  I do not insist you to actually store
>  the rules, and in fact, I do not know if it is even a good idea to do so.

I was more worried about those rules getting out of control because git-checkout is not the only command that can change narrow rules. After enough commands, the rules can become a mess that you don't even want to look at them. I don't do negative rules now, but yes that's possible.

Show 16 quoted lines
>  > Ok.  We would need to use an extra bit for this.
>  >
>  > The bit 0x4000 is the last one available, so we would want to use it as
>  > "this index entry uses more bits than the traditional format" bit, and
>  > define a backward incompatible on-disk index entry format to actually
>  > record CE_NO_CHECKOUT and other flags we will invent in the future.
>  >
>  > Perhaps ondisk_cache_entry structure will have an extra "unsigned int
>  > flags2" after "flags" when that bit is on, and we can have 31 more bits in
>  > flags2, with the highest bit of flags2 signalling the presense of flags3
>  > word in the future, or something like that.
>
>
> It might make sense to do this first as a futureproof, if we really want
>  to go this route.  We can ensure that an index that does use the new flag
>  bits won't be misinterpreted by older git.

The patch is fine. Still we need to do something to prevent older git from using new index format.

-- 
Duy
Previous: Junio C HamanoNext: James Pickens
Message 8 of 10 in “Narrow/Sparse checkout round 3: "easy mode"”
  1. 0/9 Narrow/Sparse checkout round 3: "easy mode"Nguyễn Thái Ngọc Duy, Aug 15, 2008
  2. Junio C HamanoAug 16, 2008
  3. Nguyen Thai Ngoc DuyAug 17, 2008
  4. Junio C HamanoAug 17, 2008
  5. Junio C HamanoAug 17, 2008
  6. Eric RaibleAug 17, 2008
  7. Junio C HamanoAug 19, 2008
  8. Nguyen Thai Ngoc DuyAug 17, 2008
  9. James PickensAug 19, 2008
  10. Nguyen Thai Ngoc DuyAug 30, 2008

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.