# BUG! missing .idx causes .pack to be removed

4 messages from 2010-08-05 to 2010-08-13. Participants: Enrico Weigelt, Tay Ray Chuan, René Scharfe.
Thread: https://gitlist.dev/t/24642

## Enrico Weigelt, 2010-08-05 17:01

Subject: BUG! missing .idx causes .pack to be removed
Message-ID: <20100805170137.GA2630@nibiru.local>
URL: https://gitlist.dev/e/20100805170137.GA2630%40nibiru.local

```
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, 2010-08-06 03:24

Subject: Re: BUG! missing .idx causes .pack to be removed
Message-ID: <AANLkTi=bjM7rGSXv0eB5+6VEX=wY84upkzDcBJ6C9KdK@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTi%3DbjM7rGSXv0eB5%2B6VEX%3DwY84upkzDcBJ6C9KdK%40mail.gmail.com
In-Reply-To: <20100805170137.GA2630@nibiru.local>

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

-- 
Cheers,
Ray Chuan

```

## René Scharfe, 2010-08-06 07:14

Subject: Re: BUG! missing .idx causes .pack to be removed
Message-ID: <4C5BB64A.4070601@lsrfire.ath.cx>
URL: https://gitlist.dev/e/4C5BB64A.4070601%40lsrfire.ath.cx
In-Reply-To: <AANLkTi=bjM7rGSXv0eB5+6VEX=wY84upkzDcBJ6C9KdK@mail.gmail.com>

```
Am 06.08.2010 05:24, schrieb Tay Ray Chuan:
> 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, 2010-08-13 16:02

Subject: Re: BUG! missing .idx causes .pack to be removed
Message-ID: <20100813160221.GA10974@nibiru.local>
URL: https://gitlist.dev/e/20100813160221.GA10974%40nibiru.local
In-Reply-To: <4C5BB64A.4070601@lsrfire.ath.cx>

```
* René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:
> > 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
----------------------------------------------------------------------

```
