git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Nicolas Pitre <nico@cam.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Rocco Rutte <pdmef@gmx.net>,
	git@vger.kernel.org
Subject: Re: Libification project (SoC)
Date: Fri, 16 Mar 2007 12:17:52 -0400	[thread overview]
Message-ID: <20070316161752.GA3275@spearce.org> (raw)
In-Reply-To: <alpine.LFD.0.83.0703161145520.5518@xanadu.home>

Nicolas Pitre <nico@cam.org> wrote:
> On Fri, 16 Mar 2007, Johannes Schindelin wrote:
> 
> > We already _have_ the data structures!
> 
> Well... Shawn and I are contemplating alternate data structures to 
> improve things dramatically.

Hang on.  Yes, Nico and I are contemplating alternate disk based
data structure, and in some cases, alternate memory based data
structures to improve things.

But these structures are not changing the basic Git data structures
that have been with us since way back when. ;-) Commits still
have the same fields, with the same data and the same meaning.
Trees still have the same fields, and same meaning... etc.

> With a fixed public API I doubt such improvements could be as effective.

They still can be, and without shooting ourselves in the foot in the
process.
 
> So... if any API is to be developed, I'd argue that it must be done 
> _above_ the existing code with a higher level of abstraction and a much 
> narrower scope.

Yes.  Today we have a frozen API for commit walking.  Its called
`git rev-list --pretty=raw A ^B`.  That output format is pretty
well set in stone, and we cannot change it.  Everyone knows what
each field means, and hopefully knows that additional fields can
be added.  ;-)

Instead of formatting out those fields as hex strings, or as decimal
integer dates, we can offer them in a struct.  E.g.:

	struct git_objid {
		const unsigned char *obj_name;
	};

	struct git_commit {
		struct git_objid tree;
		struct git_objid *parents;
		uint32_t nr_parent;
		const char *author;
		time_t author_date;
		int author_tz;
		const char *committer;
		time_t committer_date;
		int committer_tz;
		const char *message;
	};

With the rule that the pointers are to static memory buffers that
libgit is loaning out to the caller (the caller should *not* free
these buffers).  This lets us play cute tricks down in the lower
tiers by pointing directly into the packfile dictionary tables
(saves memcpys); or xstrdup/xmalloc everything we give out if we
want to be really paranoid.

Just tossing ideas out - don't think that what I wrote above is my
final suggestion on the matter.  It may change in another day or
two if I think about it more.  ;-)

-- 
Shawn.

  parent reply	other threads:[~2007-03-16 16:18 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-16  4:24 Libification project (SoC) Luiz Fernando N. Capitulino
2007-03-16  4:59 ` Shawn O. Pearce
2007-03-16  5:30   ` Junio C Hamano
2007-03-16  6:00     ` Shawn O. Pearce
2007-03-16  6:54       ` Junio C Hamano
2007-03-16 11:54         ` Johannes Schindelin
2007-03-16 13:09           ` Rocco Rutte
2007-03-16 15:12             ` Johannes Schindelin
2007-03-16 15:55               ` Nicolas Pitre
2007-03-16 16:13                 ` Johannes Schindelin
2007-03-16 16:26                   ` Nicolas Pitre
2007-03-16 18:22                     ` Steve Frécinaux
2007-03-16 18:53                       ` Nicolas Pitre
2007-03-18 13:57                         ` Petr Baudis
2007-03-16 23:26                     ` Johannes Schindelin
2007-03-16 16:17                 ` Shawn O. Pearce [this message]
2007-03-16 18:20               ` Marco Costalba
2007-03-16 18:38                 ` Marco Costalba
2007-03-16 18:59                   ` Nicolas Pitre
2007-03-16 21:07                     ` Marco Costalba
2007-03-16 23:24                       ` Johannes Schindelin
2007-03-17  7:04                         ` Marco Costalba
2007-03-17 17:29                           ` Johannes Schindelin
2007-03-16 19:09                   ` Andy Parkins
2007-03-18 14:08               ` Petr Baudis
2007-03-18 23:48                 ` Johannes Schindelin
2007-03-19  1:21                   ` Petr Baudis
2007-03-19  1:43                     ` Johannes Schindelin
2007-03-19  2:56                       ` Theodore Tso
2007-03-19  3:55                         ` Shawn O. Pearce
2007-03-19 14:57                         ` Johannes Schindelin
2007-03-19 16:28                         ` Linus Torvalds
2007-03-19 16:32                           ` Linus Torvalds
2007-03-21 11:17                           ` Andreas Ericsson
2007-03-21 17:24                             ` Linus Torvalds
2007-03-22  9:51                               ` Andreas Ericsson
2007-03-19  7:01                       ` Marco Costalba
2007-03-19  9:46                         ` Steve Frécinaux
2007-03-19 10:33                         ` Steve Frécinaux
2007-03-19 12:37                         ` Johannes Schindelin
2007-03-19 12:52                           ` Petr Baudis
2007-03-19 13:55                             ` Johannes Schindelin
2007-03-19 13:04                           ` Marco Costalba
2007-03-16 12:53     ` Petr Baudis
2007-03-16 13:47     ` Luiz Fernando N. Capitulino
2007-03-16 14:08       ` Petr Baudis
2007-03-16 18:38         ` Luiz Fernando N. Capitulino
2007-03-16 23:16           ` Shawn O. Pearce
2007-03-17 19:58             ` Luiz Fernando N. Capitulino
2007-03-18  5:23               ` Shawn O. Pearce
2007-03-18  5:52                 ` Junio C Hamano
2007-03-18 16:18                   ` Luiz Fernando N. Capitulino
2007-03-18 19:31                     ` Junio C Hamano
2007-03-19 16:09                       ` Luiz Fernando N. Capitulino
2007-03-18 21:15                     ` Nicolas Pitre
2007-03-16 15:16       ` Johannes Schindelin
2007-03-16  8:06   ` Johannes Sixt
2007-03-16  8:58     ` Matthieu Moy
2007-03-16 11:51       ` Johannes Schindelin
2007-03-16 12:55   ` Petr Baudis
2007-03-17  2:24 ` Jakub Narebski
2007-03-17  5:22   ` 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=20070316161752.GA3275@spearce.org \
    --to=spearce@spearce.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=nico@cam.org \
    --cc=pdmef@gmx.net \
    /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).