git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to update a submodule?
@ 2010-12-31 22:24 Oliver Kullmann
  2010-12-31 23:42 ` Seth Robertson
  0 siblings, 1 reply; 7+ messages in thread
From: Oliver Kullmann @ 2010-12-31 22:24 UTC (permalink / raw)
  To: git

Hello,

it would be very helpful if somebody could tell me the
supposed workflow how to update a submodule (I'm using version
1.7.3.2; the man-page doesn't say much about it).

I have on the same machine two versions of repository A,
say A1, A2, and both contain repository B as submodule, but are otherwise
unrelated.

In A1 we have B up-to-date, but not in A2 (and with up-to-date I mean
the master branch in the same state as in A1).

git submodule update

is of no help, since A1, A2 have no relation to each other, and "update"
assumes some relation; the man-page doesn't speak of options for update,
and since "git submodule update" runs through all submodules, it's hard
to see how that could work.

So I have to go into B in A2, and do some pull (I suppose), but that
doesn't work so easily; the man-page seems to speak of B in A2 is a "normal repository"
but that doesn't seem to be the case in the sense that by default 
we are on "no branch". So it seems one can't do anything there, since 
you can't merge "no branch" into some other branch. The branch "no branch"
is up-to-date after a pull, but this can't be communicated to the other
branches (so seems to be misleading, or a waste of time).

So apparently I have to checkout master in A2:B, and then pull from
master in A1:B ?

Would be good if somebody could shed light on this.

In general I find that "pull" is much under-documented in git.
What I would like to do in A2 is just to say "pull everything from A1",
which seems a logical thing to do, and which should include all corresponding
branches and all corresponding submodules, but such a "pull all" doesn't
seem to exist?

Thanks for your help in any case!

Oliver

P.S. What would be really needed for the Git documentation is to speak
about the fundamental ideas, about the "mental images".

The submodule documentation starts with a blurb-sentence which I would
regard as misleading.
Then comes a paragraph about what it is not.
Then comes some hints regarding the implementation.
Then the final paragraph seems to indicate that above I could just
use "git pull A2" for A1, and would get B in A2 from B in A1, but only not checked out?
This doesn't seem to be the case, since apparently then "git submodule update"
tries to fetch from some foreign repository (not just checking out what was fetched before)?

Adding here examples for a complete workflow (perhaps with various stages, but without
complications(!)), from initialisation to updates from other repositories would be
very helpful.

As you can see, I don't know what to expect, and so I don't know what are errors in
the usage, and what is supposed to be. No mental image about "submodule" is offered,
and I don't know what is its intention. A great thing would be using the computer-science
concept of an abstract data type, so to explain what the interface and its semantics is,
not what is the implementation.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-01-02 17:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-31 22:24 how to update a submodule? Oliver Kullmann
2010-12-31 23:42 ` Seth Robertson
2011-01-01 20:39   ` Oliver Kullmann
2011-01-02 11:30     ` Jens Lehmann
2011-01-02 15:55       ` Oliver Kullmann
2011-01-02 17:30         ` Jens Lehmann
2011-01-02 17:57           ` Jonathan Nieder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).