mktree --batch: build more than one tree object

This option works in a similar way to the '--batch' option of 'git cat-file'.
It enables creation of many tree objects with a single process.

The change was motivated by performance considerations in applications that
need to create many tree objects. A non-rigorous test showed tree creation
times improved from (roughly) 200ms to 50ms.

Signed-off-by: Josh Micich <josh.micich@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Josh Micich
2009-05-14 12:51:15 -07:00
committed by Junio C Hamano
parent e01662bb5d
commit f1cf2d8b14
2 changed files with 40 additions and 8 deletions

View File

@ -8,7 +8,7 @@ git-mktree - Build a tree-object from ls-tree formatted text
SYNOPSIS
--------
'git mktree' [-z] [--missing]
'git mktree' [-z] [--missing] [--batch]
DESCRIPTION
-----------
@ -28,6 +28,12 @@ OPTIONS
object. This option has no effect on the treatment of gitlink entries
(aka "submodules") which are always allowed to be missing.
--batch::
Allow building of more than one tree object before exiting. Each
tree is separated by as single blank line. The final new-line is
optional. Note - if the '-z' option is used, lines are terminated
with NUL.
Author
------
Written by Junio C Hamano <gitster@pobox.com>