Thread (192 messages) flat view 192 messages, 22 authors, 2016-08-11

Re: [RFC] Submodules in GIT

From: Shawn Pearce <hidden>
Date: 2016-08-11 19:50:26

Andy Parkins [off-list ref] wrote:
I think I've talked myself into the position where it definitely has to be 
HEAD being tracked in the submodules; anything else is a disaster waiting to 
happen because commit doesn't check in your current tree.
Yes, but not only that, HEAD is the only thing that fits with the
rest of the git repository/index/working directory model.

Lets review...

What's HEAD?  Its the commit which matches the index state as
closely as possible, with the only differences being the changes in
progress that are being prepared for the next commit (whose parent
will be HEAD).  If the index and working directory are both clean
(no changes) then its also the current content of this directory,
right?

What's the index?  Its what you are about to commit.

What's the working directory?  Its the current content, which may
also be partially checked out or dirty.

So HEAD in a submodule is the current content of that submodule.
Therefore any update-index call on a submodule should load HEAD
(totally ignoring whatever branch it refers to) into the supermodule
index.

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