# gc/repack has no option to lose grafted parents

4 messages from 2014-03-06 to 2014-03-07. Participants: Martin Langhoff, Junio C Hamano, Duy Nguyen.
Thread: https://gitlist.dev/t/36079

## Martin Langhoff, 2014-03-06 23:07

Subject: gc/repack has no option to lose grafted parents
Message-ID: <CACPiFCLqa=ZQM6Azh2G5hwBCMx96Cxa5BMN=-2aCy5x=YhBpGg@mail.gmail.com>
URL: https://gitlist.dev/e/CACPiFCLqa%3DZQM6Azh2G5hwBCMx96Cxa5BMN%3D-2aCy5x%3DYhBpGg%40mail.gmail.com

```
Back in http://git.661346.n2.nabble.com/PATCH-0-2-Make-git-gc-more-robust-with-regard-to-grafts-td3310281.html
we got gc/repack to be safer for users who might be shooting
themselves in the foot.

Would a patch be welcome to add --discard-grafted-objects ? or
--keep-real-parents=idontthinkso ?

cheers,



m
-- 
 martin.langhoff@gmail.com
 -  ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 ~ http://docs.moodle.org/en/User:Martin_Langhoff

```

## Junio C Hamano, 2014-03-06 23:26

Subject: Re: gc/repack has no option to lose grafted parents
Message-ID: <xmqqwqg6vrht.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqqwqg6vrht.fsf%40gitster.dls.corp.google.com
In-Reply-To: <CACPiFCLqa=ZQM6Azh2G5hwBCMx96Cxa5BMN=-2aCy5x=YhBpGg@mail.gmail.com>

```
Martin Langhoff <martin.langhoff@gmail.com> writes:

> Back in http://git.661346.n2.nabble.com/PATCH-0-2-Make-git-gc-more-robust-with-regard-to-grafts-td3310281.html
> we got gc/repack to be safer for users who might be shooting
> themselves in the foot.
>
> Would a patch be welcome to add --discard-grafted-objects ? or
> --keep-real-parents=idontthinkso ?
>
> cheers,

Given that we in general frown upon long-term use of grafts (or
"replace" for that matter), I am not sure if we want to go in that
direction.

Just a knee-jerk reaction, though.

```

## Martin Langhoff, 2014-03-06 23:36

Subject: Re: gc/repack has no option to lose grafted parents
Message-ID: <CACPiFCLgoGP59sW73YFCt8Wq4hpxZUb0PBF-DzHz0JdxrYo4rw@mail.gmail.com>
URL: https://gitlist.dev/e/CACPiFCLgoGP59sW73YFCt8Wq4hpxZUb0PBF-DzHz0JdxrYo4rw%40mail.gmail.com
In-Reply-To: <xmqqwqg6vrht.fsf@gitster.dls.corp.google.com>

```
On Thu, Mar 6, 2014 at 6:26 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Given that we in general frown upon long-term use of grafts (or
> "replace" for that matter), I am not sure if we want to go in that
> direction.
>
> Just a knee-jerk reaction, though.

Fair enough.

If I state my actual goals -- discarding old, uninteresting history,
in a "rolling" fashion? (periodically using a script that says "forget
anything older than one month") -- is there a better way?

The repository is not standalone, it receives pushes from hundreds of
clients, and gets pulled from a couple of clients. All clients are "in
sync", in that will be pulling every hour (vs a "time window" of one
month).

At this stage, and with careful management (ie: custom gc scripts) git
makes for an excellent async log/report transfer tool. We specially
appreciate that it has "deep buffer".

cheers,



m
-- 
 martin.langhoff@gmail.com
 -  ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 ~ http://docs.moodle.org/en/User:Martin_Langhoff

```

## Duy Nguyen, 2014-03-07 00:47

Subject: Re: gc/repack has no option to lose grafted parents
Message-ID: <CACsJy8BrnKPu=Uf5Qy1KoccorBJ43yo+R9P3PyVAeNU9FuCy6Q@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8BrnKPu%3DUf5Qy1KoccorBJ43yo%2BR9P3PyVAeNU9FuCy6Q%40mail.gmail.com
In-Reply-To: <CACPiFCLgoGP59sW73YFCt8Wq4hpxZUb0PBF-DzHz0JdxrYo4rw@mail.gmail.com>

```
On Fri, Mar 7, 2014 at 6:36 AM, Martin Langhoff
<martin.langhoff@gmail.com> wrote:
> On Thu, Mar 6, 2014 at 6:26 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Given that we in general frown upon long-term use of grafts (or
>> "replace" for that matter), I am not sure if we want to go in that
>> direction.
>>
>> Just a knee-jerk reaction, though.
>
> Fair enough.
>
> If I state my actual goals -- discarding old, uninteresting history,
> in a "rolling" fashion? (periodically using a script that says "forget
> anything older than one month") -- is there a better way?

Convert it to a shallow repository? Either you clone it and do "fetch
--depth=XXX && prune", or you manipulate $GIT_DIR/shallow directly
then prune (no worse than editing grafts, I think).
-- 
Duy

```
