[Insight-developers] Utilities/hooks.sh
Gaëtan Lehmann
gaetan.lehmann at jouy.inra.fr
Wed Oct 6 12:49:11 EDT 2010
I guess dev.sh can be something like that:
#!/usr/bin/env bash
# make sure that the testing data is there
git submodule update --init
# the url to push to
git config remote.origin.pushurl git at itk.org:ITK.git
# configure ssh, if needed
if [ ! -f ~/.ssh/config ] || ["`grep 'Host itk.org' ~/.ssh/config`" ==
""]; then
mkdir -p ~/.ssh
chmod og-rwx -p ~/.ssh
echo "Host itk.org" >> ~/.ssh/config
echo " IdentityFile=~/.ssh/id_git_itk" >> ~/.ssh/config
echo "Please copy you private ssh key for ITK to ~/.ssh/id_git_itk"
fi
# user.name and user.email must be set
if [ "`git config user.name`" == "" ]; then
read -ep "Your full name: " name
git config user.name $name
fi
if [ "`git config user.email`" == "" ]; then
read -ep "Your email adress: " email
git config user.email $email
fi
# advise to use the color
if [ "`git config color.ui`" != "auto" ]; then
echo "You may want to enable color output from Git commands with"
echo " git config --global color.ui auto"
fi
# configure hooks
# copy/paste hooks.sh or maybe call it from there
# configure topic stage
git remote add stage git://itk.org/stage/ITK.git
git config remote.stage.pushurl git at itk.org:stage/ITK.git
# configure gerrit
read -ep "Your gerrit user [$USER]: " gu
if [ "$gu" == "" ]; then
# use current user name
gu=$USER
fi
git remote add gerrit $gu at review.source.kitware.com:ITK
It is only an untested draft - I'll wait for Brad D. reply to work
more on that.
Gaëtan
Le 6 oct. 10 à 16:51, Matthew McCormick (thewtex) a écrit :
> Thanks all for your patience. Nice catch, Brad K. That was tricky.
>
> Brad D., did you have anything already done, as Hans suggested, to
>
> use gerrit
> use the topic stage
> push to itk.org
> check for .git/.git
>
> If not, I can put together a draft.
>
> Thanks,
> Matt
>
> On Wed, Oct 6, 2010 at 9:34 AM, Bill Lorensen
> <bill.lorensen at gmail.com> wrote:
> So, now you have convinced me that this setup script is valuable.
>
> Strange that I made the same stupid mistake on two different systems.
>
> I deleted it and reran the script. Now it works!
>
> Thanks for your patience.
>
> I'll complete my review now.
>
> Bill
>
> On Wed, Oct 6, 2010 at 10:28 AM, Brad King <brad.king at kitware.com>
> wrote:
> > On 10/06/2010 10:13 AM, Bill Lorensen wrote:
> >> On Wed, Oct 6, 2010 at 10:11 AM, Brad King
> <brad.king at kitware.com> wrote:
> >>> On 10/06/2010 10:01 AM, Bill Lorensen wrote:
> >>>> Bill at BILLSLAPTOP ~/ProjectsGIT/ITK/.git/hooks (master)
> >>>> $ git ls-remote ..
> >>>> 48e72dd1cd9ebefae0006cba0fafd6a09928bc8c HEAD
> >>>> 48e72dd1cd9ebefae0006cba0fafd6a09928bc8c refs/heads/master
> >>>
> >>> Does "~/ProjectsGIT/ITK/.git/.git" exist? It shouldn't, but it
> >>> could cause this problem.
> >>
> >> Yes.
> >
> > Delete it. You must have run "git init" under ".git" once instead
> > of ".git/hooks".
> >
> > The "dev.sh" setup script under discussion elsewhere in this thread
> > should be taught to detect this erroneous case.
> >
> > -Brad
> >
>
--
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66 fax: 01 34 65 29 09
http://voxel.jouy.inra.fr http://www.itk.org
http://www.mandriva.org http://www.bepo.fr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20101006/267613ea/attachment.pgp>
More information about the Insight-developers
mailing list