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

Re: git checkout under 1.7.6 does not properly list untracked files and aborts

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Sep 21, 2011, 09:16 UTC
Message-ID
<4E79AB5F.5020809@drmicha.warpmail.net>
In-Reply-To
<20110921085842.GA29768@duynguyen-vnpc>
Nguyen Thai Ngoc Duy venit, vidit, dixit 21.09.2011 10:58:
Show 58 quoted lines
> On Wed, Sep 21, 2011 at 10:28:59AM +0200, Michael J Gruber wrote:
>> So, I bisected it. The first bad commit is
>>
>> 9037026 (unpack-trees: fix sparse checkout's "unable to match
>> directories", 2010-11-27)
>>
>> although the real culprit may be its predecessor
>>
>> 2431afb (unpack-trees: move all skip-worktree checks back to
>> unpack_trees(), 2010-11-27)
>>
>> which does not compile:
>>
>>     CC unpack-trees.o
>> unpack-trees.c: In function 'mark_new_skip_worktree':
>> unpack-trees.c:852:75: error: 'o' undeclared (first use in this function)
>> unpack-trees.c:852:75: note: each undeclared identifier is reported only
>> once for each function it appears in
>> make: *** [unpack-trees.o] Error 1
> 
> This may help
> 
> --8<--
> diff --git a/unpack-trees.c b/unpack-trees.c
> index a6518db..a239af7 100644
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -245,13 +245,13 @@ static int check_updates(struct unpack_trees_options *o)
>  static int verify_uptodate_sparse(struct cache_entry *ce, struct unpack_trees_options *o);
>  static int verify_absent_sparse(struct cache_entry *ce, enum unpack_trees_error_types, struct unpack_trees_options *o);
>  
> -static int will_have_skip_worktree(const struct cache_entry *ce, struct unpack_trees_options *o)
> +static int will_have_skip_worktree(const struct cache_entry *ce, struct exclude_list *el)
>  {
>  	const char *basename;
>  
>  	basename = strrchr(ce->name, '/');
>  	basename = basename ? basename+1 : ce->name;
> -	return excluded_from_list(ce->name, ce_namelen(ce), basename, NULL, o->el) <= 0;
> +	return excluded_from_list(ce->name, ce_namelen(ce), basename, NULL, el) <= 0;
>  }
> 
>  static int apply_sparse_checkout(struct cache_entry *ce, struct unpack_trees_options *o)
> @@ -849,7 +849,7 @@ static void mark_new_skip_worktree(struct exclude_list *el,
>  		if (select_flag && !(ce->ce_flags & select_flag))
>  			continue;
>  
> -		if (!ce_stage(ce) && will_have_skip_worktree(ce, o))
> +		if (!ce_stage(ce) && will_have_skip_worktree(ce, el))
>  			ce->ce_flags |= skip_wt_flag;
>  		else
>  			ce->ce_flags &= ~skip_wt_flag;
> --8<--
> 
>> Duy, sorry for prodding you again.
> 
> No problem (and sorry for breaking the build). I'll also have a look
> at this problem.

Thanks. I can confirm that with the above patch, the code compiles and fails my test. So it's the earlier of the two commits which introduces this.

Michael
Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 21 of 23 in “git checkout under 1.7.6 does not properly list untracked files and aborts”
  1. Joshua JensenSep 9, 2011
  2. Joshua JensenSep 19, 2011
  3. Joshua JensenSep 19, 2011
  4. Michael J GruberSep 20, 2011
  5. Joshua JensenSep 20, 2011
  6. Michael J GruberSep 21, 2011
  7. 0/3 read-tree cleanupsMichael J Gruber, Sep 21, 2011
  8. Michael J GruberSep 21, 2011
  9. Junio C HamanoSep 21, 2011
  10. 1/3 unpack-trees: print "Aborting" to stderrMichael J Gruber, Sep 21, 2011
  11. Junio C HamanoSep 21, 2011
  12. Junio C HamanoSep 21, 2011
  13. Michael J GruberSep 22, 2011
  14. 2/3 git-read-tree.txt: language and typography fixesMichael J Gruber, Sep 21, 2011
  15. 3/3 git-read-tree.txt: correct sparse-checkout and skip-worktree descriptionMichael J Gruber, Sep 21, 2011
  16. Nguyen Thai Ngoc DuySep 21, 2011
  17. Michael J GruberSep 21, 2011
  18. Nguyen Thai Ngoc DuySep 21, 2011
  19. Michael J GruberSep 21, 2011
  20. Nguyen Thai Ngoc DuySep 21, 2011
  21. Michael J GruberSep 21, 2011
  22. Nguyen Thai Ngoc DuySep 21, 2011
  23. Nguyen Thai Ngoc DuySep 21, 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.