From: Junio C Hamano <gitster@pobox.com>
To: "Vanderhoof\, Tzadik" <tzadik.vanderhoof@optum360.com>
Cc: Duy Nguyen <pclouds@gmail.com>,
"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: new git-diff switch to eliminate leading "+" and "-" characters
Date: Sun, 19 Feb 2017 10:59:49 -0800 [thread overview]
Message-ID: <xmqq60k6m2fu.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <2C8817BDA27E034F8E9A669458E375EF11888CC1@APSWP0428.ms.ds.uhc.com> (Tzadik Vanderhoof's message of "Fri, 17 Feb 2017 16:06:19 +0000")
"Vanderhoof, Tzadik" <tzadik.vanderhoof@optum360.com> writes:
>> From: Duy Nguyen [mailto:pclouds@gmail.com]
>>
>> I face this "problem" every day, but most editors nowadays have block-
>> based editing that would allow you to remove a column of "+/-"
>> easily. At least it has not bothered me to think of improving it.
>
> Would a patch be welcome?
I am not enthused for at least two reasons.
The weaker one is "it would likely to introduce a lot of noise in
the code for a feature of dubious merit".
The other is a bit more serious. Cutting and pasting has been a
source of lost or mangled whitespaces. Tabs get expanded, a wrapped
long single line turns into two lines, an originally indented line
auto-indented when inserted to the receiving editor, etc., etc.,
depending on the pager that the output was passed through for the
terminal, the terminal program itself and the editor. The "feature"
will encourage cut-and-paste, and I personally would be reluctant to
add things that encourage bad practice to the users.
As Duy said, saving the "diff" output to another file, opening in an
editor that output file and the file the patch targets to modify,
and transferring the lines while dropping unnecessray parts (i.e.
unwanted context lines and preimage lines, and possibly undesired
postimage lines, and also the leading SP/+/- designators) has no
such downside. It obviously has an added benefit that it makes it
less likely for people to cut and paste a line and then become
unsure if they really cut from the green line or they by mistake
also pasted an adjacent red line.
So, I'd say the answer is "probably not".
prev parent reply other threads:[~2017-02-19 18:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 23:01 new git-diff switch to eliminate leading "+" and "-" characters Vanderhoof, Tzadik
2017-02-17 14:53 ` Duy Nguyen
2017-02-17 16:04 ` Vanderhoof, Tzadik
2017-02-17 16:06 ` Vanderhoof, Tzadik
2017-02-19 18:59 ` Junio C Hamano [this message]
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=xmqq60k6m2fu.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=tzadik.vanderhoof@optum360.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox