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

Re: Git 1.7.6: Sparse checkouts do not work with directory exclusions

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Sep 20, 2011, 14:38 UTC
Message-ID
<4E78A558.6090903@drmicha.warpmail.net>
In-Reply-To
<4E77BC36.7060005@workspacewhiz.com>
Joshua Jensen venit, vidit, dixit 20.09.2011 00:03:
Show 38 quoted lines
> Sometime after Git 1.7.3.2, sparse checkouts stopped working for me.  My 
> sparse-checkout file looks something like:
> 
> *
> !DirA/
> !DirB/
> DirC/
> 
> I have restored some lines of code that were removed in November 2010.  
> This resolves the sparse checkout issue for me, but my guess is the 
> solution is not implemented properly.
> 
> Can anyone confirm the issue and describe why those lines were removed?
> 
> Thanks.
> 
> Josh
> 
> ---
>   dir.c |    5 ++++-
>   1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/dir.c b/dir.c
> index 6e4494e..3f057b6 100644
> --- a/dir.c
> +++ b/dir.c
> @@ -507,7 +507,10 @@ int excluded_from_list(const char *pathname,
>               int to_exclude = x->to_exclude;
> 
>               if (x->flags & EXC_FLAG_MUSTBEDIR) {
> -                if (*dtype == DT_UNKNOWN)
> +                if (!prefixcmp(pathname, exclude) &&
> +                    pathname[x->patternlen] == '/')
> +                    return to_exclude;
> +                else if (*dtype == DT_UNKNOWN)
>                       *dtype = get_dtype(NULL, pathname, pathlen);
>                   if (*dtype != DT_DIR)
>                       continue;
That code was in git only between
c84de70 (excluded_1(): support exclude files in index, 2009-08-20)
and
9e08273 (Revert "excluded_1(): support exclude files in index", 2010-11-27)
i.e. after v1.6.4 and before v1.7.3.2
Ccing Duy who will know more.
Michael
Previous: Joshua Jensen
Message 4 of 4 in “Git 1.7.6: Sparse checkouts do not work with directory exclusions”
  1. Joshua JensenSep 19, 2011
  2. Nguyen Thai Ngoc DuySep 20, 2011
  3. Joshua JensenSep 20, 2011
  4. Michael J GruberSep 20, 2011

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.