On Mon, Aug 17, 2009 at 4:16 PM, Johannes Schindelin<Johannes.Schindelin@xxxxxx> wrote: > Hi, > > On Mon, 17 Aug 2009, skillzero@xxxxxxxxx wrote: > >> On Mon, Aug 17, 2009 at 3:02 PM, Johannes >> Schindelin<Johannes.Schindelin@xxxxxx> wrote: >> >> > And here comes the problem: if something is treated untracked because >> > it was outside of the sparse checkout, then I want it to be treated as >> > untracked _even if_ I happened to broaden the checkout by editing >> > .git/info/sparse. The file did not just magically become subject to >> > overwriting just because I edited .git/info/sparse (which could be a >> > simple mistake). >> >> Maybe I'm misunderstanding what you're saying, but why would you want a >> file that's become part of the checkout by editing .git/info/sparse to >> still be treated as untracked? >> >> If I have a file on that's excluded via .git/info/sparse then I edit >> .git/info/sparse to include it and switch to a branch that doesn't have >> that file, I'd expect that file to be deleted from the working copy if >> the content matches what's in the repository. If it's modified then I'd >> expect the branch switch to fail (like it would without a sparse >> checkout). > > First things first: with sparse checkout, you should not check out > _anything_ outside of the focus of the sparse checkout. > > So I contend that you would only end up with a sparse'd-out file > that was formerly tracked if you did something wrong. That should not > happen. I was thinking if you copied the file there manually and changed .git/info/sparse to include it. I would expect git checkout, git status, etc. to act as just as if I had never excluded it via .git/info/sparse, similar to .gitignore and .git/info/exclude. > The thing is: we need a way to determine quickly and without any > ambiguity whether a file is tracked, assumed unchanged, or sparse'd-out > (which Nguyễn calls no-checkout). > > And if we change .git/info/sparse, that state _must not_ change. We did > not touch the file by editing .git/info/sparse, so the state must be > unchanged. I don't know enough to have an opinion on assume-unchanged vs no-checkout, but if you edit .git/info/sparse it seems like it should affect whether git cares about a file or not. If a file previously had the no-checkout bit and you change .git/info/sparse to include the file, the next time you do something with git, I would expect it to start caring about that path. For example, I can edit .gitignore and .git/info/exclude and it notices the next time I use git without having to do anything special. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html