Re: [PATCH v2] hooks: propose project configured hooks

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

 



On Mon, Apr 5, 2021 at 5:14 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> Albert Cui <albertqcui@xxxxxxxxx> writes:
>
> > I'm a little confused, and maybe it's because we have different
> > definitions of what "installing hooks" means. By installing hooks,
> > I meant the addition of the hook command to the config, e.g the
> > outcome of:
> >
> > `git config --add hook.pre-commit.command pylint`
>
> Yeah, I was envisioning that it won't be as a simple, mechanical and
> unconditional single command invocation.  Rather, the 'pylint' part
> would have to become different depending on the environment (e.g.
> what operating system you are on, what editor you prefer, etc.).
> And the part that decides what kind of environment you are on would
> have to be written by the project that controls the "project-managed
> hooks"---unfortunately that would most likely to be an error-prone
> part.
>

I don't see a need for that. At least, this doesn't feel part of the
"minimum feature set."

I don't think any existing solutions for hooks management handle this,
so it feels fine to push this part to the project. As you said, if
they wanted this, I'd expect `git config --add hook.pre-commit.command
lint.sh` where lint.sh does whatever cross-platform magic is required.

I wouldn't expect a lot of need for this anyway; I'd expect most hooks
to depend on tools that already work cross-platform (e.g. pylint) or
be hooks written in the programming environment of the project, so the
toolchain should already be in place to execute the hooks.



[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]

  Powered by Linux