Thread (13 messages) 13 messages, 9 authors, 2016-06-15

Re: Can I checkout a single file without altering index?

From: Neal Kreitzinger <hidden>
Date: 2016-06-15 22:49:47

"Christian Halstrick" [off-list ref] wrote in message 
news:loom.20101014T095743-275@post.gmane.org...
Thank's a lot for all your responses. I know now how to solve my problem. 
I'll
definitely not going to commit my unit-test before my fix and publish that
because then I would have commits in the history where tests fail. But 
other
suggested solutions do work.

Still, all that sounds like workarounds for a lacking feature. Checkout 
content
to the worktree without altering the index. What do you think, couldn't 
that be
added as an option to checkout?

-- Chris
FWIW, my understanding of the index is that it is the middle-man for moving 
things from your work-tree to the object-store AND for moving things from 
the object-store to your work-tree.  Therefore, when you checkout the blob, 
it first gets copied from the object-store to your index and then from the 
index to your work-tree.

However, there is an option in git-commit to copy files directly from the 
working-tree to the object-store by totally bypassing the index, but no one 
seems to do this or recommend doing this as normative practice.  None the 
less, this "exception" in the git-commit manpage does seem to set the 
precedent, so maybe it is also conceivable to copy objects directly from the 
object-store to the work-tree by totally bypassing the index.

Please note that I am responding because I am interested in the discussion 
and not because I know the answer.  I am not a git programmer so my 
observations only symptomatic and/or theoretical as a user.

v/r,
Neal 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help