threads / bug / 24642

BUG! missing .idx causes .pack to be removed

Subject: BUG! missing .idx causes .pack to be removed

## tl;dr

4 messages between Aug 5, 2010 and Aug 13, 2010.

replies: 3people: 3as markdown or json

Enrico Weigelt· Aug 5, 2010, 17:01 UTC · lore
Hi folks,

while doing some experiments I've removed the *.idx files and ran git-repack - that complained about missing objects and removed all *.pack files !

I'm sure that's a bug - an ugly one ;-o
cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
Tay Ray Chuan· Aug 6, 2010, 03:24 UTC · re: Enrico Weigelt · lore

Re: BUG! missing .idx causes .pack to be removed

Hi,
On Fri, Aug 6, 2010 at 1:01 AM, Enrico Weigelt <weigelt@metux.de> wrote:
Show 5 quoted lines
> while doing some experiments I've removed the *.idx files and
> ran git-repack - that complained about missing objects and removed
> all *.pack files !
>
> I'm sure that's a bug - an ugly one ;-o

IIRC, a .pack file is useless without its corresponding .idx file. So the removal of a .pack file makes sense here - to me, at least.

-- 
Cheers,
Ray Chuan
René Scharfe· Aug 6, 2010, 07:14 UTC · re: Tay Ray Chuan · lore

Re: BUG! missing .idx causes .pack to be removed

Am 06.08.2010 05:24, schrieb Tay Ray Chuan:
Show 11 quoted lines
> Hi,
> 
> On Fri, Aug 6, 2010 at 1:01 AM, Enrico Weigelt <weigelt@metux.de> wrote:
>> while doing some experiments I've removed the *.idx files and
>> ran git-repack - that complained about missing objects and removed
>> all *.pack files !
>>
>> I'm sure that's a bug - an ugly one ;-o
> 
> IIRC, a .pack file is useless without its corresponding .idx file. So
> the removal of a .pack file makes sense here - to me, at least.

git-index-pack can rebuild the index for a pack file. Not sure if it should be done automagically, but the file is not completely useless.

René
Enrico Weigelt· Aug 13, 2010, 16:02 UTC · re: René Scharfe · lore

Re: BUG! missing .idx causes .pack to be removed

* René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:
Show 5 quoted lines
> > IIRC, a .pack file is useless without its corresponding .idx file. So
> > the removal of a .pack file makes sense here - to me, at least.
> 
> git-index-pack can rebuild the index for a pack file.  Not sure if it
> should be done automagically, but the file is not completely useless.

ACK. packfiles are completely self-contained - the index files are only used for lookup and can be created any time (IMHO that's also done automatically on remote transfers). So removing a packfile, just because the index is missing, causes an serious data loss. That's what I'd consider a critical bug!

The correct solution would be either recreating the index automatically or at least spit out an big-fat warning.

cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------

← back to recent threads