From: "Neal Kreitzinger" <neal@rsss.com>
To: git@vger.kernel.org
Subject: Re: Spurious line insertion/deletion stats for binary file
Date: Fri, 15 Oct 2010 14:26:57 -0500 [thread overview]
Message-ID: <i9a9va$ror$1@dough.gmane.org> (raw)
In-Reply-To: 8CFCE61F-591A-4B56-B701-D1A391FBB088@sb.org
"Kevin Ballard" <kevin@sb.org> wrote in message
news:8CFCE61F-591A-4B56-B701-D1A391FBB088@sb.org...
>I just noticed something fairly odd when making a commit that changed a
>single binary file:
>
> kevin> (develop +=)> git ci -m 'Replace binary file'
> [develop c0c3b98] Replace binary file
> 1 files changed, 8 insertions(+), 14 deletions(-)
> rewrite Resources/some_image.png (99%)
>
> The commit results seem to be treating the binary file as text in order to
> give me insertion/deletion stats. This is quite obviously wrong. For this
> situation, a fairly simple solution would be to change that line to
> something like
>
> 1 files changed, 2652 bytes removed
>
> but the correct behavior is a bit less obvious when there are multiple
> files changed. Does anyone have a good suggestion for how to handle this
> case?
>
> -Kevin Ballard--
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
We track all our binaries so each commit is a working state of our system.
Git just seems to know they are binaries and reports them as such in the
diff pane of gitk: "Binary files a/path/binaryA and b/path/binaryA differ".
We are currently using 1.7.1. I guess it "knows" they are binaries because
we don't their paths in the "gitattributes" file.
Based on the gitattributes manpage, it sounds like you have "diff" set for
the path to your binary listed in your .git/info/attributes (git attributes)
file. If the binary is in the same path as the source you could set the
"binary" attribute macro for your binary(s) if the path or name is
distinguishable from the source. I played around with this in the past, but
currently don't have a need for it in my current configuration, so I'm
getting all of this from the gitattributes manpage,
http://www.kernel.org/pub/software/scm/git/docs/v1.7.1.2/gitattributes.html.
v/r,
Neal
prev parent reply other threads:[~2010-10-15 19:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-12 22:47 Spurious line insertion/deletion stats for binary file Kevin Ballard
2010-10-15 19:26 ` Neal Kreitzinger [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='i9a9va$ror$1@dough.gmane.org' \
--to=neal@rsss.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).