Skip to content

new tool: git hooks (pre-push, pre-commit) #160

Description

@joyeecheung
  1. Should be a symlink in .git/hooks/pre-push
  2. Use the remote and branch config that we have, stop users from pushing invalid commits, especially merge commits.

Activity

  1. added
    new toolNew tool that could be added to node-core-utils
    feature requestNew features for node-core-utils
    on Jan 27, 2018
  2. priyank-p commented on Jan 27, 2018

    @priyank-p
    Contributor

    I worked on creating pre-push hook before, we can surely implement it. Alternatively we can also have pre-commit that runs linter only if the user wants.

  3. alopezsanchez commented on Feb 10, 2018

    @alopezsanchez
    Contributor

    Questions:

    • This hook will be only for node-core-utils project, it will be a tool for collaborators of all Node.js projects, or a tool for any contributor?
    • Language of the script? Bash, Node...?

    I can work of it if you don't have any inconveniences.

  4. joyeecheung commented on Feb 11, 2018

    @joyeecheung
    MemberAuthor

    This hook will be only for node-core-utils project, it will be a tool for collaborators of all Node.js projects, or a tool for any contributor?

    For node core, I think. It's just a script that people can symlink to, we can ask the users if they want to symlink that during the npm post-install hook. People can also symlink to other repos if they want.

    Language of the script? Bash, Node...?

    Well I guess it'll need to read the .ncu/config at some point, which is JSON (also might need to read the global ~/.ncurc), so it'll be easier to write that in Node

  5. priyank-p commented on Feb 11, 2018

    @priyank-p
    Contributor

    Language of the script? Bash, Node...?

    Yep, agreed that it should be in node. But the symlinked script must be in bash, since windows also supports bash in git hooks.

    And furthermore in the .git/hooks folder you need to make sure that you remove the .sample file for the hook since sometimes this causes the hook to not run.

    Lastly, the hook should output info about using --no-verify flag to skip this hook.

  6. changed the title [-]new tool: pre-push git hook[/-] [+]new tool: git hooks (pre-push, pre-commit)[/+] on Mar 11, 2018
  7. self-assigned this
    on Mar 11, 2018
  8. priyank-p commented on Mar 11, 2018

    @priyank-p
    Contributor

    Should this be its own ncu-git-hooks or be part of git node git node hooks? (This will be used to install/uninstall hooks)

    What should it run make -j4 test and make lint for pre-commit and core-validate-commit for pre-push?

    (I plan to work on this, After some issues, labeled bugs are fixed).

  9. added a commit that references this issue on Aug 21, 2018
  10. github-actions commented on Aug 17, 2020

    @github-actions
    Contributor

    This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature requestNew features for node-core-utilsnew toolNew tool that could be added to node-core-utilsstale

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions