From: Joshua Jensen Date: Wed, 21 Sep 2011 19:15:29 GMT Subject: Re: [PATCH 1/2] sparse checkout: show error messages when worktree shaping fails 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 > 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