All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Mart Sõmermaa" <mrts.pydev@gmail.com>, git@vger.kernel.org
Subject: Re: git diff: add option for omitting the contents of deletes
Date: Mon, 28 Feb 2011 08:31:55 +0100	[thread overview]
Message-ID: <4D6B4F6B.1040209@drmicha.warpmail.net> (raw)
In-Reply-To: <7v39n9uldp.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 28.02.2011 00:07:
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> Michael J Gruber <git@drmicha.warpmail.net> writes:
>>
>>> Wasn't the pager invented for sifting through output which has to be
>>> several pages, but not not for that which could be more concise? ;)
>>>
>>> In fact, -D would be quite analogous to -M and -C in that respect.
>>
>> There is a big difference: -M and -C lets your recipient reproduce the
>> state using the change you are trying to convey with the diff output in
>> either direction (iow, "apply -R" works), but your "-D" would not have
>> that property.
> 
> Having said that we have always valued "reversibility" and a casual -D is

I didn't know, but I guess I haven't come across those issues yet.

> not in line with that principle, I don't have a strong objection if the
> new mode of operation is marked clearly as "nonusable if you are trying to
> produce appliable diff (iow, don't send such a patch to mailing list--it
> is for viewing purposes only)", treating it just like the --color-words
> and the --stat options (there isn't even need to mark these as unusable
> for that purpose, as people with common sense would be able to guess).

Yes, it is purely intended as "for viewing by humans". Even in the
forward direction saying "delete that path" is different from saying
"delete that content from that path", i.e. "diff -D" output may apply
without conflicts in cases where "diff" output does not.

That aspect is similar to -M and -C, though - unless we check the sha1
of the blobs before applying the patch (which would be possible for -D
also) - do we?

> If we were to do this, it probably is a good idea to apply that for a
> typechange patch (the one that is produced when a symlink turns into a
> regular file and vice versa) as well.  It also might make sense to apply
> the similar principle to shorten the output with -B when a rewrite patch
> is expressed as a single hunk patch that removes everything old and then
> adds everthing new.

Reminds me of my failed attempt to make the diff output for symlinks
more human-friendly. The latter can be solved with textconv, though.

Michael

  reply	other threads:[~2011-02-28  7:35 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-26 13:16 git diff: add option for omitting the contents of deletes Mart Sõmermaa
2011-02-26 20:11 ` Junio C Hamano
2011-02-27 14:41   ` Michael J Gruber
2011-02-27 22:33     ` Mart Sõmermaa
2011-02-28  9:58       ` Michael J Gruber
2011-02-28 10:51         ` Mart Sõmermaa
2011-02-27 22:54     ` Junio C Hamano
2011-02-27 23:07       ` Junio C Hamano
2011-02-28  7:31         ` Michael J Gruber [this message]
2011-02-28 12:17           ` Jeff King
2011-02-28 12:23             ` Jeff King
2011-02-28 12:32               ` Michael J Gruber
2011-02-28 12:59                 ` Jeff King
2011-02-28 13:05                   ` Michael J Gruber
2011-02-28 21:54                     ` Jeff King
2011-02-28 18:11               ` Junio C Hamano
2011-02-28 22:23                 ` Jeff King
2011-02-28 23:28                   ` Junio C Hamano
2011-03-01  0:11                     ` Junio C Hamano
2011-03-07 20:38                       ` Mart Sõmermaa
2011-03-08  7:14                         ` Michael J Gruber
2011-03-08 19:49                         ` Junio C Hamano
2011-03-08 21:25                           ` Mart Sõmermaa
2011-03-08 21:31                             ` Jeff King
2011-02-28 12:42             ` symling diff driver (Was: Re: git diff: add option for omitting the contents of deletes) Michael J Gruber
2011-02-28 13:08               ` Jeff King
2011-02-28 15:26                 ` [PATCH/WIP] attr: make attributes depend on file type Michael J Gruber
2011-02-28 17:30                   ` Jeff King
2011-02-28 17:48                     ` Junio C Hamano
2011-03-01  7:46                       ` Michael J Gruber
2011-02-28 10:45         ` git diff: add option for omitting the contents of deletes Mart Sõmermaa
2011-02-28 16:10           ` Michael J Gruber

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=4D6B4F6B.1040209@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mrts.pydev@gmail.com \
    /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.