{"id":36417143,"url":"https://github.com/schmonz/greencently","last_synced_at":"2026-01-11T17:00:28.896Z","repository":{"id":154479031,"uuid":"616664324","full_name":"schmonz/greencently","owner":"schmonz","description":"All tests green, recently? Commit quickly and stay in flow.","archived":false,"fork":false,"pushed_at":"2025-12-16T13:57:25.000Z","size":526,"stargazers_count":3,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-20T04:34:49.591Z","etag":null,"topics":["git","java","junit","junit-jupiter","junit5","kotlin","pre-commit","pre-commit-hook","pre-commit-hooks","tdd","tdd-clojure","tdd-java","tdd-kotlin","tdd-scala","test-driven-development","testdrivendevelopment"],"latest_commit_sha":null,"homepage":"https://schmonz.com/software/greencently","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schmonz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":"schmonz","ko_fi":"schmonz","liberapay":"schmonz","patreon":"schmonz","custom":["https://paypal.me/schmonz","https://flattr.com/@schmonz"]}},"created_at":"2023-03-20T20:45:16.000Z","updated_at":"2025-12-16T13:57:19.000Z","dependencies_parsed_at":"2026-01-07T18:04:47.673Z","dependency_job_id":null,"html_url":"https://github.com/schmonz/greencently","commit_stats":null,"previous_names":["schmonz/greencently"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/schmonz/greencently","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmonz%2Fgreencently","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmonz%2Fgreencently/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmonz%2Fgreencently/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmonz%2Fgreencently/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schmonz","download_url":"https://codeload.github.com/schmonz/greencently/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schmonz%2Fgreencently/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28314254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"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","java","junit","junit-jupiter","junit5","kotlin","pre-commit","pre-commit-hook","pre-commit-hooks","tdd","tdd-clojure","tdd-java","tdd-kotlin","tdd-scala","test-driven-development","testdrivendevelopment"],"created_at":"2026-01-11T17:00:18.225Z","updated_at":"2026-01-11T17:00:28.866Z","avatar_url":"https://github.com/schmonz.png","language":"Kotlin","funding_links":["https://github.com/sponsors/schmonz","https://ko-fi.com/schmonz","https://liberapay.com/schmonz","https://patreon.com/schmonz","https://paypal.me/schmonz","https://flattr.com/@schmonz"],"categories":[],"sub_categories":[],"readme":"[![Build status](https://github.com/schmonz/greencently/actions/workflows/main-build.yml/badge.svg)](https://github.com/schmonz/greencently/actions/workflows/main-build.yml)\n[![Sonatype Central](https://maven-badges.sml.io/sonatype-central/com.schmonz/greencently/badge.svg?style=flat\u0026gav=true)](https://central.sonatype.com/artifact/com.schmonz/greencently)\n\n# Greencently\n\nDo you usually run your tests before you commit, to check your work?\n\nDo your tests also get run by a\n[pre-commit hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)?\n\nThis is helpful in the worst case --\nthe pre-commit hook has your back when you forget --\nbut in the typical case it's harmful:\n\n- Disrupts flow\n- Doubles cost\n- Adds no marginal benefit\n- Discourages frequent small well-tested commits\n- Engenders learned helplessness\n\nWe can fix this.\n\n## Setup for JUnit 5\n\n1. Update `build.gradle.kts`:\n\n```gradle.kts\ndependencies {\n    testRuntimeOnly(\"com.schmonz:greencently:CHECK_ABOVE_FOR_VERSION\")\n}\ntasks.withType\u003cTest\u003e {\n    maxParallelForks = 1  // see issue #4\n}\n```\n\n2. Run all tests in your project\n3. If green, see that `.greencently/junit5` exists (and it's already `.gitignore`'d)\n4. Run only one test, or only some tests, or all tests where at least one of them is red\n5. See that `.greencently/junit5` no longer exists\n6. From now on, whenever you've just run tests, all of them, and they're all green,\n   the pre-commit hook can decide not to run them again. Example:\n\n```sh\n#!/bin/sh\n\nACCEPTABLY_LARGE_NUMBER_OF_SECONDS_AGO=30\n\ngreencently() {\n    too_many_seconds_ago=$1\n    thenstamp=$(date -r .greencently/junit5 '+%s' 2\u003e/dev/null || echo 0)\n    nowstamp=$(date '+%s')\n    secondsago=$(expr ${nowstamp} - ${thenstamp})\n    [ ${secondsago} -lt ${too_many_seconds_ago} ]\n}\n\nif greencently ${ACCEPTABLY_LARGE_NUMBER_OF_SECONDS_AGO}; then\n    ./gradlew clean build --exclude-task test\nelse\n    ./gradlew clean build\nfi\n```\n\n## More information\n\nSee the\n[Greencently webpage](https://schmonz.com/software/greencently).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschmonz%2Fgreencently","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschmonz%2Fgreencently","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschmonz%2Fgreencently/lists"}