Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-15 Thread Jeff King
On Mon, May 13, 2013 at 04:57:55PM +0200, Michael J Gruber wrote: > > I don't think that it is a property of the file itself. That is, you do > > not say "foo files are inherently uninteresting to git-show, and > > therefore we always convert them, whereas bar files do not have that > > property'.

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-13 Thread Junio C Hamano
Michael J Gruber writes: > But you do have the possibility to use different drivers for diff and > show. For example, for showing a file some sort of automatic pagination > or line numbering can be helpful whereas it would hurt the diff case. I do not find the example convincing (yet); it looks

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-13 Thread Michael J Gruber
Jeff King venit, vidit, dixit 13.05.2013 13:55: > On Sun, May 12, 2013 at 10:01:38PM -0700, Junio C Hamano wrote: > >> Michael J Gruber writes: >> >>> Adding to that: >>> >>> Somehow I still feel I should introduce a new attribute "show" (or a >>> better name) similar to "diff" so that you can sp

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-13 Thread Jeff King
On Sun, May 12, 2013 at 10:01:38PM -0700, Junio C Hamano wrote: > Michael J Gruber writes: > > > Adding to that: > > > > Somehow I still feel I should introduce a new attribute "show" (or a > > better name) similar to "diff" so that you can specifiy a diff driver to > > use for showing a blob (o

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-12 Thread Junio C Hamano
Michael J Gruber writes: > Adding to that: > > Somehow I still feel I should introduce a new attribute "show" (or a > better name) similar to "diff" so that you can specifiy a diff driver to > use for showing a blob (or grepping it), which may or may not be the > same you use for "diff". This wou

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-12 Thread Michael J Gruber
Junio C Hamano venit, vidit, dixit 11.05.2013 19:36: > Michael J Gruber writes: > + if (!DIFF_OPT_TOUCHED(&rev->diffopt, ALLOW_TEXTCONV) || + !DIFF_OPT_TST(&rev->diffopt, ALLOW_TEXTCONV)) + return stream_blob_to_fd(1, sha1, NULL, 0); >>> >>> It is surprising that the

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-12 Thread Michael J Gruber
Adding to that: Somehow I still feel I should introduce a new attribute "show" (or a better name) similar to "diff" so that you can specifiy a diff driver to use for showing a blob (or grepping it), which may or may not be the same you use for "diff". This would be a much more fine-grained and sys

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-11 Thread Junio C Hamano
Jeff King writes: > On Fri, May 10, 2013 at 11:04:01AM -0700, Junio C Hamano wrote: > >> One thing to notice is that those accessing rev->pending before >> calling prepare_revision_walk(), as opposed to those receiving >> objects in rev->commits via get_revision(), are the only ones that >> care

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-11 Thread Junio C Hamano
Michael J Gruber writes: >>> + if (!DIFF_OPT_TOUCHED(&rev->diffopt, ALLOW_TEXTCONV) || >>> + !DIFF_OPT_TST(&rev->diffopt, ALLOW_TEXTCONV)) >>> + return stream_blob_to_fd(1, sha1, NULL, 0); >> >> It is surprising that the necessary change is only this, but I think >> it is corre

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-11 Thread Michael J Gruber
Junio C Hamano venit, vidit, dixit 10.05.2013 19:02: > Michael J Gruber writes: > >> Currently, "diff" and "cat-file" for blobs honor "--textconv" options >> (with the former defaulting to "--textconv" and the latter to >> "--no-textconv") whereas "show" does not honor this option, even though >>

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-10 Thread Jeff King
On Fri, May 10, 2013 at 11:04:01AM -0700, Junio C Hamano wrote: > One thing to notice is that those accessing rev->pending before > calling prepare_revision_walk(), as opposed to those receiving > objects in rev->commits via get_revision(), are the only ones that > care about the context and wants

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-10 Thread Junio C Hamano
Jeff King writes: > On Fri, May 10, 2013 at 10:02:51AM -0700, Junio C Hamano wrote: > >> > Make "show" on blobs behave like "diff", i.e. honor "--textconv" by >> > default and "--no-textconv" when given. >> [...] >> So "show" on blobs does show the raw contents by default, but the >> user can exp

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-10 Thread Jeff King
On Fri, May 10, 2013 at 10:02:51AM -0700, Junio C Hamano wrote: > > Make "show" on blobs behave like "diff", i.e. honor "--textconv" by > > default and "--no-textconv" when given. > [...] > So "show" on blobs does show the raw contents by default, but the > user can explicitly ask to enable textco

Re: [PATCHv3 3/7] show: honor --textconv for blobs

2013-05-10 Thread Junio C Hamano
Michael J Gruber writes: > Currently, "diff" and "cat-file" for blobs honor "--textconv" options > (with the former defaulting to "--textconv" and the latter to > "--no-textconv") whereas "show" does not honor this option, even though > it takes diff options. > > Make "show" on blobs behave like

[PATCHv3 3/7] show: honor --textconv for blobs

2013-05-10 Thread Michael J Gruber
Currently, "diff" and "cat-file" for blobs honor "--textconv" options (with the former defaulting to "--textconv" and the latter to "--no-textconv") whereas "show" does not honor this option, even though it takes diff options. Make "show" on blobs behave like "diff", i.e. honor "--textconv" by def