Here is a series of 3 patches to git-mktree in addition to the recent work done
on pu.
The first is just small fixes after the work on the '--missing' option.
The second patch adds a '--batch' option to mktree (similar to '--batch' in
cat-file) that allows multiple tree objects to be created interactively by a
single process.
Finally there are some improvements to the validation of the type of object
identified by the tree entry sha1 (previously the sha1 was only used to check
for existence, not type).
-josh
Josh Micich (3):
--missing option for mktree: re-added strbuf_release(&p_uq), Updated man page
added --batch option to mk-tree
improved validation of entry type in mktree
Documentation/git-mktree.txt | 16 ++++++++--
builtin-mktree.c | 63 +++++++++++++++++++++++++++++++----------
2 files changed, 60 insertions(+), 19 deletions(-)
Previously mktree would accept tree entries which had a mismatch between the
declared type and the actual type of object identified by the sha.
Signed-off-by: Josh Micich <redacted>
---
builtin-mktree.c | 34 +++++++++++++++++++++-------------
1 files changed, 21 insertions(+), 13 deletions(-)
This option enables creation of many tree objects with a single process
Signed-off-by: Josh Micich <redacted>
---
Documentation/git-mktree.txt | 7 ++++++-
builtin-mktree.c | 36 +++++++++++++++++++++++++++++-------
2 files changed, 35 insertions(+), 8 deletions(-)
@@ -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 -----------
@@ -25,6 +25,11 @@ OPTIONS Allow missing objects. The default behaviour (without this option) is to verify that each tree entry's sha1 identifies an existing object.+--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 ------
@@ -8,18 +8,23 @@ git-mktree - Build a tree-object from ls-tree formatted text SYNOPSIS ---------'git mktree' [-z]+'git mktree' [-z] [--missing] DESCRIPTION ------------Reads standard input in non-recursive `ls-tree` output format,-and creates a tree object. The object name of the tree object+Reads standard input in non-recursive `ls-tree` output format, and creates+a tree object. The order of the tree entries is normalised by mktree so+pre-sorting the input is not required. The object name of the tree object built is written to the standard output. OPTIONS ------- -z:: Read the NUL-terminated `ls-tree -z` output instead.+--missing::+ Allow missing objects. The default behaviour (without this option)+ is to verify that each tree entry's sha1 identifies an existing+ object. Author ------