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

Re: [PATCH 1/2] sparse checkout: show error messages when worktree shaping fails

From
Joshua Jensen <jjensen@workspacewhiz.com>
Date
Sep 21, 2011, 19:15 UTC
Message-ID
<4E7A37D1.1020501@workspacewhiz.com>
In-Reply-To
<1316602259-22576-1-git-send-email-pclouds@gmail.com>
----- Original Message -----
From: Nguyễn Thái Ngọc Duy
Date: 9/21/2011 4:50 AM
Show 13 quoted lines
>   			if (ce->ce_flags&  CE_ADDED&&
>   			verify_absent(ce, ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN, o))
> -					return -1;
> +				goto return_failed;
>
> -			if (apply_sparse_checkout(ce, o)) {
> -				ret = -1;
> -				goto done;
> -			}
> +			if (apply_sparse_checkout(ce, o))
> +				goto return_failed;
>   			if (!ce_skip_worktree(ce))
>   				empty_worktree = 0;

Unfortunately, this patch only collects and displays the first untracked file for me. It does not display all of the files that would be overwritten (desired behavior, IMHO).

This script illustrates:
#!/bin/sh

rm -Rf utest || exit 1 mkdir utest || exit 1 cd utest || exit 1 git init git config core.sparseCheckout true echo *>.git/info/sparse-checkout echo tracked>a git add a git commit -m a a git branch side echo tracked>b echo tracked>c git add b c git commit -m bc cat b git checkout side cat b echo untracked>b echo untracked>c cat b git checkout master cat b

-Josh
Next: Junio C Hamano
Message 1 of 5 in “Re: [PATCH 1/2] sparse checkout: show error messages when worktree shaping fails”
  1. Joshua JensenSep 21, 2011
  2. Junio C HamanoSep 21, 2011
  3. 1/2 sparse checkout: show error messages when worktree shaping failsNguyễn Thái Ngọc Duy, Sep 22, 2011
  4. Joshua JensenSep 22, 2011
  5. 2/2 Add explanation why we do not allow to sparse checkout to empty working treeNguyễn Thái Ngọc Duy, Sep 22, 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.