When third-party tools need to access to contents of blobs in the
database, they might be more interested in the worktree version than in
the "clean" version of said contents.
This branch introduces the --filters option to make that happen, the
--use-path option to provide the path separately if the blob name rather
than the tree name is availale, and offers batch support in which case
it expects the object names and the path on its input lines, separated
by white space.
The new --filters option is an obvious sibling of --textconv, and shares
the peculiar feature that the drivers (and end-of-line convention) are
determined from the current worktree, not from the attributes stored in
the revision that may have been part of the object name.
As --textconv is so similar to --filters, it was taught to understand
the --use-path option and it was made compatible with batch mode, too.
I briefly considered teaching the batch mode to extract the path from
object names if they are specified as <tree-ish>:<path>. The changes
would be quite intrusive, though, and uglify the code substanitially. So
I decided against that.
Johannes Schindelin (4):
cat-file: fix a grammo in the man page
cat-file: introduce the --filters option
cat-file --textconv/--filters: allow specifying the path separately
cat-file: support --textconv/--filters in batch mode
Documentation/git-cat-file.txt | 40 ++++++++++++----
builtin/cat-file.c | 106 +++++++++++++++++++++++++++++++++++++----
t/t8010-cat-file-filters.sh | 57 ++++++++++++++++++++++
3 files changed, 185 insertions(+), 18 deletions(-)
create mode 100755 t/t8010-cat-file-filters.sh
Fetch-It-Via: git fetch https://github.com/dscho/git cat-file-filters-v1
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