git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jason Xu <jasonx98@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Force git diff to create a binary patch?
Date: Mon, 13 Jul 2020 07:51:12 -0700	[thread overview]
Message-ID: <xmqqwo37o4db.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CAGPh-qNrjQ5xwbPcfJdBqrqOJQsVpa2hy-XHwN-8rhPPZe4Vpg@mail.gmail.com> (Jason Xu's message of "Mon, 13 Jul 2020 00:58:23 -0400")

Jason Xu <jasonx98@gmail.com> writes:

> Here are two small files with non-ASCII data, yet git diff considers
> them text instead of binary.

Because it is based on heuristics, without a NUL in that short file,
the file may not be judged to be binary.

    echo '* -diff' >.git/info/attributes

would tell Git that they need to be treated as binary junk not
suited for textual diff (you'd need to tweak the pattern to your
need).




  reply	other threads:[~2020-07-13 14:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13  4:58 Force git diff to create a binary patch? Jason Xu
2020-07-13 14:51 ` Junio C Hamano [this message]
     [not found] ` <20200713223906.GH8360@camp.crustytoothpaste.net>
2020-07-14  4:09   ` Jason Xu
2020-07-14  4:34     ` Junio C Hamano
2020-07-14  4:34     ` Junio C Hamano
2020-07-14  4:56       ` Jason Xu
2020-07-14 15:35         ` 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=xmqqwo37o4db.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jasonx98@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 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).