[Bro-Dev] "git diff" questions

Gregor Maier gregor at icir.org
Wed Jul 20 17:33:35 PDT 2011


This is a, rather annoying, effect of using git submodules. aux/broccoli 
just points to a particular commit in the broccoli repository. Different 
topic branches in the main bro repository can point to different commits 
of submodules. This mostly happens if you are working / looking at a 
branch that was branched off master a while ago and the submodule 
pointer in master has then been updated.

 > (1)  Why is it finding a difference?

For some reason that I don't understand, a git checkout does not check 
out the appropriate commit of the submodules. It rather leaves the 
submodules untouched. In order to also do a checkout of the submodules 
you need to do a

git submodule update --recursive

On 7/20/11 15:43 , Vern Paxson wrote:
> On a checkout for which I haven't touched aux/broccoli, if I issue "git diff"
> it tells me:
>
> 	diff --git a/aux/broccoli b/aux/broccoli
> 	index 9866a00..8843da5 160000
> 	--- a/aux/broccoli
> 	+++ b/aux/broccoli
> 	@@ -1 +1 @@
> 	-Subproject commit 9866a00e78b088315e632960aaa230635bca326a
> 	+Subproject commit 8843da57dc8aee433550727dcbd1199824ca9da4

Assuming that you were in "master" and did a check-out of "topic/foobar" 
the above diff indicates that
master uses commit 9866a00.... of broccoli but that
foobar uses commit 8843da5.... of broccoli


hth
Gregor
-- 
Gregor Maier
<gregor at icir.org>  <gregor at icsi.berkeley.edu>
Int. Computer Science Institute (ICSI)
1947 Center St., Ste. 600
Berkeley, CA 94704, USA
http://www.icir.org/gregor/


More information about the bro-dev mailing list