Re: global hooks - once again

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 2, 2010 at 3:18 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Eugene Sajine <euguess@xxxxxxxxx> writes:
>
>> For example, so i could say
>> $ git config --global hooks.dir ~/git/hooks
>
> I don't think "global" hooks are useful for people who work on more than
> one project, or people who interact in more than one ways to projects.
> Different projects typically have different needs out of the hooks
> (e.g. pre-commit policy), and different workflows typically call for
> different needs out of the hooks (e.g. I would want to be able to rebase
> in my private working repository but not in the repository I use for
> integration of other people's branches).
>
> So I am fairly negative on your particular example above.


Well, you forgot about another half of users that are working with
many projects but using one policy for example in one company, or if
the guy works with several projects, but wants some of his custom
hooks to be applied for all his repos/projects, for example if he want
some general actions to be executed before commit, like spell check of
the commit message. If I have 40 repos --global approach is the way to
go.
In addition, i don't think there is a downside in this particular
example as it is not a mandatory property that I propose. If you need
a global hook there should be an easy way to work with it. If you
don't need it - just don't touch anything and work on per repo basis.

>
> But it is understandable for one to use more than one repository for the
> same project and use them in the same way; in such a case, I agree that a
> way to ensure that these repositories use the same set of hooks (and
> non-hooks, e.g. commit templates, local ignore pattern files, etc.) is
> desirable.
>
> So I would imagine that your example without "--global" would be a
> reasonable thing to do once per repository.

once again it is only a part of use cases. there might be several
repos/projects for one user. --global is necessary option
I'm talking about user level hooks. He has no admin access to
/usr/local/ and too many repos to deal with each one of them and set
up hooks per repo.


>   [alias]
>   set-hooks = !"sh -c 'rm -fr .git/hooks && ln -s $1 .git/hooks' -"

This is good one, but not enough. Not that it is too difficult to
execute it 40 times, but just the fact that in order to understand how
to do that i had to write to git list;) Having it in git config makes
it straight forward for end user and much user "friendlier"

Thanks,
Eugene
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]