git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: git discussion list <git@vger.kernel.org>,
	Jeff King <peff@peff.net>, Vicent Marti <tanoku@gmail.com>,
	Brad King <brad.king@kitware.com>,
	Johan Herland <johan@herland.net>
Subject: Re: [RFC/WIP] Pluggable reference backends
Date: Mon, 10 Mar 2014 07:30:45 -0700	[thread overview]
Message-ID: <CAJo=hJtiPgByhk9M4ZKD98DARzgeU6z2mmw7fcLTEbBza-_h6A@mail.gmail.com> (raw)
In-Reply-To: <531D9B50.5030404@alum.mit.edu>

On Mon, Mar 10, 2014 at 4:00 AM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
> I have started working on pluggable ref backends.  In this email I
> would like to share my plans and solicit feedback.

Yay!

JGit already has pluggable ref backends, so it is good to see this
starting in git-core.

FWIW the Gerrit Code Review community is interested in this project.

> * Store references in a SQLite database, to get correct transaction
>   handling.

No to SQLLite in git-core. Using it from JGit requires building
SQLLite and a JNI wrapper, which makes JGit significantly less
portable. I know SQLLite is pretty amazing, but implementing
compatibility with it from JGit will be a big nightmare for us.

> * Reference transactions that can be used across multiple Git
>   commands.  Imagine,
>
>       export GIT_TRANSACTION=$(git transaction begin)
>       trap 'git transaction rollback' ERR
>       git foo ...
>       git bar ...
>       git baz ...
>       if ! git transaction commit
>       then
>           # Transaction failed; all references rolled back
>       else
>           # Transaction succeeded; all references updated atomically
>       fi
>       trap '' ERR
>       unset GIT_TRANSACTION
>
>   The "GIT_TRANSACTION" environment variable would tell git to read
>   from the usual references, overridden with any reference changes
>   that have occurred during the transaction, but write any changes
>   (including both old and new values) to the transaction.  The command
>   "git transaction commit" would verify that the old values listed in
>   the transaction still agree with the current values, and then make
>   all of the changes atomically.

Yay!

Gerrit Code Review really wants to get transactions implemented. So I
am very much in favor of trying to improve the situation in git-core.

We want not only a transaction over 2+ references in the same
repository, but we also want to perform transactions across
repositories. Consider a git submodule child and parent being updated
at the same time. We really want to update refs/heads/master in both
repositories atomically at the central server.

>   Such transactions could also be broadcast to mirrors when they are
>   committed to keep multiple Git repositories in sync.

Ooh, this would be very interesting.

> Git hosters [1] will be likely to take advantage of alternate
> reference backends pretty easily, because they know which tools touch
> their repositories and need only update those tools.  It is expected
> that alternate reference backends will be useful for hosters even if
> they don't become practical for end-users.

Alternate reference backends are absolutely useful to large hosters.
The loose reference format isn't very scalable. The packed-refs helps,
but you can do better. IIRC our android.googlesource.com reference
backend uses only 79 bytes per reference on average, including both
the name string and the value. This super compact format is easy to
hold in RAM for hundreds of busy repositories.

> For end-users it is important that their repository be readable by all
> of the tools that they use.  So if we want to make a new format a
> viable option for normal Git users (let alone make it the new default
> format), some coordination will be needed between all of the
> commonly-used Git implementations (git-core, libgit2, JGit, and maybe
> Dulwich, Grit, ...).  Whether or not this happens in real life depends
> on how advantageous the hypothetical new format is to Git users and is
> beyond the scope of this proposal.

It is sad we have this many implementations, but as one of the authors
(JGit) I am happy to at least see you are worrying about compatibility
with them.

  parent reply	other threads:[~2014-03-10 14:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10 11:00 [RFC/WIP] Pluggable reference backends Michael Haggerty
2014-03-10 11:44 ` Johan Herland
2014-03-10 14:30 ` Shawn Pearce [this message]
2014-03-10 15:51   ` Max Horn
2014-03-10 15:52   ` Jeff King
2014-03-10 16:14     ` David Kastrup
2014-03-10 16:28       ` David Lang
2014-03-10 19:42       ` Jeff King
2014-03-10 19:56         ` David Kastrup
2014-03-10 17:46     ` Junio C Hamano
2014-03-10 17:56       ` Jeff King
2014-03-10 21:07     ` Michael Haggerty
2014-03-11  2:39       ` Shawn Pearce
2014-03-12 10:26         ` egit vs. git behaviour (was: [RFC/WIP] Pluggable reference backends) Andreas Krey
2014-03-12 16:48           ` Shawn Pearce
2014-03-11 10:56 ` [RFC/WIP] Pluggable reference backends Karsten Blees
2014-03-12 11:43   ` Michael Haggerty

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='CAJo=hJtiPgByhk9M4ZKD98DARzgeU6z2mmw7fcLTEbBza-_h6A@mail.gmail.com' \
    --to=spearce@spearce.org \
    --cc=brad.king@kitware.com \
    --cc=git@vger.kernel.org \
    --cc=johan@herland.net \
    --cc=mhagger@alum.mit.edu \
    --cc=peff@peff.net \
    --cc=tanoku@gmail.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).