From: Francis Galiegue <fg@one2team.net>
To: Robin Rosenberg <robin.rosenberg@dewire.com>
Cc: Git Mailing List <git@vger.kernel.org>,
"Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: JGIT: discuss: diff/patch implementation
Date: Mon, 10 Nov 2008 19:11:19 +0100 [thread overview]
Message-ID: <200811101911.19603.fg@one2team.net> (raw)
In-Reply-To: <200811101759.03864.robin.rosenberg@dewire.com>
Le Monday 10 November 2008 17:59:03 Robin Rosenberg, vous avez écrit :
[Sorry if this is offtopic for the git mailing list...]
> >
> > Well, this API has a problem from the get go, since it does... Char by
> > char comparison. Ouch.
> >
> > I'll try and hack it so that it does line by line, but given my Java
> > skills, uh...
>
> We might want a byte-oriented version. Converting to char first is way
> too slow.
>
Well, AFAICT, here is how the current git code detects whether a file is
binary or not:
----
#define FIRST_FEW_BYTES 8000
int buffer_is_binary(const char *ptr, unsigned long size)
{
if (FIRST_FEW_BYTES < size)
size = FIRST_FEW_BYTES;
return !!memchr(ptr, 0, size);
}
----
Easy enough to be coded in Java, hey, even I could do it :p
So, provided binary files are dealt with already, what penalty is left for
Java to deal with?
--
fge
next prev parent reply other threads:[~2008-11-10 18:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-10 14:22 JGIT: discuss: diff/patch implementation Francis Galiegue
2008-11-10 15:56 ` Robin Rosenberg
2008-11-10 16:16 ` Francis Galiegue
2008-11-10 16:59 ` Robin Rosenberg
2008-11-10 18:11 ` Francis Galiegue [this message]
2008-11-10 19:46 ` Johannes Schindelin
2008-11-10 20:21 ` Francis Galiegue
2008-11-10 20:50 ` Junio C Hamano
2008-11-10 20:52 ` Shawn O. Pearce
2008-11-10 21:31 ` Francis Galiegue
2008-11-10 23:37 ` Johannes Schindelin
2008-11-11 10:06 ` Raimund Bauer
2008-11-11 17:18 ` Shawn O. Pearce
2008-11-11 17:31 ` Sverre Rabbelier
2008-11-11 7:27 ` Rogan Dawes
2008-11-11 17:13 ` Shawn O. Pearce
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=200811101911.19603.fg@one2team.net \
--to=fg@one2team.net \
--cc=git@vger.kernel.org \
--cc=robin.rosenberg@dewire.com \
--cc=spearce@spearce.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).