{"id":35243685,"url":"https://github.com/picojr/submodule-hook","last_synced_at":"2026-01-13T14:01:28.518Z","repository":{"id":327787615,"uuid":"1110543584","full_name":"PicoJr/submodule-hook","owner":"PicoJr","description":"Ask confirmation when submodules could be involved in a commit","archived":false,"fork":false,"pushed_at":"2025-12-15T21:06:53.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-19T03:53:14.758Z","etag":null,"topics":["git","precommit-hooks","rust","submodule"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PicoJr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-05T10:56:10.000Z","updated_at":"2025-12-15T21:06:56.000Z","dependencies_parsed_at":"2025-12-09T07:08:38.022Z","dependency_job_id":null,"html_url":"https://github.com/PicoJr/submodule-hook","commit_stats":null,"previous_names":["picojr/submodule-hook"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PicoJr/submodule-hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PicoJr%2Fsubmodule-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PicoJr%2Fsubmodule-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PicoJr%2Fsubmodule-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PicoJr%2Fsubmodule-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PicoJr","download_url":"https://codeload.github.com/PicoJr/submodule-hook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PicoJr%2Fsubmodule-hook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28387596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T13:42:20.960Z","status":"ssl_error","status_checked_at":"2026-01-13T13:42:03.276Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","precommit-hooks","rust","submodule"],"created_at":"2025-12-30T05:33:49.973Z","updated_at":"2026-01-13T14:01:28.512Z","avatar_url":"https://github.com/PicoJr.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Crates.io](https://img.shields.io/crates/v/submodule-hook.svg)](https://crates.io/crates/submodule-hook)\n\n# Pre Commit Submodule Hook\n\nThis pre-commit hook asks you to confirm when submodules are either:\n* modified and not staged for commit\n* modified and staged for commit\n\nIt looks like this (YMMV) if you configure it as your pre-commit hook:\n\n```\n? The following submodules are modified but not staged for commit:\n* sub2 (`git add sub2` to add submodule to staging)\nThe following submodules are modified and staged for commit:\n* sub (`git restore --staged sub` to remove submodule from staging)\nDo you wish to continue anyway? (y/n) › no\n```\n\n## Install and configure it as my `pre-commit` hook\n\n### From crates.io (recommended)\n\n1. install it: `cargo install submodule-hook`\n2. install it as your `pre-commit` hook: `cp $(which submodule-hook) .git/hooks/pre-commit`\n\n### From source\n\n1. compile it: `cargo build --target=x86_64-unknown-linux-musl --release`\n2. install it as your `pre-commit` hook: `cp target/x86_64-unknown-linux-musl/release/submodule-hook .git/hooks/pre-commit`\n\n### Try it without setting it as a `pre-commit` hook\n\n```\nsubmodule-hook --repo \u003cpath-to-your-repo\u003e\n```\n\n## Uninstall\n\nRemove the hook using: `rm .git/hooks/pre-commit`\n\nIf you installed it from crates.io, you can remove the binary from your `~/.cargo/bin` directory using: `cargo uninstall submodule-hook`\n\n## Configuration\n\nConfiguration is evaluated in this order:\n\n1. global `~/.gitconfig`\n2. local `.git/config`\n3. CLI parameters cf `cargo run -- --help`\n4. if no configuration is found it assumes `strict = false`, `staging = true`, `notstaging = true`\n\nIt means the CLI prioritizes the CLI parameters, then local config, then global config.\n\nEdit local `.git/config` or global `~/.gitconfig`\n\n```toml\n[submodulehook]\n    # if true the hook will fail when opening repository or submodule fails\n    strict = false\n    # if true also ask for confirmation before commit when a submodule is modified and staged\n    staging = true\n    # if true also ask for confirmation before commit when a submodule is modified and not staged\n    notstaging = true\n```\n\n\u003e if both `staging` and `notstaging` are set to `false` then the hook will be disabled\n\nOr use `git config`:\n\n```\ngit config submodulehook.strict false\ngit config submodulehook.staging true\ngit config submodulehook.notstaging true\n```\n\n## Debug\n\ndebug logs can be enabled using `RUST_LOG=debug`:\n\n```\nRUST_LOG=debug submodule-hook --repo \u003cpath-to-your-repo\u003e\n```\n\n## Exit Code\n\n* `0` if the hook ran without errors and the user chose to continue when prompted for confirmation\n* `1` if the user chose not to continue when prompted for confirmation\n* `3` if an error occurred during submodule checking\n* `130` if the user `ctrl-c` the hook\n\n## CHANGELOG\n\nPlease see the [CHANGELOG](CHANGELOG.md) for a release history.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicojr%2Fsubmodule-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpicojr%2Fsubmodule-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicojr%2Fsubmodule-hook/lists"}