From: Dmitry Potapov <dpotapov@gmail.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Brian Foster <brian.foster@innova-card.com>, git@vger.kernel.org
Subject: Re: fsck --full is Ok, but clones are not, "missing commits"?!
Date: Wed, 16 Apr 2008 20:17:42 +0400 [thread overview]
Message-ID: <20080416161742.GC3133@dpotapov.dyndns.org> (raw)
In-Reply-To: <48061388.6090705@viscovery.net>
On Wed, Apr 16, 2008 at 04:56:08PM +0200, Johannes Sixt wrote:
>
> No. The reason why git clone'd repositories have problems is that
> git-upload-pack sends a pack that does not contain the hidden objects; but
> since the cloned repository doesn't have the info/grafts, it tries to look
> up the hidden, now missing, objects, and fails.
In my experiment, there was no problem with hidden commits and objects
as long as they presented in the original repository. Maybe, it is
because I cloned it as locally using:
git clone PATH-TO-ORIG-REPO PATH-TO-DEST-REPO
Maybe things would be as you say if I used git://
>
> Actually, no. The trouble is that *all* tools obey grafts. Hence,
> git-repack -f -d -a will remove the hidden objects. But a subsequent fsck
> won't notice, because it *also* obeys the grafts. git prune will remove
> hidden objects only as long as they are loose; if they are already packed,
> then only a repack -f will remove them.
I use git 1.5.5 and I have a script that creates are repo with a hidden
commit and then it cleans the reflog cleaned (as it would be happen after
expiration of gc.reflogExpire). Then I run 'git-repack -f -d -a' and the
hidden commit still presents, but when I run 'git prune' then the hidden
object disappear. You can try it for yourself. Here is the script, I used:
===
#!/bin/sh
set -e
mkdir t5
cd t5
git init
echo 1 > foo
git add foo
git commit -m 'add foo'
R1=$(git rev-parse HEAD)
echo 2 >> foo
git commit -m 'edit foo' -a
R2=$(git rev-parse HEAD)
echo 3 >> foo
git commit -m 'edit foo again' -a
R3=$(git rev-parse HEAD)
set -x
git log
echo "$R3 $R1" > .git/info/grafts
git log
git-fsck --unreachable
: > .git/logs/HEAD
: > .git/logs/refs/heads/master
git-fsck --unreachable
git gc
git-fsck --unreachable
git-repack -f -d -a
git-fsck --unreachable
git prune
git-fsck --unreachable
===
Dmitry
next prev parent reply other threads:[~2008-04-16 16:18 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200804161334.17748.brian.foster@innova-card.com>
2008-04-16 11:48 ` Re: Re: fsck --full is Ok, but clones are not, "missing commits"?! Brian Foster
2008-04-16 12:14 ` Dmitry Potapov
2008-04-16 14:59 ` Petr Baudis
2008-04-16 16:23 ` Dmitry Potapov
2008-04-16 13:22 ` Johannes Sixt
2008-04-16 14:25 ` Dmitry Potapov
2008-04-16 14:56 ` Johannes Sixt
2008-04-16 16:17 ` Dmitry Potapov [this message]
2008-04-16 16:47 ` Jakub Narebski
2008-04-17 6:18 ` Johannes Sixt
[not found] <20080506115224.79802c7c@zebulon.innova-card.com>
2008-05-06 12:17 ` Johannes Sixt
[not found] <200804171756.39911.brian.foster@innova-card.com>
2008-04-17 18:44 ` Brian Foster
[not found] <200804161626.44174.brian.foster@innova-card.com>
2008-04-16 15:04 ` Brian Foster
2008-04-16 15:22 ` Johannes Sixt
2008-04-16 16:11 ` Brandon Casey
[not found] ` <200804171643.15504.brian.foster@innova-card.com>
2008-04-17 14:53 ` Brian Foster
2008-04-17 15:41 ` Brandon Casey
[not found] ` <200804180943.20933.brian.foster@innova-card.com>
2008-04-18 8:41 ` Brian Foster
2008-04-18 8:55 ` Johannes Sixt
[not found] ` <200804181114.47067.brian.foster@innova-card.com>
2008-04-18 9:29 ` Brian Foster
2008-04-16 17:15 ` Dmitry Potapov
[not found] <20080416062925.8028e952@zebulon.innova-card.com>
2008-04-16 6:37 ` Brian Foster
2008-04-16 9:14 ` David Kastrup
2008-05-05 4:25 ` Bryan Donlan
[not found] ` <200805051608.55200.brian.foster@innova-card.com>
2008-05-05 14:44 ` Brian Foster
2008-05-05 15:12 ` Johannes Sixt
[not found] ` <200805061231.30135.brian.foster@innova-card.com>
2008-05-06 10:58 ` Brian Foster
2008-05-06 11:12 ` Johannes Sixt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080416161742.GC3133@dpotapov.dyndns.org \
--to=dpotapov@gmail.com \
--cc=brian.foster@innova-card.com \
--cc=git@vger.kernel.org \
--cc=j.sixt@viscovery.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).