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

Negative patterns in cone mode

From
BCBrown, Chris <chris.c.brown@siemens.com>
Date
Apr 4, 2023, 12:00 UTC
Message-ID
<GVXPR10MB8199D186532A7A285CCF1538B9939@GVXPR10MB8199.EURPRD10.PROD.OUTLOOK.COM>
Hi all,
I'm facing an issue with negative patterns in cone mode. I can't tell from the docs or git code if I misunderstand the usage, am trying something not supported, or if there is a bug.
What I want to do is exclude a small number of directories (and their subdirectories) from a large repo, without explicitly declaring all the other directories that I wish to keep.
My directory structure is:
root
^----A
        ^----B
        ^----C

My sparse-checkout file is: /* !/A/B/

I've set up an MRE:
1. git clone --sparse https://github.com/peakschris/sparse.git
2. cd sparse
3. copy sparse-checkout.txt .git\info\sparse-checkout
4. git sparse-checkout reapply

Output: git sparse-checkout reapply warning: unrecognized negative pattern: '/A/B' warning: disabling cone pattern matching warning: unrecognized negative pattern: '/A/B' warning: disabling cone pattern matching

Thanks! Chris
Next: Rudy Rigot
Message 1 of 3 in “Negative patterns in cone mode”
  1. Brown, ChrisApr 4, 2023
  2. Rudy RigotApr 8, 2023
  3. Brown, ChrisApr 8, 2023

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.