[Insight-developers] Utilities/hooks.sh

Bill Lorensen bill.lorensen at gmail.com
Wed Oct 6 14:02:50 EDT 2010


Maybe we need multiple SetupFoo.sh scripts. Right now, you need to
copy/paste from a few different locations.

For instance
SetupGerrit.sh
SetupTopicStage.sh
SetupHooks.sh

Maybe later:
SetupBranchyWorkflow.sh ?

They could all reside in Utilities/SetupScripts

An overall Setup.sh script can do them all... and others as we add
them. They should all work if invoked a second time. Also, as Matt's
script already does, they should be runnable from anywhere.

Bill

2010/10/6 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>:
>
> 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
>
>


More information about the Insight-developers mailing list