git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Removing unreachable objects in the presence of broken links?
@ 2012-10-28 21:21 Geert Uytterhoeven
  2012-10-28 21:34 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2012-10-28 21:21 UTC (permalink / raw)
  To: git

Hi,

I managed to have a few missing objects in my development Linux kernel
repository, which uses another Linux kernel clone as an alternate.
Fortunately nothing is lost, as all missing objects are unreachable.
Probably they were in a branch that has been rebased, and the objects existed
for a small timespan in the alternate when I tried whether a patch created
in the development tree applied cleanly.

Is there a way to force removing unreachable objects in the presence of broken
links?

"git prune" doesn't do it, as it aborts when encountering the first
missing object.
Same with "git repack -[aA]d".

"git fsck" reported
broken link from    tree 1330855dc33c1042b80d4c8ecbb6d56a19557ee8
              to    tree b6c8c53b804662d6a6435c62b6dec1612bfbeb46
broken link from    tree f182e2fa155b9684b79ff6e17159d03d4de9a773
              to    blob d41f9ed0e2aba47ef62b4b4dd211b91cfe474ff8
missing blob d41f9ed0e2aba47ef62b4b4dd211b91cfe474ff8
missing tree b6c8c53b804662d6a6435c62b6dec1612bfbeb46

"git fsck --unreachable HEAD $(git for-each-ref
--format="%(objectname)" refs/heads)"
told me about lots of unreachable objects, including the tree objects that
contain the two broken links.

BTW, every time I now do a rebase that triggers a gc (after the actual rebase
operation has completed), I end up with "(no branch)", so I have to do:
    git banch -D <branch>
    git branch <branch>
    git checkout <branch>
to get back on the branch.
This is with git version 1.7.0.4 (1:1.7.0.4-1ubuntu0.2).

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: Removing unreachable objects in the presence of broken links?
  2012-10-28 21:21 Removing unreachable objects in the presence of broken links? Geert Uytterhoeven
@ 2012-10-28 21:34 ` Andreas Schwab
  2012-10-29 19:56   ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2012-10-28 21:34 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: git

Geert Uytterhoeven <geert@linux-m68k.org> writes:

> Is there a way to force removing unreachable objects in the presence of broken
> links?

Does it help to forcibly expire the reflogs?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: Removing unreachable objects in the presence of broken links?
  2012-10-28 21:34 ` Andreas Schwab
@ 2012-10-29 19:56   ` Geert Uytterhoeven
  2012-11-11 11:15     ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2012-10-29 19:56 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: git

Hi Andreas,

On Sun, Oct 28, 2012 at 10:34 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Geert Uytterhoeven <geert@linux-m68k.org> writes:
>
>> Is there a way to force removing unreachable objects in the presence of broken
>> links?
>
> Does it help to forcibly expire the reflogs?

You mean "git reflog expire --all --expire=0"?

After that the reflog is empty, but "git gc" still fails.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: Removing unreachable objects in the presence of broken links?
  2012-10-29 19:56   ` Geert Uytterhoeven
@ 2012-11-11 11:15     ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2012-11-11 11:15 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: git

On Mon, Oct 29, 2012 at 8:56 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Sun, Oct 28, 2012 at 10:34 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>> Geert Uytterhoeven <geert@linux-m68k.org> writes:
>>
>>> Is there a way to force removing unreachable objects in the presence of broken
>>> links?
>>
>> Does it help to forcibly expire the reflogs?
>
> You mean "git reflog expire --all --expire=0"?
>
> After that the reflog is empty, but "git gc" still fails.

Although "git stash list" didn't show anything, .git/refs/stash still contained
one hash.

After running "git stash clear", "git gc" succeeded, and the object pointed to
by .git/refs/stash before was gone.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2012-11-11 11:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-28 21:21 Removing unreachable objects in the presence of broken links? Geert Uytterhoeven
2012-10-28 21:34 ` Andreas Schwab
2012-10-29 19:56   ` Geert Uytterhoeven
2012-11-11 11:15     ` Geert Uytterhoeven

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).