git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Bill Lear <rael@zopyra.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Sergei Organov <osv@javad.com>,
	Matthieu Moy <Matthieu.Moy@imag.fr>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Jan Wielemaker <wielemak@science.uva.nl>,
	git@vger.kernel.org
Subject: Re: Cloning empty repositories, was Re: What is the idea for bare repositories?
Date: Wed, 14 Nov 2007 14:16:45 -0600	[thread overview]
Message-ID: <18235.22445.16228.535898@lisa.zopyra.com> (raw)
In-Reply-To: <7vfxz8hbcf.fsf@gitster.siamese.dyndns.org>

On Wednesday, November 14, 2007 at 11:32:32 (-0800) Junio C Hamano writes:
>Sergei Organov <osv@javad.com> writes:
>
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>>> His second point is also a real issue.  If you allowed cloning
>>> an empty repo (either bare or non-bare), then you and Bill can
>>> both clone from it, come up with an initial commit each.  Bill
>>> pushes his initial commit first.  Your later attempt to push
>>> will hopefully fail with "non fast forward", if you know better
>>> than forcing such a push, but then what?  You need to fetch, and
>>> merge (or rebase) your change on top of Bill's initial commit,
>>> and at that point the history you are trying to merge does not
>>> have any common ancestor with his history.
>>
>> Just a wild idea. Doesn't it make sense to introduce perfect ultimate
>> common ancestor of the universe, probably calling it "the NULL commit"?
>> At first glance it seems that it can help to avoid corner cases
>> automagically.
>...
>But cloning void to start the same project by multiple people
>and pushing their initial commits as roots to start a project
>indicates the lack of developer communication (besides, it just
>feels like a bad style, a hangover from centralized SCM
>mentality, but that is fine). ...

We have several users who have been using git for the past 9 months
and they each find this unreasonably complicated.  We realize it is
work, perhaps not of the highest importance, but it's also easy for
more experienced users to simply pooh-pooh the ideas that newer users
have as "silly" because instead of the two steps they would like, they
can "just" do the five "easy" steps.

Well, here's what we'd like:

% mkdir new_repo
% cd new_repo
% git --bare init

[on another machine:]
% git clone git://host/new_repo
% cd new_repo
% git init
[add content]
% git commit -a -m "Initial stuff"
% git push

So, this is hard work, and other priorities intrude.  Ok.

Instead, we have to 1) figure out how to do this right, because it's
difficult to remember and not intuitive, and 2) once we have "figured
it out", really figure it out, because there are a few gotchas:

% mkdir new_repo
% cd new_repo
% git --bare init

