a few days ago, I asked how I would proceed if I'd want to rewrite git-repack.
The general consensus (Duy, Junio and Matthieu) was to not touch
git-pack-objects, but rather translate the shell version of the git-repack
to C.
I'll send a very rough patch, which still contains 2 todos, so it is not yet
feature complete. I was using the run_command api and the string-list api
a lot.
The following patch is definitle not recommended for a fine review, but
I'd still ask for feedback, whether this seems like the right approach.

Also I'd like to propose a small technical change:
I found no easy way to get a subset of files in a specific directory,
which is very easy in the shell version via * (rm 
So maybe instead of just prefixing the temporary files such as:
we could put all the temporary files in a temporary directory.
This would come handy as there already exists functions to manipulate 
a directory recursively (such as remove_dir_recursively)

That patch requires the patches of jc/parseopt-command-modes


Stefan Beller (1):
  repack: rewrite the shell script in C.

 Makefile                       |   2 +-
 builtin.h                      |   1 +
 builtin/repack.c               | 313 +++++++++++++++++++++++++++++++++++++++++
 contrib/examples/git-repack.sh | 194 +++++++++++++++++++++++++
 git-repack.sh                  | 194 -------------------------
 git.c                          |   1 +
 6 files changed, 510 insertions(+), 195 deletions(-)
 create mode 100644 builtin/repack.c
 create mode 100755 contrib/examples/git-repack.sh
 delete mode 100755 git-repack.sh


To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to