git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: 乙酸鋰 <ch3cooli@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: Diff filename has trailing tab if filename contains space
Date: Fri, 04 Mar 2016 16:32:00 -0800	[thread overview]
Message-ID: <xmqqa8mdydbz.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAHtLG6TLAOA0hg897EntOjG1kJsZEmjDshc-yyO9zP27540AAg@mail.gmail.com> ("乙酸鋰"'s message of "Sat, 5 Mar 2016 07:50:32 +0800")

乙酸鋰 <ch3cooli@gmail.com> writes:

> Hi,
>
> Using git 2.7.1
>
> Diff filename has trailing tab if filename contains space

Thanks; that is very much deliberate and has been with us forever.

commit 1a9eb3b9d50367bee8fe85022684d812816fe531
Author: Junio C Hamano <junkio@cox.net>
Date:   Fri Sep 22 16:17:58 2006 -0700

    git-diff/git-apply: make diff output a bit friendlier to GNU patch (part 2)
    
    Somebody was wondering on #git channel why a git generated diff
    does not apply with GNU patch when the filename contains a SP.
    It is because GNU patch expects to find TAB (and trailing timestamp)
    on ---/+++ (old_name and new_name) lines after the filenames.
    
    The "diff --git" output format was carefully designed to be
    compatible with GNU patch where it can, but whitespace
    characters were always a pain.
    
    This adds an extra TAB (but not trailing timestamp) to old_name
    and new_name lines of git-diff output when the filename has a SP
    in it.  An earlier patch updated git-apply to prepare for this.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>

      reply	other threads:[~2016-03-05  0:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04 23:50 Diff filename has trailing tab if filename contains space 乙酸鋰
2016-03-05  0:32 ` 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=xmqqa8mdydbz.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=ch3cooli@gmail.com \
    --cc=git@vger.kernel.org \
    /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).