Re: IRC discussion re: submodules & missing refs/heads/master
- From
- Kent Fredric <kentfredric@gmail.com>
- Date
- Apr 18, 2012, 21:22 UTC
- Message-ID
- <CAATnKFCoE6XXTB48Mvq-ay-j-1gyxxPBUvLM+REFWHLCsrTsVQ@mail.gmail.com>
- In-Reply-To
- <20120418211426.GA6920@book.hvoigt.net>
On 19 April 2012 09:14, Heiko Voigt <hvoigt@hvoigt.net> wrote:
> From the subject I deduce that you have a some problem involving > submodules. Could you please clearly summarise what you found and > possibly provide a recipe (script snippet) how to reproduce the issue? >
The transcript was provided for context, after the transcript are details of the problem and solution.
Summarised is as follows:
on 1.7.8.5 , running "git gc" while inside a submodule path removes refs/heads/master for that submodule in ~/.git/modules , and for some reason, sub-modules still require those files to work properly at 1.7.8.5 , ( which results in 'git status' bailing with 'oops' from the main repo )
Migrating to a newer git makes the problem vanish, as the newer git uses info/refs for both the main repo and the submodule, and the presence/absense of refs/heads/master is unimportant.
Solving it is reasonably straight forward on 1.7.8.5, manually extract the SHA1 from the modules info/refs file, and inject it back into the relevant file refs/heads/master , and things return to normal.
-- Kent perl -e "print substr( \"edrgmaM SPA NOcomil.ic\\@tfrken\", \$_ * 3, 3 ) for ( 9,8,0,7,1,6,5,4,3,2 );" http://kent-fredric.fox.geek.nz