git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Michael J Gruber <git@drmicha.warpmail.net>,
	Peter Oberndorfer <kumbayo84@arcor.de>,
	Git List <git@vger.kernel.org>
Subject: Re: textconv not invoked when viewing merge commit
Date: Thu, 14 Apr 2011 17:30:06 -0400	[thread overview]
Message-ID: <20110414213006.GA7709@sigill.intra.peff.net> (raw)
In-Reply-To: <7vwriwfssc.fsf@alter.siamese.dyndns.org>

On Thu, Apr 14, 2011 at 02:05:07PM -0700, Junio C Hamano wrote:

> > Yeah, I think that is pretty readable. But it gives me a funny feeling
> > to encode magic strings inside actual diff output. That is, the output
> > is indistinguishable from a file which contained the "Binary blob..."
> > strings.
>[...]
> 
> Yeah, that may be a sensible concern.
> 
> If we really cared, I would say that plumbing should keep the current
> behaviour (line-by-line even for binaries, and not using textconv unless
> it is asked).

I disagree. Spewing binary contents in the middle of patch output is
wrong and a bug, and we should fix it. Not to mention that the results
are simply incomprehensible in many cases. Binary data isn't
line-oriented, and treating it that way is just going to produce
confusing and useless results. Not to mention that I wouldn't be
surprised if embedded NULs in the data are not being handled properly by
the diff code.

I would much rather have it say "Binary files differ". It's not that
informative, but at least you don't waste a lot of time trying to figure
out what in the world it means.

> Having said all that, I don't think we made -c/--cc available to plumbing
> on purpose; rather they happen to be available because we thought people
> with common sense wouldn't run things like "diff-tree --c" that are meant
> for human consumption and expect the result to be parsable by their
> scripts. In other words, making the parser barf only for plumbing was not
> worth doing.

Weren't they needed originally for "git rev-list | git diff-tree"? Maybe
they post-date the invention of actual C "git log"; I didn't look. At
any rate, they've been around for a while, and it is not unreasonable
for somebody to want to script around the generation of human-readable
output, so I think they are a good addition.

I think the real argument to be made is that "--cc" was never parseable,
because it can't be applied, and users of the format should know that. I
sort of buy that. Though you could also potentially do other kinds of
analysis on --cc output (e.g., something blame-ish but totally external
to git). And for that you wouldn't want to pretend content was there
that isn't. It's an edge case, certainly, but I don't see any reason not
to be conservative in what we generate. The "Binary files differ" type
of output is not that much harder to generate.

-Peff

  reply	other threads:[~2011-04-14 21:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-11 17:12 textconv not invoked when viewing merge commit Peter Oberndorfer
2011-04-12  9:04 ` Michael J Gruber
2011-04-14 19:09   ` Jeff King
2011-04-14 19:15     ` Jeff King
2011-04-14 19:26     ` Junio C Hamano
2011-04-14 19:28       ` Jeff King
2011-04-14 19:35         ` Michael J Gruber
2011-04-14 19:43       ` Junio C Hamano
2011-04-14 20:06         ` Junio C Hamano
2011-04-14 20:23           ` Jeff King
2011-04-14 21:05             ` Junio C Hamano
2011-04-14 21:30               ` Jeff King [this message]
2011-04-15 15:29                 ` [PATCH] combine-diff: use textconv for combined diff format Michael J Gruber
2011-04-15 18:34                   ` Junio C Hamano
2011-04-16 10:24                     ` Michael J Gruber
2011-04-16 17:19                       ` Junio C Hamano
2011-04-16 21:37                         ` Jakub Narebski
2011-04-15 23:56                   ` Jeff King
2011-04-21 16:08                   ` Peter Oberndorfer
2011-04-15  6:54             ` textconv not invoked when viewing merge commit Matthieu Moy
2011-04-15 20:45               ` Junio C Hamano
2011-04-16  1:47                 ` Jeff King
2011-04-16  6:10                   ` Junio C Hamano
2011-04-16  6:33                     ` Jeff King
2011-04-16 16:23                       ` Junio C Hamano

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=20110414213006.GA7709@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kumbayo84@arcor.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).