git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: PUSH_HEAD, was Re: FETCH_HEAD question

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 18, 2009, 00:29 UTC
Message-ID
<76718490902171629x78b5057aw5e00ba22bfb8b8b0@mail.gmail.com>
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:
Show 11 quoted lines
> 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.
Previous: Junio C HamanoNext: Johannes Schindelin
Message 13 of 15 in “FETCH_HEAD question”
  1. Jay SoffianFeb 17, 2009
  2. Jay SoffianFeb 17, 2009
  3. Junio C HamanoFeb 17, 2009
  4. Jay SoffianFeb 17, 2009
  5. Junio C HamanoFeb 17, 2009
  6. Jay SoffianFeb 17, 2009
  7. Junio C HamanoFeb 17, 2009
  8. Jay SoffianFeb 17, 2009
  9. Johannes SchindelinFeb 17, 2009
  10. Jay SoffianFeb 17, 2009
  11. PUSH_HEAD, was Re: FETCH_HEAD questionJohannes Schindelin, Feb 17, 2009
  12. Junio C HamanoFeb 17, 2009
  13. Jay SoffianFeb 18, 2009
  14. Johannes SchindelinFeb 18, 2009
  15. Sitaram ChamartyFeb 17, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.