How to setup branch tracking when starting local?

2012-02-07 Thread Thomas Koch
Hi,

I've written a twoline script that sets up the remote for a vcsh repo:

#!/bin/sh
VCSH_REMOTE_BASE=koch.ro:git/vcsh
vcsh $1 remote add origin $VCSH_REMOTE_BASE/$1.git

When I first run mr push I got the complaint:
  No refs in common and none specified; doing nothing.
  Perhaps you should specify a branch such as 'master'.

So I need to cd .config/vcsh/repo.d/MYREPO and do a manual git push origin 
master the first time.

What would be the appropriate git command to put in my above script to setup 
that the master branch should be pushed to origin?

Regards,

Thomas Koch, http://www.koch.ro
___
vcs-home mailing list
vcs-home@lists.madduck.net
http://lists.madduck.net/listinfo/vcs-home


Re: How to setup branch tracking when starting local?

2012-02-07 Thread Brian May
On 7 February 2012 21:41, Thomas Koch tho...@koch.ro wrote:

 #!/bin/sh
 VCSH_REMOTE_BASE=koch.ro:git/vcsh
 vcsh $1 remote add origin $VCSH_REMOTE_BASE/$1.git

Maybe:

#!/bin/sh
VCSH_REMOTE_BASE=koch.ro:git/vcsh
vcsh run $1 remote git add origin $VCSH_REMOTE_BASE/$1.git
vcsh run $1 remote git push origin master

Note that I wouldn't personally use the shortcuts inside a script -
just in the unlikely case you ever have a repository name that
conflicts with a vcsh command.

Also note that this won't work unless there is something to push.

My script I created to add a new repository looks like (note: I use
unison to sync ~/tree between computers).

--- cut ---
#!/bin/sh
set -ex

NAME=$1

git init --bare $HOME/tree/vcsh.repos/$NAME

vcsh init $NAME
vcsh run $NAME git remote add origin ~/tree/vcsh.repos/$NAME

cat  EOF  $HOME/.config/mr/available.d/$NAME.vcsh
[\$HOME/.config/vcsh/repo.d/$NAME.git]
checkout = vcsh clone ~/tree/vcsh.repos/$NAME $NAME
EOF

ln -s ../available.d/$NAME.vcsh $HOME/.config/mr/config.d
--- cut ---

This doesn't do the initial push however, because this needs a commit
to work. At least it does make things a bit easier then doing
everything by hand.
-- 
Brian May br...@microcomaustralia.com.au
___
vcs-home mailing list
vcs-home@lists.madduck.net
http://lists.madduck.net/listinfo/vcs-home