From: Jay Soffian <jaysoffian@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: George Spelvin <linux@horizon.com>,
gitster@pobox.com, git@vger.kernel.org
Subject: Re: receive.denyCurrentBranch
Date: Sun, 8 Feb 2009 12:50:36 -0500 [thread overview]
Message-ID: <76718490902080950r798ca02es4e560da35e499046@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0902081128420.10279@pacific.mpi-cbg.de>
On Sun, Feb 8, 2009 at 5:30 AM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> It's insane, that's what it is.
>
> You have _no_ business meddling with a remote working directory, _except_
> by logging into that machine and working on that working directory
> _directly_.
>
> If you do not agree, you have not thought about the implications, i.e.
> what problems you buy.
Just by way of providing an additional perspective, I thought I'd illustrate
how Mercurial handles this situation:
$ mkdir repoA
$ cd repoA
repoA$ hg init
repoA$ echo foo > foo
repoA$ hg add foo
repoA$ hg commit -m "added foo"
repoA$ cd ..
$ hg clone repoA repoB
updating working directory
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd repoA
repoA$ cat >> .hg/hgrc <<EOF
> [paths]
> default = ../repoB
> EOF
repoA$ echo bar > bar
repoA$ hg add bar
repoA$ hg commit -m "added bar"
repoA$ hg push
pushing to /Users/jay/repoB
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
repoA$ cd ../repoB
repoB$ hg parents
0 d32c3edefcba 2009-02-08 11:18 -0500 jaysoffian
added foo
repoB$ hg glog
o 1[tip] 8e0a16e691f4 2009-02-08 11:19 -0500 jaysoffian
| added bar
|
@ 0 d32c3edefcba 2009-02-08 11:18 -0500 jaysoffian
added foo
repoB$ echo baz > baz
repoB$ hg add baz
repoB$ hg commit -m "added baz"
created new head
repoB$ hg parents
2[tip]:0 8d7db8257fd0 2009-02-08 11:19 -0500 jaysoffian
added baz
repoB$ hg glog
@ 2[tip]:0 8d7db8257fd0 2009-02-08 11:19 -0500 jaysoffian
| added baz
|
| o 1 8e0a16e691f4 2009-02-08 11:19 -0500 jaysoffian
|/ added bar
|
o 0 d32c3edefcba 2009-02-08 11:18 -0500 jaysoffian
added foo
Now let's look at what happens if I pull from B, instead of pushing from A:
$ rm -rf repoA repoB
$ mkdir repoA
$ cd repoA
repoA$ hg init
repoA$ echo foo > foo
repoA$ hg add foo
repoA$ hg commit -m "added foo"
repoA$ cd ..
$ hg clone repoA repoB
updating working directory
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd repoA
repoA$ echo bar > bar
repoA$ hg add bar
repoA$ hg commit -m "added bar"
repoA$ cd ../repoB
repoB$ hg pull
pulling from /Users/jay/repoA
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
callisto:~/repoB$ hg parents
0 1adbe0643fb7 2009-02-08 11:22 -0500 jaysoffian
added foo
repoB$ hg glog
o 1[tip] 66a5c6395cfc 2009-02-08 11:22 -0500 jaysoffian
| added bar
|
@ 0 1adbe0643fb7 2009-02-08 11:22 -0500 jaysoffian
added foo
repoB$ echo baz > baz
repoB$ hg add baz
repoB$ hg commit -m "added baz"
created new head
repoB$ hg parents
2[tip]:0 cb8f0c639bd4 2009-02-08 11:23 -0500 jaysoffian
added baz
repoB$ hg glog
@ 2[tip]:0 cb8f0c639bd4 2009-02-08 11:23 -0500 jaysoffian
| added baz
|
| o 1 66a5c6395cfc 2009-02-08 11:22 -0500 jaysoffian
|/ added bar
|
o 0 1adbe0643fb7 2009-02-08 11:22 -0500 jaysoffian
added foo
What I especially like about Mercurial here is that pushing from A is
perfectly symetrical to pulling from B.
With git, cloning sets things up to fetch into a tracking branch, but then the
push is not symetric to the fetch. That makes sense if you're cloning from a
bare repo, but I think leads to confusion for new users when they clone a
non-bare repo they wish to later push into. I dunno, I guess we'll see if the
new message helps any.
j.
next prev parent reply other threads:[~2009-02-08 17:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-08 4:29 receive.denyCurrentBranch George Spelvin
2009-02-08 6:43 ` receive.denyCurrentBranch Junio C Hamano
2009-02-08 10:30 ` receive.denyCurrentBranch Johannes Schindelin
2009-02-08 17:50 ` Jay Soffian [this message]
2009-02-08 20:54 ` receive.denyCurrentBranch Johannes Schindelin
2009-02-08 22:16 ` receive.denyCurrentBranch Jay Soffian
2009-02-08 22:51 ` receive.denyCurrentBranch Jay Soffian
2009-02-08 23:41 ` receive.denyCurrentBranch Johannes Schindelin
2009-02-09 1:38 ` receive.denyCurrentBranch Junio C Hamano
2009-02-09 1:47 ` receive.denyCurrentBranch Jay Soffian
2009-02-09 5:06 ` receive.denyCurrentBranch Theodore Tso
2009-02-09 11:06 ` receive.denyCurrentBranch Johannes Schindelin
2009-02-09 15:46 ` receive.denyCurrentBranch Jay Soffian
2009-02-09 15:43 ` receive.denyCurrentBranch Jay Soffian
2009-02-08 22:03 ` receive.denyCurrentBranch Jakub Narebski
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=76718490902080950r798ca02es4e560da35e499046@mail.gmail.com \
--to=jaysoffian@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=linux@horizon.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).