From: Davide Libenzi <davidel@xmailserver.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Peter TB Brett <peter@peter-b.co.uk>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: git 0.99.7b doesn't build on Cygwin
Date: Fri, 23 Sep 2005 22:11:22 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.63.0509232155150.30718@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.58.0509231647300.3308@g5.osdl.org>
On Fri, 23 Sep 2005, Linus Torvalds wrote:
>
>
> On Fri, 23 Sep 2005, Johannes Schindelin wrote:
>>
>> It seems that the fixup of the mmap()ed regions after a fork() does not
>> work properly in cygwin. Remember that cygwin just wraps the non-POSIX
>> Win32API and tries to make it sort of POSIX compliant. The problem is that
>> Win32API lacks a proper fork(). This is therefore emulated, and after
>> that, all the mmap()ed regions have to be mapped again. That fails.
>
> Now, I'm not a big fan of windows ("No, really? Tell us more!") but I'd
> actually like it if the _core_ git stuff worked in as wide a variety of
> situations as possible. Screw the shell scripts and the daemon or
> secondary things like that which windows users might as well generate
> their own stuff for, but I'd hope the really core stuff would work.
>
> If I understood correctly, you said that "git-diff-tree" doesn't work due
> to the fork/mmap issue. Now, I assume that means that it's the builtin
> diff that has problems.
Stay away from Cygwin if you use extensively fork(), since it becomes dog
slow (the fork() implementation on Cygwin involves creating a new
suspended task, *copy* - not COW - the *whole* VM space to the child,
and resuming it). Actually, the whole Cygwin in general is dog slow,
especially on FS operations (and git likes them). If you really like to
have Windows support (uuu hoo WinTorvalds) you might be better using a
small compat layer (should be fairly small for git).
> As far as I can tell, we can solve that two ways:
>
> - make Windows always use the external diff program. That may be the
> right thing to do, since then the fork() just turns into a regular
> fork+exec, which is how windows works anyway.
>
> - look at doing the diff internally.
>
> I'm wondering if there is some stupid way to turn a diff generated by
> diff_delta() into a line-based one? If you have the original file and the
> xdiff, I think we should be able to just walk the original file and output
> a unified diff.
>
> Davide, maybe I'm being stupid, but I'm thinking that it might be possible
> to generate a -u3 diff by basically walking the xdiff file in a linear
> fashion: if the edits are in strictly ascending order, we could walk the
> original file one line at a time, and keeping a buffer of the three last
> lines. Then, when the file offset hits the next "edit" in the xdiff, we
> start generating a line-based diff (and use the previous three lines as
> the context).
>
> Does that sound possible? Maybe somebody has even done it? Is it a stupid
> idea?
>
> I realize that it might not generate the same diff as GNU diff would do,
> and maybe it's really nasty, but it sounds like it _could_ be a "cheap"
> way of generating diffs, considering that we have something that already
> generates xdiffs..
Hehe, the same library from where Nicolas lifted the code for the binary
diff, has a totally portable diff/patch APIs (on top of xdiff/xpach):
http://www.xmailserver.org/xdiff.html
Generating text diffs, unfortunately is quite more complex than binary
ones. Libxdiff uses the same algorithm of GNU diff (Eugene W. Myers). The
library has zero dependency other than ANSI C. Another alternative, IIRC
someone made a library by wrapping the diffutil stuff, but I do not
remeber where it was.
- Davide
prev parent reply other threads:[~2005-09-24 5:09 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-23 13:33 git 0.99.7b doesn't build on Cygwin Peter TB Brett
2005-09-23 13:44 ` Johannes Schindelin
2005-09-23 13:50 ` Peter TB Brett
2005-09-23 22:08 ` Martin Langhoff
2005-09-23 22:34 ` Petr Baudis
2005-09-24 0:09 ` Linus Torvalds
2005-09-24 0:43 ` Linus Torvalds
2005-09-25 7:52 ` Junio C Hamano
2005-09-25 15:47 ` Implementing diff, was " Johannes Schindelin
2005-09-25 16:08 ` Davide Libenzi
2005-09-25 17:00 ` Linus Torvalds
2005-09-25 19:16 ` Davide Libenzi
2005-09-24 1:13 ` Johannes Schindelin
2005-09-24 2:46 ` Linus Torvalds
2005-09-24 3:04 ` Junio C Hamano
2005-09-24 5:26 ` Davide Libenzi
2005-09-24 18:10 ` Linus Torvalds
2005-09-24 19:12 ` Davide Libenzi
2005-09-24 20:31 ` Junio C Hamano
2005-09-24 21:28 ` Davide Libenzi
2005-09-24 21:46 ` Junio C Hamano
2005-09-24 21:47 ` Junio C Hamano
2005-09-24 21:52 ` Davide Libenzi
2005-09-24 22:26 ` Linus Torvalds
2005-09-24 22:27 ` Linus Torvalds
2005-09-25 16:59 ` Linus Torvalds
2005-09-26 19:33 ` Jon Loeliger
2005-09-26 20:23 ` Junio C Hamano
2005-09-24 22:41 ` Davide Libenzi
2005-09-25 19:59 ` Giuseppe Bilotta
2005-09-26 4:57 ` Junio C Hamano
2005-09-26 5:05 ` Davide Libenzi
2005-09-26 11:00 ` Giuseppe Bilotta
2005-09-26 21:54 ` H. Peter Anvin
2005-09-26 22:03 ` Davide Libenzi
2005-09-26 22:15 ` H. Peter Anvin
2005-09-25 3:04 ` Daniel Barkalow
2005-09-24 5:11 ` Davide Libenzi [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=Pine.LNX.4.63.0509232155150.30718@localhost.localdomain \
--to=davidel@xmailserver.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=peter@peter-b.co.uk \
--cc=torvalds@osdl.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