git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: PUSH_HEAD, was Re: FETCH_HEAD question
Date: Tue, 17 Feb 2009 19:29:35 -0500	[thread overview]
Message-ID: <76718490902171629x78b5057aw5e00ba22bfb8b8b0@mail.gmail.com> (raw)
In-Reply-To: <7vab8k39ze.fsf@gitster.siamese.dyndns.org>

On Tue, Feb 17, 2009 at 6:43 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Having said that, there need to be clear and sane semantics defined to
> tell which push should go to PUSH_HEAD file and which should directly go
> to the underlying ref.  It is probably the easiest to explain if all
> pushes to local refs are redirected to PUSH_HEAD when the repository is
> non-bare, but it means a non-bare repository cannot be used as the central
> shared repository for everybody to meet and swap with push-pull.  We could
> only redirect push to the checked-out branch to PUSH_HEAD, but then that
> would introduce an inconsistency between checked-out branches and others
> from fetchers' point of view; pushes to some branches are observable from
> the outside while pushes to one special branch (the checked-out one) are
> not.

This is along the lines of what I was thinking. However, I have also
been thinking of an alternative. It would go something like this:

$ git init --hybrid

This would basically setup a repository that is a combination of bare
and non-bare and would act like having a pair or repositories. i.e.
Given,

$ mkdir project
$ cd project
$ git init
$ touch file && git add file && git commit -m initial
$ git clone --bare file://$(pwd) ../project-public.git
$ git remote add public ../project-public.git
$ git config branch.master.remote public
$ git config branch.master.merge refs/heads/master

I don't mean to suggest that git init --hybrid would literally create
two repositories. Rather, it would create a single repo that acts like
the above two. You'd "git push" to publish a branch and "git pull" to
integrate any pushed-in changes. refs/heads in such a repo would never
receive outside changes directly, nor would changes to refs/heads be
externally visible until published via push.

This would typically be used in the mothership/satellite scenario,
where the mothership repo is setup with --hybrid and the satellite is
just a normal clone.

But maybe this is a lot of work w/little reward.

j.

  reply	other threads:[~2009-02-18  0:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17  4:43 FETCH_HEAD question Jay Soffian
2009-02-17  5:11 ` Jay Soffian
2009-02-17  5:36 ` Junio C Hamano
2009-02-17  6:21   ` Jay Soffian
2009-02-17  7:18     ` Junio C Hamano
2009-02-17  7:41       ` Jay Soffian
2009-02-17  8:35         ` Junio C Hamano
2009-02-17 17:14           ` Jay Soffian
2009-02-17 17:22             ` Johannes Schindelin
2009-02-17 17:34               ` Jay Soffian
2009-02-17 22:58                 ` PUSH_HEAD, was " Johannes Schindelin
2009-02-17 23:43                   ` Junio C Hamano
2009-02-18  0:29                     ` Jay Soffian [this message]
2009-02-18  0:30                     ` Johannes Schindelin
2009-02-17  8:25     ` Sitaram Chamarty

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=76718490902171629x78b5057aw5e00ba22bfb8b8b0@mail.gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --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.
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).