All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Schindelin <johannes.schindelin@gmx.de>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Torsten Bögershausen" <tboegi@web.de>,
	"Jeff King" <peff@peff.net>
Subject: [PATCH v3 0/4] cat-file: optionally convert to worktree version
Date: Fri, 9 Sep 2016 12:10:39 +0200 (CEST)	[thread overview]
Message-ID: <cover.1473415827.git.johannes.schindelin@gmx.de> (raw)
In-Reply-To: <cover.1472041389.git.johannes.schindelin@gmx.de>

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.

Changes vs v2:

- always override unknown mode to imply 0100644, even if the user did
  not specify the --path option.


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             | 110 ++++++++++++++++++++++++++++++++++++++---
 t/t8010-cat-file-filters.sh    |  64 ++++++++++++++++++++++++
 3 files changed, 196 insertions(+), 18 deletions(-)
 create mode 100755 t/t8010-cat-file-filters.sh

Published-As: https://github.com/dscho/git/releases/tag/cat-file-filters-v3
Fetch-It-Via: git fetch https://github.com/dscho/git cat-file-filters-v3

Interdiff vs v2:

 diff --git a/builtin/cat-file.c b/builtin/cat-file.c
 index f8a3a08..4461153 100644
 --- a/builtin/cat-file.c
 +++ b/builtin/cat-file.c
 @@ -71,7 +71,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
  
  	if (!path)
  		path = obj_context.path;
 -	else if (obj_context.mode == S_IFINVALID)
 +	if (obj_context.mode == S_IFINVALID)
  		obj_context.mode = 0100644;
  
  	buf = NULL;

-- 
2.10.0.windows.1.10.g803177d

base-commit: 6ebdac1bab966b720d776aa43ca188fe378b1f4b

  parent reply	other threads:[~2016-09-09 10:11 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-18 12:46 [PATCH 0/4] cat-file: optionally convert to worktree version Johannes Schindelin
2016-08-18 12:46 ` [PATCH 1/4] cat-file: fix a grammo in the man page Johannes Schindelin
2016-08-18 16:21   ` Junio C Hamano
2016-08-18 12:46 ` [PATCH 2/4] cat-file: introduce the --filters option Johannes Schindelin
2016-08-18 15:49   ` Torsten Bögershausen
2016-08-19 12:37     ` Johannes Schindelin
2016-08-19 16:06       ` Junio C Hamano
2016-08-18 16:37   ` Junio C Hamano
2016-08-19 12:49     ` Johannes Schindelin
2016-08-19  8:57   ` Torsten Bögershausen
2016-08-19 15:00     ` Johannes Schindelin
2016-08-19 16:06       ` Junio C Hamano
2016-08-22 16:51       ` Torsten Bögershausen
2016-08-24  8:00         ` Johannes Schindelin
2016-08-18 12:46 ` [PATCH 3/4] cat-file --textconv/--filters: allow specifying the path separately Johannes Schindelin
2016-08-18 16:52   ` Junio C Hamano
2016-08-19 14:49     ` Johannes Schindelin
2016-08-19 16:11       ` Junio C Hamano
2016-08-24  7:57         ` Johannes Schindelin
2016-08-18 12:46 ` [PATCH 4/4] cat-file: support --textconv/--filters in batch mode Johannes Schindelin
2016-08-18 15:42   ` Torsten Bögershausen
2016-08-19 12:25     ` Johannes Schindelin
2016-08-19 15:06       ` Jeff King
2016-08-19 16:19         ` Junio C Hamano
2016-08-18 17:08   ` Junio C Hamano
2016-08-19 12:59     ` Johannes Schindelin
2016-08-19 14:44       ` Jeff King
2016-08-18 22:05   ` Jeff King
2016-08-18 22:47     ` Junio C Hamano
2016-08-19 13:11       ` Johannes Schindelin
2016-08-19 13:09     ` Johannes Schindelin
2016-08-19 13:22       ` Jeff King
2016-08-24 12:23 ` [PATCH v2 0/4] cat-file: optionally convert to worktree version Johannes Schindelin
2016-08-24 12:23   ` [PATCH v2 1/4] cat-file: fix a grammo in the man page Johannes Schindelin
2016-08-24 12:23   ` [PATCH v2 2/4] cat-file: introduce the --filters option Johannes Schindelin
2016-08-24 17:46     ` Junio C Hamano
2016-08-24 17:52       ` Junio C Hamano
2016-08-31 20:31       ` Johannes Schindelin
2016-08-31 20:53         ` Junio C Hamano
2016-08-24 12:23   ` [PATCH v2 3/4] cat-file --textconv/--filters: allow specifying the path separately Johannes Schindelin
2016-08-24 17:49     ` Junio C Hamano
2016-08-24 18:25       ` Junio C Hamano
2016-08-31 19:49         ` Johannes Schindelin
2016-08-31 20:17           ` Junio C Hamano
2016-08-24 12:23   ` [PATCH v2 4/4] cat-file: support --textconv/--filters in batch mode Johannes Schindelin
2016-08-24 16:09   ` [PATCH v2 0/4] cat-file: optionally convert to worktree version Junio C Hamano
2016-08-24 16:19     ` Jeff King
2016-08-24 17:02       ` Junio C Hamano
2016-08-24 17:32         ` Jeff King
2016-08-24 17:55           ` Junio C Hamano
2016-08-29 21:02   ` Junio C Hamano
2016-08-31 20:34     ` Johannes Schindelin
2016-09-09 10:10   ` Johannes Schindelin [this message]
2016-09-09 10:10     ` [PATCH v3 1/4] cat-file: fix a grammo in the man page Johannes Schindelin
2016-09-09 10:10     ` [PATCH v3 2/4] cat-file: introduce the --filters option Johannes Schindelin
2016-09-09 15:09       ` Junio C Hamano
2016-09-09 16:01         ` Johannes Schindelin
2016-09-09 16:08           ` Junio C Hamano
2016-09-09 17:16             ` Junio C Hamano
2016-09-09 17:26               ` Junio C Hamano
2016-09-10  7:57                 ` Johannes Schindelin
2016-09-11 21:44                   ` Junio C Hamano
2016-09-09 10:10     ` [PATCH v3 3/4] cat-file --textconv/--filters: allow specifying the path separately Johannes Schindelin
2016-09-09 18:06       ` Junio C Hamano
2016-09-10  7:59         ` Johannes Schindelin
2016-09-09 10:10     ` [PATCH v3 4/4] cat-file: support --textconv/--filters in batch mode Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1473415827.git.johannes.schindelin@gmx.de \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.