git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eugene Sajine <euguess@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: global hooks - once again
Date: Fri, 2 Jul 2010 15:47:48 -0400	[thread overview]
Message-ID: <AANLkTikMEDUI7d5Mzwm8r43zCYTqefyI06PHOMvT1iLz@mail.gmail.com> (raw)
In-Reply-To: <7v630x1yl8.fsf@alter.siamese.dyndns.org>

On Fri, Jul 2, 2010 at 3:18 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Eugene Sajine <euguess@gmail.com> 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

  reply	other threads:[~2010-07-02 19:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02 16:23 global hooks - once again Eugene Sajine
2010-07-02 18:03 ` Jonathan Nieder
2010-07-02 19:30   ` Eugene Sajine
2010-07-02 19:18 ` Junio C Hamano
2010-07-02 19:47   ` Eugene Sajine [this message]
2010-07-05 10:03     ` Peter Kjellerstedt
2010-07-06 12:14       ` Alex Riesen
2010-07-06 12:23         ` Eugene Sajine
2010-07-06 14:55           ` Peter Kjellerstedt
2010-07-06 15:00             ` demerphq
2010-07-06 15:32               ` Eugene Sajine
2010-07-06 12:20       ` Eugene Sajine
2010-07-06 14:34     ` demerphq
2010-07-02 20:53   ` Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikMEDUI7d5Mzwm8r43zCYTqefyI06PHOMvT1iLz@mail.gmail.com \
    --to=euguess@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).