Skip to content

sourceallies/commit-collective

Repository files navigation

Build / Test

SA Git Hook

SA Git Hook is a post commit hook that sends commit stats to lambda that is used to populate a commit stats leaderboard.

Disclaimer: Do not use this hook without explicit client approval

This hook will send traffic to a url upon each local commit. Security analysis may find that this git metadata could be used to identify repos, partners, file types, and languages. When consulting, do not use this hook on client computers nor client repos without having a conversation and receiving explicit permission.

Links

Dashboard

Collected Data

Config

  • Username
  • Team name

Commit Stats

  • Number of insertions from a commit
  • Number of deletions from a commit
  • Number of files changed
  • Language of the files changed

Example payload

{
  "username": "test username",
  "team_name": "team name",
  "insertions": 13,
  "deletions": 28,
  "files_changed": 3,
  "extension": [
    ".rs",
    ".yaml"
  ]
}

Recommended Install

Steps

  1. Grab the binaries for your platform under Releases zip file
  2. Go into the platform directory (Windows or macOS) by cd or dir into those directories.
  3. Run the install binary (.exe for Windows)

Manual Install

Requirements

  • Installed Rust
  • (Windows only) Install Git Bash
    • cargo must be in your path

Steps

Windows users: Do the following in a Git Bash terminal

  1. Clone this repo

  2. In the Hookstaller directory, run the install.sh script

    cd SA-Git-Hook/Hookstaller
    ./install.sh
  3. Follow the steps given in the prompt

Manual install for a specific repo

Copy the post-commit executable (/Hookstaller/target/release/post-commit) to the .git/hooks directory of a given repo.

cp ./Hookstaller/target/release/post-commit $(YOUR_REPO_NAME)/.git/hooks)

Uninstall

If installed globally

Run git config --global --unset core.hooksPath

Per repository

Remove the post-commit executable in the .git/hooks/ directory in the repository you would like to remove the hook from.

Authors

Active

Reserve