Re: New to git: sorry for obvious question.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Paul Gardiner <osronline@...>
Cc: <git@...>
Date: Monday, February 4, 2008 - 6:50 am

--Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Feb 04, 2008 at 09:56:00AM +0000, Paul Gardiner wrote:

You want git fetch. Git pull also updates the working copy, which you
don't have.

Also, git clone --bare doesn't set up the origin configuration, and I
have to do it by hand:
  git config remote.origin.url "$url"
  git config remote.origin.fetch "+refs/heads/*:refs/heads/*"

As for keeping clones up to date, I include a script I use daily for
that purpose.

--=20
Luciano Rocha <luciano@eurotux.com>
Eurotux Inform=E1tica, S.A. <http://www.eurotux.com/>

--Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=update

#!/bin/bash

cd /media/stuff/src || exit 1

lockf=/tmp/.uprepo.lock
lockfile -60 -l 36000 -r 20 $lockf || exit 1

TL=$((20*60))

running()
{
	kill -0 $* &> /dev/null
}

tl()
{
	local max=$(($1+SECONDS))
	shift
	exec "$@" &
	while running $! &> /dev/null && [ $max -ge $SECONDS ]; do sleep 1; done
	if running $!; then
		kill $! &> /dev/null
		sleep 1
		kill -9 $! &> /dev/null
	fi
}

trap "rm -f $lockf" EXIT

shopt -s dotglob

for i in *.git */*.git; do
	[ -h "$i" ] && continue
	[ -d "$i" ] || continue

	d="${i%/.git}"

	echo $d
	if [ "$d" = "$i" ]; then
		(cd "$d" && tl $TL git fetch) 2>&1 | nocr
	elif [ -d "$i/svn" ]; then
		(cd "$d" && tl $TL git svn fetch) 2>&1 | nocr
	elif [ -e "$d/.cvsurl" ]; then
		(cd "$d" && tl $TL git cvsimport $(<.cvsurl)) 2>&1 | nocr
	elif [ -e "$d/.svnurl" ]; then
		(cd "$d" && tl $TL git svnimport -r $(<.svnurl)) 2>&1 | nocr
	else
		(cd "$d" && tl $TL git pull) 2>&1 | nocr
	fi
done

for i in */*.hg */*/*.hg; do
	[ -h "$i" ] && continue
	[ -d "$i" ] || continue

	d="${i%/.hg}"

	echo $d
	(cd "$d" && tl $TL hg pull)
done

for i in */*_darcs; do
	[ -h "$i" ] && continue
	[ -d "$i" ] || continue

	d="${i%/_darcs}"

	echo $d
	(cd "$d" && tl $TL darcs pull -aq)
done

for i in */.svn; do
	[ -h "$i" ] && continue
	[ -d "$i" ] || continue

	d="${i%/.svn}"

	echo $d
	(cd "$d" && tl $TL svn up -q)
done

for i in */CVS; do
	[ -h "$i" ] && continue
	[ -d "$i" ] || continue

	d="${i%/CVS}"

	echo $d
	(cd "$d" && tl $TL cvs -Q -z3 up -P)
done

--Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=nocr

#!/usr/bin/perl
use warnings;
use strict;

-t && exec "/bin/cat";

undef $/;

my $in = <>;

$in =~ s/^.*\r(?!\n)//gm;

print $in;

--Dxnq1zWXvFF0Q93v--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
New to git: sorry for obvious question., Paul Gardiner, (Mon Feb 4, 5:56 am)
Re: New to git: sorry for obvious question., Luciano Rocha, (Mon Feb 4, 6:50 am)
Re: New to git: sorry for obvious question., Boaz Harrosh, (Mon Feb 4, 9:10 am)
Re: New to git: sorry for obvious question., Paul Gardiner, (Mon Feb 4, 10:17 am)
Re: New to git: sorry for obvious question., Paul Gardiner, (Mon Feb 4, 8:04 am)
Re: New to git: sorry for obvious question., Matthieu Moy, (Mon Feb 4, 6:27 am)
Re: New to git: sorry for obvious question., Paul Gardiner, (Mon Feb 4, 6:41 am)
Re: New to git: sorry for obvious question., Boaz Harrosh, (Mon Feb 4, 6:51 am)