git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Carl Worth <cworth@cworth.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	Barry Fishman <barry_fishman@acm.org>,
	git@vger.kernel.org
Subject: Re: Problems setting up bare repository (git 1.5.3.3)
Date: Mon, 1 Oct 2007 19:35:46 -0400	[thread overview]
Message-ID: <20071001233546.GG2137@spearce.org> (raw)
In-Reply-To: <87bqbisae6.wl%cworth@cworth.org>

Carl Worth <cworth@cworth.org> wrote:
> $ git push /pub/git/foo.git master
> 
> Is there any reason that that shouldn't be interpreted as
> "master:master" and that that would in turn be interpreted as "create
> a remote refs/heads/master" ?

This is actually read more as:

 1) Expand "master" to "refs/heads/master"
 2) Expand "refs/heads/master" to "refs/heads/master:refs/heads/master"

We first try to expand the local name to an "absolute" local name,
then if the remote name is missing default it to the same as the
(now expanded) local name.  So "push origin master" is not read as
"push origin refs/haeds/master:master".

> PS. As someone who has written some new-user documentation for git,
> there are a few low-level git notions that I would like to avoid in
> that documentation. For example, one is FETCH_HEAD. In my first
> attempt at porting hgbook-chapter2 to git I found myself using
> FETCH_HEAD to simulate "hg incoming". Thankfully, I was able to
> rewrite it by taking advantage of remotes and using "master..origin"
> instead.

How about:

  git config alias.incoming 'log ..FETCH_HEAD'

?  Or do we need --reverse in there too to simulate "hg incoming"?
The thing is, FETCH_HEAD is a lot more powerful than a tracking
branch.  It can contain objects randomly pulled from another
repository (e.g. one shot pulls).
 
> Another example is "refs/heads". I avoided this partially by inly
> documenting how to push all branches with "--all", but I'd much rather
> be able to say that the user could git push URL branch
> another-branch..." or "git push URL --all" for convenience. Finally,
> git-push itself spews quite a bit of output with "refs/heads" in it
> that I don't think is useful at all. For talking with the user, git
> should say "branch master" not "refs/heads/master".

Agreed.  We do that in fetch.  We should do that in push.  We should
only mention "refs/*" if the user is pushing something funny, e.g.
pushing into the remote tracking branch space.  Or the stash.  Etc.
Tags and normal branches should be denoted as such.

-- 
Shawn.

  parent reply	other threads:[~2007-10-01 23:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-01 21:46 Problems setting up bare repository (git 1.5.3.3) Barry Fishman
2007-10-01 22:32 ` Junio C Hamano
2007-10-01 23:06   ` Carl Worth
2007-10-01 23:17     ` J. Bruce Fields
2007-10-01 23:24     ` Junio C Hamano
2007-10-01 23:47       ` Carl Worth
2007-10-01 23:35     ` Shawn O. Pearce [this message]
2007-10-02  9:46     ` Johannes Schindelin
2007-10-02 13:54       ` Barry Fishman
2007-10-02 17:40         ` Johannes Schindelin
2007-10-02 19:54           ` Barry Fishman
2007-10-02 15:39       ` Carl Worth
2007-10-02 17:45         ` Johannes Schindelin
2007-10-02 18:23           ` Junio C Hamano
2007-10-02 18:55             ` Sean
2007-10-02 19:09               ` Junio C Hamano
2007-10-02 21:02                 ` Johannes Schindelin
2007-10-02 20:59               ` Johannes Schindelin

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=20071001233546.GG2137@spearce.org \
    --to=spearce@spearce.org \
    --cc=barry_fishman@acm.org \
    --cc=cworth@cworth.org \
    --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).