{"id":22813346,"url":"https://github.com/southclaws/gitwatch","last_synced_at":"2025-04-22T16:54:17.811Z","repository":{"id":57512036,"uuid":"146618059","full_name":"Southclaws/gitwatch","owner":"Southclaws","description":"Simple Go library for detecting changes in remote Git repositories","archived":false,"fork":false,"pushed_at":"2020-10-27T11:39:11.000Z","size":48,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-19T17:51:37.609Z","etag":null,"topics":["automation","git"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Southclaws.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":"2018-08-29T15:09:08.000Z","updated_at":"2021-12-19T21:38:34.000Z","dependencies_parsed_at":"2022-08-31T06:40:49.319Z","dependency_job_id":null,"html_url":"https://github.com/Southclaws/gitwatch","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Southclaws%2Fgitwatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Southclaws%2Fgitwatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Southclaws%2Fgitwatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Southclaws%2Fgitwatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Southclaws","download_url":"https://codeload.github.com/Southclaws/gitwatch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229383256,"owners_count":18064454,"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":["automation","git"],"created_at":"2024-12-12T12:27:02.148Z","updated_at":"2024-12-12T12:27:02.816Z","avatar_url":"https://github.com/Southclaws.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `gitwatch`\n\nPeriodically polls a set of targets for changes, if there are any an event is\nemitted on a channel.\n\n## Usage\n\n```go\nsession, err := gitwatch.New(\n    ctx,\n    []Repository{\n        {URL: \"https://github.com/repo/a\"},\n        {URL: \"https://github.com/repo/b\"},\n    },\n    time.Second,\n    \"./gitwatch-cache/\",\n    true,\n)\n\ngo func() {\n    for {\n        select {\n        case event := \u003c-session.Events:\n            fmt.Println(\"git event:\", event)\n        case err := \u003c-session.Errors:\n            fmt.Println(\"git error:\", err)\n        }\n    }\n}()\n\n// blocks until failure\nerr = session.Run()\nif err != nil {\n    // process was terminated somehow, handle error\n}\n```\n\nBy design, once the watcher is up and running (post initial clone phase), errors\nwill not cause it to stop. Instead, errors are passed down the `Errors` channel\nfor the dependent package to handle. The error returned by `Run` will either be\n`context.Cancelled` or any git errors raised during the initial cloning of all\ntargets.\n\nThere also exists a channel called `InitialDone` which is only ever pushed to\nonce, immediately after all initial targets have been cloned. It's a buffered\nchannel of size 1 so there's no explicit need to ever read from it but it can be\nuseful for sequencing things properly.\n\nYou can set the branch and directory name of target repositories. See the\ndocstring for `Repository` for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsouthclaws%2Fgitwatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsouthclaws%2Fgitwatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsouthclaws%2Fgitwatch/lists"}