IRC discussion re: submodules & missing refs/heads/master

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Relevant transcript from IRC with jrnieder

---
06:47:09 < kent\n> I have a fun problem, somethings gone wrong with a
submodule somehow, now "git status" and friends just go "Fatal: Oops!"
06:47:39 < kent\n> Ok, no !, but thats basically what I get :/
06:48:29 < cbreak> kent\n: GIT_TRACE=1 git status ?
06:48:47 < FauxFaux> strace $(git --exec-dir)/git-status
06:50:01 < kent\n> cbreak: trace: built-in: git 'status'  , fatal: Oops
06:50:26 < kent\n> FauxFaux: doesn't work, status is a builtin, not a
command.
06:50:45 < jrnieder> kent\n: do you mean literally "fatal: Oops"?
06:50:50 < kent\n> yes. Literally.
06:50:54 < FauxFaux> kent\n: ...that's what the purpose of the $() bit is.
06:51:16 < kent\n> FauxFaux: git --exec-dir dies anyway because it doesn't
know what I'm asking it to do
06:51:17 < jrnieder> kent\n: I don't see that error message anywhere in the
source code
06:51:21 < jrnieder> what version of git are you using?
06:51:24 < FauxFaux> kent\n: Uh, --exec-path
06:51:47 < FauxFaux> Also --version, yeah.
06:51:58 < jrnieder> ah, you didn't mean literally "fatal: Oops"
06:52:02 < jrnieder> you meant "fatal: oops"
06:52:11 < FauxFaux> Yay paraphrasing.
06:52:23 < kent\n> no, it has an upper-case O for me.
06:53:02 < jrnieder> kent\n: ok, git version then?
06:53:22 < kent\n> 1.7.8.5
06:54:04 < kent\n> strace seems to tell me the problem is its looking for
the ref "head" on the submodule, but for some reason, the path when stat()
'd returns not found
06:54:06 < jrnieder> kent\n: thanks
06:55:04 < jrnieder> this code changed a bit in v1.7.9-rc1~10^2~7 (Pass a
(ref_cache *) to the resolve_gitlink_*() helper functions, 2011-12-12)
06:55:13 < kent\n> for some reason, my 'refs/heads' directory for my
submodule is empty :/
07:03:14  * kent\n looks around in his .git/refs dir and finds a bunch of
empty directories not seeming to correspond to anything


07:13:52 < kent\n> yay. managed to fix it. blew away module/${modname}/refs
, checked out a new branch in the module, deleted master, rechecked out
master, problem solved. ( wtf )
07:15:52  * kent\n has no idea why
.git/modules/${modpathtingythere}/refs/heads/master  vanished.
07:16:02 < jrnieder> kent\n: hmm
07:16:16 < jrnieder> do you have a backup of the problematic state, or can
you make it happen again?
07:16:29 < kent\n> I'm going to try, should be as easy as rm
refs/heads/master
07:16:37 < jrnieder> ok
07:17:28 < kent\n> yep, that causes the problem to return.
07:17:34 < jrnieder> excellent
07:17:55 < jrnieder> if you use git 1.7.9 or newer, are the symptoms the
same?
07:18:13 < kent\n> will give it a whirl, fortunately, have 2 boxen with
different gits =)
07:19:12 < jrnieder> (another way if you don't want to upgrade your system
copy of git is to do: "git clone git://repo.or.cz/git.git; cd git; make -j4"
and then use bin-wrappers/git from the source tree in place)
07:20:42 < jrnieder> kent\n: I have to head out now but anyway, this seems
interesting
07:20:59 < jrnieder> whether 1.7.9 fixes it or not, if you get a chance to
email git@xxxxxxxxxxxxxxx about it, that would be useful
07:21:17 < kent\n> kk. will do.
07:21:21 < jrnieder> thanks much

Digging tells me that either Git gc or git prune is stripping the
"master" file, causing the issue:

cd $ROOT/metadata/perl/

md5sum $( find ../../.git/modules/metadata/perl/ -type f ) > /tmp/pregc
git gc
md5sum $( find ../../.git/modules/metadata/perl/ -type f ) > /tmp/postgc
git prune
md5sum $( find ../../.git/modules/metadata/perl/ -type f ) > /tmp/postprune

diff3 /tmp/pregc /tmp/postgc /tmp/postprune
====1
1:4c
  4800e0911d51d4829e5650c487931108
../../.git/modules/metadata/perl/refs/heads/master
2:3a
3:3a

So it seems 1.7.8.5 is removing that file for some unknown reason.

cd $ROOT/metadata/perl
git status

# On branch master
nothing to commit (working directory clean)

cd $ROOT/

git status

fatal: Oops


Rsyncing that to a box with 1.7.9.4  , and giving it  a little path cleanup :

  sed -i 's!/var/paludis/repositories/perl-git/!/tmp/mirrorbox/!' $(
grep 'var/paludis/repositories' -R -l .  )

cd $ROOT

 git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   metadata/perl (new commits)
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	.mailmap
#	Todo.txt
#	dists.txt
#	filterchange.pl
#	fixme.pl
#	itemise_diff.pl
#	rebase.sh
#	rebase2.sh
#	rebash.sh
#	rebash2.pl
#	rebash2.pl.bak
#	scripts/gen_metadata.pl
#	ts
#	update-index.sh
no changes added to commit (use "git add" and/or "git commit -a")
[master *%] kent@katipo: /tmp/mirrorbox


( ALL GOOD )

cd $ROOT/metadata/perl

git status

git status
# On branch master
nothing to commit (working directory clean)

( ALL GOOD )

Frankly, thats just .... weird.

--
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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]