{"id":27433500,"url":"https://github.com/jryio/commit-comments","last_synced_at":"2025-07-04T12:08:13.610Z","repository":{"id":71574104,"uuid":"49220760","full_name":"jryio/commit-comments","owner":"jryio","description":"Build commit message in the comments of your code","archived":false,"fork":false,"pushed_at":"2016-02-16T03:52:52.000Z","size":15,"stargazers_count":309,"open_issues_count":6,"forks_count":9,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-14T17:16:42.458Z","etag":null,"topics":["comment","commits","git","hooks","messages"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jryio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-07T17:54:24.000Z","updated_at":"2024-06-28T03:40:26.000Z","dependencies_parsed_at":"2023-02-24T03:45:11.216Z","dependency_job_id":null,"html_url":"https://github.com/jryio/commit-comments","commit_stats":null,"previous_names":["jryio/commit-comments"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jryio/commit-comments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jryio%2Fcommit-comments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jryio%2Fcommit-comments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jryio%2Fcommit-comments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jryio%2Fcommit-comments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jryio","download_url":"https://codeload.github.com/jryio/commit-comments/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jryio%2Fcommit-comments/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263507900,"owners_count":23477407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["comment","commits","git","hooks","messages"],"created_at":"2025-04-14T17:16:37.295Z","updated_at":"2025-07-04T12:08:13.586Z","avatar_url":"https://github.com/jryio.png","language":"Shell","readme":"## Commit Comments\n\nCommit Comments automatically create a bulleted list of changes from comments in your code. Write comments using `@commit` keyword, and they will be added to your commit message when it's time to commit.\n\nIt works by using two [Git hooks](https://www.kernel.org/pub/software/scm/git/docs/githooks.html) (**prepare-commit-m   sg** and **post-commit**) to\nsearch your repository for @commit comments and construct a clean list of\nchanges. \n\nOnce you've successfully committed, @commit comments are removed from\nyour files\n\n### Installation\n\nClone the repository and move the `prepare-commit-msg` and `post-commit` files.\n\n```\n$ git clone https://github.com/thebearjew/commit-comments.git\n$ cd commit-comments\n$ chmod a+x prepare-commit-msg post-commit\n$ cp prepare-commit-msg post-commit your-repository/.git/hooks \n```\n\n### Usage\n\nAs you're writing code, drop `// @commit` comments anywhere a significant change has been made. \n\nCommit comments work with (inline \u0026 standalone):\n\n- C-like comments (C/C++, Java, JavaScript, etc.) `//`, `/* */`\n- Python/Ruby/Perl `#`\n- Assembly `;`\n\nExample:\n\n```js\nfoo.js\n\n// @commit: Added a parameter to helloWorld function\nfunction helloWorld(phrase) {\n  console.log('Hello World + ' + phrase); /*  @commit - Concatenated strings */\n}\n```\n\nOutput in Git commit message\n\n```\n# Commit title goes here\n\n- [foo.js#1] Added a parameter to helloWorld function\n- [foo.js#3] Concatenated strings\n# Changes to be committed:\n#\tmodified:   foo.js \n#\n# Changes not staged for commit:\n# ...\n```\n\nComments are removed from the original files.\n\n```js\nfoo.js - after commit\n\n\nfunction helloWorld(phrase) {\n  console.log('Hello World + ' + phrase); \n}\n```\n\n### Ignoring Files\nTo ignore some files from being searched, create a `.ccignore` file in your repository and add file names/types.\n\n```\nREADME.md\nbuild.sh\n.cpp\n```\n\n### Dependencies\n1. **GNU sed** is required to remove @commit comments in post-commit. \n\n  On Mac OS X, the default sed is from the FreeBSD distribution. To download the GNU sed version, use [Brew](http://brew.sh)\n\n  ```\n  $ brew install gnu-sed --with-default-names\n  ```\n\n  Without the `--with-default-names` option, the command will be downloaded as `gsed`.\n\n2. **pcregrep** is the primary search utility due to its widespread\n  portability. \n\n  If pcregrep is not available, GNU grep is used (for Perl RegEx \u0026 variable\n  lookback). \n\n\n### Contributing \u0026 Todo\nContributions to improve simplicity/resolve compatibility would be preferred. If there are useful improvements, tricks, or hacks, please submit a Pull Request and a directory of add-ons and snippets will be created.\n\n**TODO**\n\n- [x] Add filename and line number to bulleted commit commets - [suggestion by\n  joncalhoun](https://news.ycombinator.com/item?id=10904142) on HN \n- [ ] Use `git diff --cached --name-status --diff-filter=ACM` in place of `git\n  ls-files`\n- [ ] Develop more test cases (finding edge cases with grep expression)\n- [ ] Rewrite sed commands to be POSIX (BSD) compatible regular expressions\n- Create more robust regular expression for validating comment syntax\n\t- [ ] Check for multiline block comments\n\t- [ ] Check for closing comment symbols (positive look aheads)\n- Programming Languages\n\t- [ ] HTML\n\t- [ ] Fortran\n\t- [ ] AppleScript\n\n--\n\nSpecial Thanks to Bryan Wyatt for feedback and bug fixes - [@brwyatt](https://twitter.com/brwyatt)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjryio%2Fcommit-comments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjryio%2Fcommit-comments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjryio%2Fcommit-comments/lists"}