public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Martin Schlemmer <azarah@nosferatu•za.org>
To: GIT Mailing Lists <git@vger•kernel.org>
Subject: Pasky problem with 'git init URL'
Date: Thu, 21 Apr 2005 18:21:58 +0200	[thread overview]
Message-ID: <1114100518.17551.31.camel@nosferatu.lan> (raw)

[-- Attachment #1: Type: text/plain, Size: 2267 bytes --]

Hi,

Just pulled linux-2.6.git, and got this:

----
New branch: 3a6fd752a50af92765853879f4a11cc0cfcd0320
Tracked branch, applying changes...
Merging 4d78b6c78ae6d87e4c1c8072f42efa716f04afb9 -> 3a6fd752a50af92765853879f4a11cc0cfcd0320
        to a2755a80f40e5794ddc20e00f781af9d6320fafb...

Enter commit message, terminated by ctrl-D on a separate line:
Merge with 3a6fd752a50af92765853879f4a11cc0cfcd0320
----

Weird thing was that I made no changes.

Digging a bit deeper, I saw that .git/HEAD was a symlink
to .git/heads/master, and the tracked branch was 'origin'.  Due to the
fact that Linus only have a .git/heads/master on his rsync, and this
thus updated to the new sha1, but the 'origin' (and tracked) head is
still pointing to an older sha1 caused this confusion.

I replicated the linux tree via:

----
git init URL
----

So I had a look at gitinit.sh, which first creates the .git/heads/master
and symlinks HEAD to it, then on seeing a URL was supplied, creates
a .git/heads/origin, track it, but do *not* change the .git/HEAD
symlink ... Is this intended?  I see also that gittrack.sh do not update
the HEAD symlink ...  Is this also intended?

I guess a solution is to either just use 'master', and do not do the
'origin' head, or to update the HEAD symlink.  I however do not think
this is very generic, especially if the remote repo do not call their
main head 'master' - so it might be better to check what it have
in .git/heads, and if only one, use that as the main and tracked head,
else do nothing and tell the user to decide what head to track, etc.

The last option however brings a problem or two.  First, how do you do
the multi-head thing?  Maybe add a command 'git lsheads' (and while at
it, also add 'git lstags'?)?  Secondly, if there was more than one head,
the local copy needs to be checked out ... don't know if 'git cancel' is
the logical thing the user will think to do ('git clone' perhaps?) ...

I think it might be a good time to start thinking and putting to text
what commands is really needed, what they should be called, and how
exactly they should behave before it gets much later in the game.

Anyhow, suggestions/comments welcome.


Thanks,

-- 
Martin Schlemmer


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2005-04-21 16:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-21 16:21 Martin Schlemmer [this message]
2005-04-21 20:29 ` Pasky problem with 'git init URL' Petr Baudis
2005-04-21 21:15   ` John Stoffel
2005-04-21 21:26     ` Petr Baudis
2005-04-22 12:44       ` John Stoffel
2005-04-21 21:57     ` Fabian Franz
2005-04-21 21:17   ` Martin Schlemmer

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=1114100518.17551.31.camel@nosferatu.lan \
    --to=azarah@nosferatu$(echo .)za.org \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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