Netinstall does all sorts of neat things when configuring, but while it
sets up a master branch for the msysgit, it doesn't seem to do this for
git. Instead, it appears to directly check out a commit, making the git
repos a detached head. This causes problems if you try to git pull later.

Is there any particular reason why netinstall doesn't set up the master
branch just like it does for msysgit? It seems to me there would be a
very good reason, but I can't figure out how I would get git to update
without making my own master branch tracking origin/master.

Here's a patch if we decide to change the behavior:

commit 627663d1a342467c104af731b34d55d544d0e12a
Author: Edward Z. Yang <[EMAIL PROTECTED]>
Date:   Mon Jun 23 00:07:08 2008 -0400

    Setup master branch tracking origin/master during netinstall
    
    Previously, the setup script checked the git submodule tree structure
    to determine what commit to check out. However, doing this leaves
    the checkout branchless, and thus difficult to update without
    checking out another commit. The modified script sets up a local
    master branch which tracks the remote master branch, and also
    removes some unnecessary configuration setting for this branch.
    
    Signed-off-by: Edward Z. Yang <[EMAIL PROTECTED]>

diff --git a/share/msysGit-netinstall/setup-msysgit.sh 
b/share/msysGit-netinstall/setup-msysgit.sh
index 1fa788c..ce43cb0 100644
--- a/share/msysGit-netinstall/setup-msysgit.sh
+++ b/share/msysGit-netinstall/setup-msysgit.sh
@@ -52,8 +52,6 @@ git init &&
 git config remote.origin.url $MSYSGIT_REPO_GIT &&
 git config remote.origin.fetch \
        +refs/heads/@@MSYSGITBRANCH@@:refs/remotes/origin/@@MSYSGITBRANCH@@ &&
-git config branch.master.remote origin &&
-git config branch.master.merge refs/heads/@@MSYSGITBRANCH@@ &&
 git config remote.mob.url $MSYSGIT_REPO_GIT_MOB &&
 git config remote.mob.fetch +refs/remote/mob:refs/remotes/origin/mob &&
 git config remote.mob.push master:mob &&
@@ -117,14 +115,7 @@ git fetch mingw &&
 git config remote.origin.url $MINGW4MSYSGIT_REPO_URL &&
 git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' &&
 git fetch origin &&
-if test -z "@@FOURMSYSGITBRANCH@@"
-then
-       FOURMSYS=$(cd .. && git ls-tree HEAD git |
-               sed -n "s/^160000 commit \(.*\) git$/\1/p")
-else
-       FOURMSYS=origin/@@FOURMSYSGITBRANCH@@
-fi &&
-git checkout -l -f -q $FOURMSYS ||
+git checkout -l -f -q -b master origin/master ||
 error Couldn\'t update submodule git!
 
 echo

Reply via email to