All of lore.kernel.org
 help / color / mirror / Atom feed
From: bdowning-oU/tDdhfGLReoWH0uzbU5w@public.gmane.org (Brian Downing)
To: Johannes Schindelin <Johannes.Schindelin-Mmb7MZpHnFY@public.gmane.org>
Cc: Junio C Hamano <gitster-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>,
	git-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	msysgit-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	Edgar Toernig <froese-Mmb7MZpHnFY@public.gmane.org>,
	Steffen Prohaska <prohaska-wjoc1KHpMeg@public.gmane.org>
Subject: Re: [PATCH v2] compat: Add simplified merge sort implementation from glibc
Date: Tue, 5 Feb 2008 20:47:32 -0600	[thread overview]
Message-ID: <20080206024732.GR26392@lavos.net> (raw)
In-Reply-To: <alpine.LSU.1.00.0802052220500.8543-OGWIkrnhIhzN0uC3ymp8PA@public.gmane.org>


On Tue, Feb 05, 2008 at 10:21:58PM +0000, Johannes Schindelin wrote:
> On Tue, 5 Feb 2008, Brian Downing wrote:
> > diff --git a/compat/qsort.c b/compat/qsort.c
> > new file mode 100644
> > index 0000000..8663889
> > --- /dev/null
> > +++ b/compat/qsort.c
> > @@ -0,0 +1,60 @@
> > +#include "../git-compat-util.h"
> > +
> > +/* This merge sort implementation is simplified from glibc's. */
> > +static void msort_with_tmp(void *b, size_t n, size_t s,
> 
> Didn't you forget to include the original copyright, as well as yours?

I (perhaps naïvely) assumed the "from glibc" would be enough.  If not,
the original is:

/* An alternative to qsort, with an identical interface.
   This file is part of the GNU C Library.
   Copyright (C) 1992,95-97,99,2000,01,02,04 Free Software Foundation, Inc.
   Written by Mike Haertel, September 1988.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

(That was from glibc-2.3.6/stdlib/msort.c.  I'm not sure of the exact
version I referenced for the implementation, but it was a lot closer to
2.3.6 than the current 2.7.)

As far as my copyleft, I was just planning on it being under Git's
blanket copyleft.  I really only pruned and reformatted code; there's
really nothing substantial to claim ownership of.

> BTW if these 60 lines have code that is really faster than Microsoft's 
> implementation of a sort, it is really fascinating to me.

Well, it's faster for us, but I bet our (usually mostly-sorted) tree
input is just better for a sort like a merge sort rather than a
quicksort.

-bcd

  parent reply	other threads:[~2008-02-06  2:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-05 21:10 [PATCH v2] compat: Add simplified merge sort implementation from glibc Brian Downing
     [not found] ` <20080205211044.GP26392-oU/tDdhfGLReoWH0uzbU5w@public.gmane.org>
2008-02-05 22:21   ` Johannes Schindelin
     [not found]     ` <alpine.LSU.1.00.0802052220500.8543-OGWIkrnhIhzN0uC3ymp8PA@public.gmane.org>
2008-02-06  2:47       ` Brian Downing [this message]
2008-02-07  4:14 ` Applying patches from gmane can be dangerous Junio C Hamano
2008-02-07  4:29   ` Nicolas Pitre
2008-02-07  9:08     ` Junio C Hamano
2008-02-10 10:51       ` 'next' will be rewound and rebuilt after feature releases Junio C Hamano
2008-02-07  8:01   ` Applying patches from gmane can be dangerous Jari Aalto
2008-02-07  8:21     ` Junio C Hamano
2008-02-07  9:05       ` Mike Hommey
2008-02-07 12:42       ` Johannes Schindelin
2008-02-07 13:32   ` Brian Downing
2008-02-07 14:50     ` Aidan Van Dyk
2008-02-07 15:03       ` Brian Downing
2008-02-07 16:10       ` Johannes Schindelin
2008-02-11 21:16         ` Johannes Schindelin
2008-02-07 14:10   ` Frank Lichtenheld

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=20080206024732.GR26392@lavos.net \
    --to=bdowning-ou/tddhfglreowh0uzbu5w@public.gmane.org \
    --cc=Johannes.Schindelin-Mmb7MZpHnFY@public.gmane.org \
    --cc=froese-Mmb7MZpHnFY@public.gmane.org \
    --cc=git-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=gitster-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org \
    --cc=msysgit-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=prohaska-wjoc1KHpMeg@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.