OSDN Git Service

cat-file --textconv/--filters: allow specifying the path separately
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 9 Sep 2016 10:10:50 +0000 (12:10 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 11 Sep 2016 21:48:15 +0000 (14:48 -0700)
commit7bcf341453572a227036afec76bdab451b798870
tree44bf23805839bd2af79a0f33ede751b15821c217
parentb9e62f60115c75c5be5de593862925c8b8d7e683
cat-file --textconv/--filters: allow specifying the path separately

There are circumstances when it is relatively easy to figure out the
object name for a given path, but not the name of the containing tree.
For example, when looking at a diff generated by Git, the object names
are recorded, but not the revision. As a matter of fact, the revisions
from which the diff was generated may not even exist locally.

In such a case, the user would have to generate a fake revision just to
be able to use --textconv or --filters.

Let's simplify this dramatically, because we do not really need that
revision at all: all we care about is that we know the path. In the
scenario described above, we do know the path, and we just want to
specify it separately from the object name.

Example usage:

git cat-file --textconv --path=main.c 0f1937fd

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-cat-file.txt
builtin/cat-file.c
t/t8010-cat-file-filters.sh