% mkdir new_repo
% cd new_repo
[add content]
% git commit -a -m "Initial stuff"
% git config remote.origin.url git://host/new_repo
% git push
[ach! fails!  what's up??]
[poke, read, poke some more, try other things..]
[try setting the remote.origin.fetch?  No, that doesn't work]
[try setting branch.master.remote?  Just edit by hand??]
% git push master
[fails again; read some more; think, think, think...]
% git push origin master
[aha! finally it works]

But now, I have a repo in which I cannot just say "git push" to update
my remote repo.

So, if we can't have clone "do the right thing", then it would be nice
if we had something to allow us to do this, perhaps an argument to git
init:

% mkdir new_repo
% cd new_repo
% git --bare init

[on another machine:]
% mkdir new_repo
% cd new_repo
% git init --mirror git://host/new_repo
[add content]
% git commit -a -m "Initial stuff"
% git push

Where 'git init --mirror <blah>' just sets up the config file
properly.

Something to think about ...


Bill

  reply	other threads:[~2007-11-14 20:17 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-12 13:11 What is the idea for bare repositories? David Kastrup
2007-11-12 13:19 ` Bruno Cesar Ribas
2007-11-12 13:57   ` Johannes Schindelin
2007-11-12 16:19     ` Jan Wielemaker
2007-11-12 16:34       ` Cloning empty repositories, was " Johannes Schindelin
2007-11-12 16:41         ` Matthieu Moy
2007-11-12 17:15           ` Johannes Schindelin
2007-11-12 17:24             ` Bill Lear
2007-11-12 17:30               ` Johannes Schindelin
2007-11-12 17:47                 ` Matthieu Moy
2007-11-12 17:57                   ` Johannes Schindelin
2007-11-12 18:02                     ` Matthieu Moy
2007-11-12 18:06                       ` Johannes Schindelin
2007-11-12 18:09                         ` Matthieu Moy
2007-11-12 21:56                           ` Junio C Hamano
2007-11-12 22:06                             ` Nicolas Pitre
2007-11-12 22:17                               ` Johannes Schindelin
2007-11-13 22:56                                 ` David Kastrup
2007-11-13  0:13                             ` Andreas Ericsson
2007-11-13  9:48                             ` Matthieu Moy
2007-11-13 10:02                               ` Shawn O. Pearce
2007-11-13 10:50                                 ` Matthieu Moy
2007-11-13 11:40                                   ` Jeff King
2007-11-13 19:50                                   ` Brian Gernhardt
2007-11-13 21:48                                     ` Matthieu Moy
2007-11-13 23:56                                       ` Johannes Schindelin
2007-11-14  9:35                                         ` Matthieu Moy
2007-11-13 17:34                                 ` Nicolas Pitre
2007-11-13 10:08                               ` Jakub Narebski
2007-11-13 11:19                               ` Johannes Schindelin
2007-11-13 18:41                               ` Junio C Hamano
2007-11-13 22:01                                 ` Matthieu Moy
2007-11-14  0:25                                   ` Junio C Hamano
2007-11-14  9:49                                     ` Matthieu Moy
2007-11-14 12:09                             ` Sergei Organov
2007-11-14 13:41                               ` Jakub Narebski
2007-11-14 14:05                                 ` Matthieu Moy
2007-11-14 14:13                                 ` Sergei Organov
2007-11-14 19:32                               ` Junio C Hamano
2007-11-14 20:16                                 ` Bill Lear [this message]
2007-11-14 20:22                                   ` Bill Lear
2007-11-14 20:30                                   ` Wincent Colaiuta
2007-11-14 20:58                                   ` Johannes Schindelin
2007-11-14 23:38                                     ` Bill Lear
2007-11-15  0:28                                       ` Johannes Schindelin
2007-11-15  8:42                                       ` Andreas Ericsson
2007-11-15  1:16                                 ` David Kastrup
2007-11-15  8:51                                   ` Andreas Ericsson
2007-11-15 12:44                                     ` Johannes Schindelin
     [not found]                                     ` <?= =?ISO-8859-1?Q?Pine.=04LNX.4.64.0?= =?ISO-8859-1?Q?711151330300.167?= =?ISO-8859-1?Q?28@wbgn129.bioze?= =?ISO-8859-1?Q?ntrum.uni-wuerzb?= =?ISO-8859-1?Q?urg.de>
2007-11-15 13:15                                       ` David Kastrup
2007-11-15  6:19                                 ` Jeff King
2007-11-18  0:25                                 ` Jeff King
2007-11-18  1:06                                   ` Junio C Hamano
2007-11-18  3:25                                     ` Jeff King
2007-11-12 18:55                   ` Jan Wielemaker
2007-11-12 17:55                 ` Bill Lear
2007-11-12 17:33             ` Nicolas Pitre
2007-11-12 17:54               ` Johannes Schindelin
2007-11-12 18:16                 ` Nicolas Pitre
2007-11-12 19:17                 ` Andreas Ericsson
2007-11-12 21:59                   ` Junio C Hamano
2007-11-12 22:49                     ` Jakub Narebski
     [not found]           ` <Pine.LNX.4.64.0?= =?ISO-8859-1?Q?711121715090.436?= =?ISO-8859-1?Q?2@racer.site>
2007-11-12 17:32             ` David Kastrup
2007-11-12 16:39       ` Jakub Narebski
2007-11-12 14:20   ` David Tweed
2007-11-12 16:17   ` David Kastrup
2007-11-12 16:37     ` Jakub Narebski
2007-11-12 16:54       ` David Kastrup

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=18235.22445.16228.535898@lisa.zopyra.com \
    --to=rael@zopyra.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=Matthieu.Moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=osv@javad.com \
    --cc=wielemak@science.uva.nl \
    /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).