git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: "Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br>,
	git@vger.kernel.org
Subject: Re: Libification project (SoC)
Date: Fri, 16 Mar 2007 02:00:33 -0400	[thread overview]
Message-ID: <20070316060033.GD31606@spearce.org> (raw)
In-Reply-To: <7vejnpycu1.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> wrote:
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> > On the other hand, many of the variables declared in environment.c
> > are repository specific configuration variables.  These probably
> > should be abstracted into some sort of wrapper, so that multiple
> > repositories can be accessed from within the same process.  Why?
> > a future mod_perl running gitweb.cgi accessing repositories through
> > libgit.a and Perl bindings of course!
> 
> I think if you are abstracting them out, into "struct repo_state",
> the index and object store related variables such as packed_git
> should go there as well, so your recommendation feels very
> inconsistent to me.

I missed packed_git, but you are right, that should definately go
with a struct repo_state.  And maybe you are right that the index
should go with it... but I'm not sure the index should be tied to the
repository at all.  Its strictly convention that the index goes with
the repository; GIT_INDEX_FILE lets you say otherwise at the command
line level, why can't we do otherwise from a library level too?
 
> >>     o Add prefix (eg, git_*) to public API functions
> >
> > Yes.  But which functions shall we expose?  ;-)
> 
> Before going into that topic, a bigger question is if we are
> happy with the current internal API and what the goal of
> libification is.  If the libification is going to say that "this
> is a published API so we are not going to change it", I would
> imagine that it would be very hard to accept in the mainline.

I'm looking at a middleground between our current "moving target"
internal API and our "frozen" plumbing process based API.  There
are a number of places where just being able to get data *out*
of Git easily would be useful, but doing so right now is awkward.
Either you code against our "moving target" internal API by creating
a new builtin (e.g. my builtin-statplog) where its easy to get what
you want, or you code against the plumbing based tools, where its
sometimes not so easy...

Most of the data formats aren't changing; a commit is a commit is
a commit.  It has a tree, parents, author, committer, message.

> Improvements like the earlier sliding mmap() series need to be
> able to change the interfaces without backward compatibility
> wart.

I agree.  But I also think the use_mmap() API is just way too low
level for a public library.  That particular change was pretty
low level.

Think higher, like "struct commit".  That is actually too low still,
as it doesn't really help you with the author and committer.

> In other words, I do not know what idiot ^W ^W who listed the
> libification stuff on the SoC "ideas" page,

I'm the idiot ^W individual responsible.  ;-)

> I would disagree with tying libification and Perl binding this
> way.  If the goal is to get faster gitweb, then that does not
> necessarily have to be libified git.  Let one person who does
> the libification come up with a decent C binding and let others
> worry about Perl bindings.

Yes.  However Perl bindings are often asked for.  And Marco Costalba
might like a working libgit that he could use for revision fetching
in qgit.  I think that if patches for a library started to appear,
another interested party would start to at least play with them.
 
> One big thing you forgot to mention is that whatever form it
> takes, the libification should not impact performance of
> existing plumbing.  These interfaces are "internally" public
> exactly because the callers still honor underlying convention
> such as not having to clean-up the object flags for the last
> invocation.  If you libify in a wrong way, you would end up an
> implementation of the interface that always cleans up (because
> you would not know if you are part of a long-living process so
> you will clean-up just in case you will still be called later),
> which would be unusable from the plumbing point-of-view.

I didn't forget; I just simply did not mention it.  I was considering
writing something to that effect, and probably should have.

This is a really valid point.  Git is insanely fast, partly because
we have a lot of "run once" types of applications and we have
optimized for those.  Any sort of "run many times" reuse needs to
not make the "run once" guy pay for something he will not use.

A good example of this is in git-describe, where we use the object
flags, and only bother to clear them out if there is another commit
remaining to be described.

-- 
Shawn.

  reply	other threads:[~2007-03-16  6:00 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 [this message]
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
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

  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=20070316060033.GD31606@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=lcapitulino@mandriva.com.br \
    /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).