Subject: Re: [RFC PATCH] repack: rewrite the shell script in C.

From: Stefan Beller <[email-masked]>
Date: Wed, 14 Aug 2013 19:04:37 +0200

On 08/14/2013 06:49 PM, Antoine Pelisse wrote:
> On Wed, Aug 14, 2013 at 6:27 PM, Stefan Beller
> <[email-masked]> wrote:
>>  builtin/repack.c               | 410 +++++++++++++++++++++++++++++++++++++++++
>>  contrib/examples/git-repack.sh | 194 +++++++++++++++++++
>>  git-repack.sh                  | 194 -------------------
> 
> I'm still not sure I understand the trade-off here.
> 
> Most of what git-repack does is compute some file paths, (re)move
> those files and call git-pack-objects, and potentially
> git-prune-packed and git-update-server-info.
> Maybe I'm wrong, but I have the feeling that the correct tool for that
> is Shell, rather than C (and I think the code looks less intuitive in
> C for that matter).
> I'm not sure anyone would run that command a thousand times a second,
> so I'm not sure it would make a real-life performance difference.

From IRC:
<iveqy> IIRC repack is one of the most important scripts to port
<iveqy> it's one of the rare times a script is used serverside
<PjotrOrial> heh, I picked it because of its size
<iveqy> (and people want to be able to use git in chrooted enviroments
with few dependencies)

My contributions as of now are very small nit picking things just to
familiarize with the code base, most of the time supported by tools
such as static code checkers.

However I'd like to contribute to the project in a more meaningful way,
but I still have the feeling to not be completely familar with the
projects code base (heh, it sure takes time for such large projects)

So I think the best way to get a feeling for the code base is to
rewrite a shell script in C. I picked the smallest script, to have
only a little task. So I thought at least. The rewriting is larger than
originally assumed.

But apart from my blabbering, I think ivegy made a good point:
The C parts just don't rely on external things, but only libc and
kernel, so it may be nicer than a shell script. Also as it is used
serversided, the performance aspect is not negligible.

I included Jeff King, who maybe could elaborate on git-repack on the
serverside?

> 
> Last and very less important: I think it's OK to format-patch with -M,
> especially when you move a file.
> 

Noted, thanks.

> Cheers,
> Antoine

Stefan