{"id":16295122,"url":"https://github.com/wadackel/go-gitlog","last_synced_at":"2026-03-04T03:02:27.825Z","repository":{"id":57485595,"uuid":"119271926","full_name":"wadackel/go-gitlog","owner":"wadackel","description":"Go (golang) package for providing a means to handle git-log.","archived":false,"fork":false,"pushed_at":"2024-04-06T17:50:14.000Z","size":151,"stargazers_count":11,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-29T01:39:02.840Z","etag":null,"topics":["git","go","golang","golang-package"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/tsuyoshiwada/go-gitlog","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/wadackel.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}},"created_at":"2018-01-28T15:45:35.000Z","updated_at":"2025-01-28T14:53:28.000Z","dependencies_parsed_at":"2024-06-19T02:08:34.908Z","dependency_job_id":"4caa7d36-2af7-4e38-8f7b-81c2e6858c14","html_url":"https://github.com/wadackel/go-gitlog","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/wadackel/go-gitlog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Fgo-gitlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Fgo-gitlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Fgo-gitlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Fgo-gitlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wadackel","download_url":"https://codeload.github.com/wadackel/go-gitlog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Fgo-gitlog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30070479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T01:03:42.280Z","status":"online","status_checked_at":"2026-03-04T02:00:07.464Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","go","golang","golang-package"],"created_at":"2024-10-10T20:17:42.017Z","updated_at":"2026-03-04T03:02:27.807Z","avatar_url":"https://github.com/wadackel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-gitlog\n\n[![godoc.org](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/tsuyoshiwada/go-gitlog)\n[![Travis](https://img.shields.io/travis/tsuyoshiwada/go-gitlog.svg?style=flat-square)](https://travis-ci.org/tsuyoshiwada/go-gitlog)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/tsuyoshiwada/go-gitlog/blob/master/LICENSE)\n\n\u003e Go (golang) package for providing a means to handle git-log.\n\n\n\n\n## Installation\n\nTo install `go-gitlog`, simply run:\n\n```bash\n$ go get -u github.com/tsuyoshiwada/go-gitlog\n```\n\n\n\n\n## Usage\n\nIt is the simplest example.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"github.com/tsuyoshiwada/go-gitlog\"\n)\n\nfunc main() {\n\t// New gitlog\n\tgit := gitlog.New(\u0026gitlog.Config{\n\t\tBin:  \"/your/custom/git/bin\", // default \"git\"\n\t\tPath: \"/repo/path/to\",        // default \".\"\n\t})\n\n\t// List git-log\n\tcommits, err := git.Log(nil, nil)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\t// Output\n\tfor _, commit := range commits {\n\t\tfmt.Printf(\n\t\t\t\"%s %s %s\\n\",\n\t\t\tcommit.Hash.Short,\n\t\t\tcommit.Author.Name,\n\t\t\tcommit.Subject,\n\t\t)\n\t}\n}\n```\n\nSee [godoc](https://godoc.org/github.com/tsuyoshiwada/go-gitlog) for API detail of [Log](https://godoc.org/github.com/tsuyoshiwada/go-gitlog#GitLog) :+1:\n\n\n\n\n## Options\n\nBy using [Params](https://godoc.org/github.com/tsuyoshiwada/go-gitlog#Params) you can customize the log retrieval.\n\n\n### `MergesOnly`\n\nGive the `--merges` option.\n\n\n### `IgnoreMerges`\n\nGive the `--no-merges` option.\n\n\n### `Reverse`\n\nGive the `--reverse` option.\n\n\n\n\n## Examples\n\n\n### `$ git log \u003csha1|tag|ref\u003e`\n\nSpecification of `revisionrange` can be realized by giving a [RevArgs](https://godoc.org/github.com/tsuyoshiwada/go-gitlog#RevArgs) interface.\n\n```go\ncommits, err := git.Log(\u0026gitlog.Rev{\"5e312d5\"}, nil)\n```\n\n\n### `$ git log \u003csha1|tag|ref\u003e..\u003csha1|tag|ref\u003e`\n\nFor double dot notation use [RevRange](https://godoc.org/github.com/tsuyoshiwada/go-gitlog#RevRange).\n\n```go\ncommits, err := git.Log(\u0026gitlog.RevRange{\n\tOld: \"v0.1.7\",\n\tNew: \"v1.2.3\",\n}, nil)\n```\n\n\n### `$ git log -n \u003cn\u003e`\n\nUse [RevNumber](https://godoc.org/github.com/tsuyoshiwada/go-gitlog#RevNumber) to get the specified number of commits.\n\n```go\ncommits, err := git.Log(\u0026gitlog.RevNumber{10}, nil)\n```\n\n\n### `$ git log --since \u003ctime\u003e --until \u003ctime\u003e`\n\nBy using [RevTime](https://godoc.org/github.com/tsuyoshiwada/go-gitlog#RevTime) you can specify the range by time.\n\n**Since and Until:**\n\n```go\ncommits, err := git.Log(\u0026gitlog.RevTime{\n\tSince: time.Date(2018, 3, 4, 23, 0, 0, time.UTC),\n\tUntil: time.Date(2018, 1, 2, 12, 0, 0, time.UTC),\n}, nil)\n```\n\n**Only since:**\n\n```go\ncommits, err := git.Log(\u0026gitlog.RevTime{\n\tSince: time.Date(2018, 1, 2, 12, 0, 0, time.UTC),\n}, nil)\n```\n\n**Only until:**\n\n```go\ncommits, err := git.Log(\u0026gitlog.RevTime{\n\tUntil: time.Date(2018, 1, 2, 12, 0, 0, time.UTC),\n}, nil)\n```\n\n\n\n\n## How it works\n\nInternally we use the git command to format it with the `--pretty` option of log and parse the standard output.  \nSo, only local git repositories are eligible for acquisition.\n\n\n\n\n## Contribute\n\n1. Fork (https://github.com/tsuyoshiwada/go-gitlog)\n1. Create a feature branch\n1. Commit your changes\n1. Rebase your local changes against the master branch\n1. Run test suite with the `go test` command and confirm that it passes\n1. Create new Pull Request :muscle:\n\nBugs, feature requests and comments are more than welcome in the [issues](https://github.com/tsuyoshiwada/go-gitlog/issues).\n\n\n\n\n## License\n\n[MIT © tsuyoshiwada](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwadackel%2Fgo-gitlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwadackel%2Fgo-gitlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwadackel%2Fgo-gitlog/lists"}