Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pre-push githook natively #19

Closed
blaggacao opened this issue Sep 28, 2020 · 1 comment
Closed

Support pre-push githook natively #19

blaggacao opened this issue Sep 28, 2020 · 1 comment

Comments

@blaggacao
Copy link
Contributor

blaggacao commented Sep 28, 2020

#18 provides for use cases of pre-push hooks specifically. #16 (comment) provides analysis for why a lightweight implementation is superior beyond the mere benefit of being leightweight.

That means, the consolidated intended use case does not require git workdir management. What's worse, providing such would induce misinterpretations about the consolidated intended use case.

Therefore, it is proposed for devshell to arrange for:

  • A simple command sequence

    • that is defined in devshell's standard interfaces
    • and that is executed in order
    • in the context of the repo's root and within debshell env
    • by a devshell library facility
    • which is symlinked to .git/hooks/pre-push.
  • The facility is capable of detecting modified files against the reference git ref,

    • which in the case of pre-push
    • is origin's HEAD.
  • The facility passes the modified files list

    • as last variadic argument
    • to each command in the list.
  • The command itself needs to arrange for

    • handling this variadic last argument (discarding if necessary),
    • filtering on file types against this variadic last argument
      • devshell may provide a configurable generic wrapper script for filtering, that supports configurable matching through:
        • regex include
        • regex exclude
        • as well as identify
@zimbatm
Copy link
Member

zimbatm commented Feb 14, 2021

The git.hooks extra module now allows to build on top of it.

@zimbatm zimbatm closed this as completed Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants