git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Yann Dirson <ydirson@free.fr>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v6] generalizing sorted-array handling
Date: Thu, 30 Dec 2010 01:01:19 +0100	[thread overview]
Message-ID: <20101230000119.GA6639@home.lan> (raw)
In-Reply-To: <7vd3p9b4d1.fsf@alter.siamese.dyndns.org>

On Fri, Dec 10, 2010 at 03:22:18PM -0800, Junio C Hamano wrote:
> Yann Dirson <ydirson@altern.org> writes:
> 
> > ... I want to get my focus back to
> > bulk-rename/builk-rm patches, which will make heavy use of this API.
> 
> Final comment.  As the primary thing you want to use this is to change the
> way how the rename_dst/rename_src tables are managed, and these are both
> tables sorted by a string, I suspect a more reasonable might be to first
> updated them to use string-list API and add to that API whatever necessary
> features you might need, if any.

It sounds reasonable to build on existing stuff (furthermore, the
string-list binary search is one I had missed).

Using string-lists here however will imply some tradeofs:

* the additional char* pointer in every list element is possibly not
  so high a price to pay

* using the "util" pointer for the payload will make memory management
  even more hairy (eg. "util" as a pointer to a struct which contains
  a pointer to a diff_filespec).  Convenience wrappers will be highly
  needed, and will also be required to keep calls to lookup/insert
  readable, when the elements we deal with are not strings but indeed
  the "util" stuff.

All in all, looks that the data-structure needed should have a higher
focus on the "util" field than string-list has.

Features that seem to miss from string-list today (for the
"dir-rename" series) include:

* custom string-comparison function (ie. prefix comparison): that
  would not be so difficult to generalize by adding a cmp_func
  parameter to get_entry_index().  That would imply changing
  widely-used API funcs like string_list_lookup() to shallow wrappers
  around variants that also take a cmp_func argument.

* lists indexed by 2 strings (bulkmove_candidates): could be replaced
  by using string-lists of string-lists instead, but I'm not sure the
  result would be that great


I still have mixed feelings about all of this.

-- 
Yann

      reply	other threads:[~2010-12-30  0:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-08 22:51 [PATCH v6] generalizing sorted-array handling Yann Dirson
2010-12-08 22:51 ` [PATCH 1/6] Introduce sorted-array binary-search function Yann Dirson
2010-12-10 22:29   ` Junio C Hamano
2010-12-30  0:40     ` Yann Dirson
2010-12-30  1:06       ` Erik Faye-Lund
2010-12-30 10:49         ` Yann Dirson
2010-12-08 22:51 ` [PATCH 2/6] Convert diffcore-rename's rename_dst to the new sorted-array API Yann Dirson
2010-12-10 22:32   ` Junio C Hamano
2010-12-08 22:51 ` [PATCH 3/6] Convert diffcore-rename's rename_src " Yann Dirson
2010-12-08 22:51 ` [PATCH 4/6] Convert pack-objects.c " Yann Dirson
2010-12-08 22:51 ` [PATCH 5/6] Use sorted-array API for commit.c's commit_graft Yann Dirson
2010-12-08 22:51 ` [PATCH 6/6] [RFC] subvert sorted-array to replace binary-search in unpack-objects Yann Dirson
2010-12-10 23:00   ` Junio C Hamano
2010-12-10 23:22 ` [PATCH v6] generalizing sorted-array handling Junio C Hamano
2010-12-30  0:01   ` Yann Dirson [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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101230000119.GA6639@home.lan \
    --to=ydirson@free.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).