Name | git-notes-db JSON |
Version |
0.1.31
JSON |
| download |
home_page | None |
Summary | Store and access structured data in git-notes |
upload_time | 2025-07-12 16:45:01 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.13 |
license | This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>
|
keywords |
git
notes
cli
json
jq
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# git-notes-db
[](LICENSE)
This tool helps store structured information in git-notes.
It aims to be usable manually, but also for creating other scripts.
Usage
=====
When setting value specify a name as the first argument (this will be
`refs/notes/<name>`). In this example we use `test_results`.
The second argument is the commit this data is about.
The third argument is what to store, this can be anything that `jq` accepts, including standard JSON.
All operations must be run from within a git repository.
```console
$ git-notes-db set test_results HEAD '{passed: false, older_results: []}'
```
To read the data back;
```console
$ git-notes-db get test_results HEAD
> {"passed": false, "older_results": []}
```
When updating, the jq expression gets any original value as an input (or null
if no original value is stored). This allows for selective updating, or merging
data.
```console
$ git-notes-db set test_results HEAD '{passed: true, older_results: .older_results + [.passed]}'
$ git-notes-db get test_results HEAD
> {"passed": true, "older_results": [false]}
```
Other commands
--------------
`get_all`
It's also possible to get all known results with `get_all`. This also accepts
jq expressions which modify the output results.
`match`
Return's results matching supplied jq expression.
Todo
====
- [ ] Allow limiting queries/get by git revision range.
- [ ] Add subcommand to run some executable and store result.
See git-branchless for inspiration.
- Could make nice tui with textual.
- [ ] Package and push to pypi.
- [ ] Nix flake.
- [ ] Add helper to `push` given notes to a remote.
- [ ] Add helper to automatically configure git to fetch notes from remote.
- [ ] Add note merge helper. Use jq expression to handle merge.
- [ ] Add ability to specify a key (e.g. message).
When this key is present on a result that's being set, also update a
secondary *human readable* note for including in git log output with
`notes.displayRef`.
- [ ] Add toggle for `match` that outputs just commits newline separated.
- [ ] Add option for `match` and `get_all` that stops searching after `n`
results are outputted.
- [ ] Add option for `match` that fails if number of results is outside
a given range.
- [ ] githooks / ci.
- [ ] More tutorial with usage examples.
- [ ] Feel like I've reinvented the wheel with the way I've built up the cli
commands. I've not seen the state of CLI helper libraries recently.
Maybe try [Typer](https://typer.tiangolo.com/).
or [felix-martel/pydanclick: Add click options from a Pydantic
model](https://github.com/felix-martel/pydanclick)
Development Notes
=================
- Haven't decided whether I want to primarily use
[github](https://github.com/cscutcher/git-notes-db) or
[gitlab](https://gitlab.com/cscutcher-public/git-notes-db).
- A bit over-engineered. Trying out some stuff.
- Trying out jujutsu VCS, commits might be weird until I work it out.
- Had originally planned to use more asyncio. Right now a bunch of stuff is
async that probably doesn't need to be.
Will leave this behind incase I end up wanting to parallelise things in
future.
- Ruff should be used to format code.
- Basedpyright and ruff should both be run for static testing.
- Write unit/integration tests suitable for pytest.
Raw data
{
"_id": null,
"home_page": null,
"name": "git-notes-db",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.13",
"maintainer_email": null,
"keywords": "git, notes, cli, json, jq",
"author": null,
"author_email": "Chris Scutcher <chris@scutcher.uk>",
"download_url": "https://files.pythonhosted.org/packages/a3/08/b33791a0252e6c40b6de0d4d239cf4270256aa637b76ed92a49639259613/git_notes_db-0.1.31.tar.gz",
"platform": null,
"description": "# git-notes-db\n\n[](LICENSE)\n\nThis tool helps store structured information in git-notes.\nIt aims to be usable manually, but also for creating other scripts.\n\nUsage\n=====\n\nWhen setting value specify a name as the first argument (this will be\n`refs/notes/<name>`). In this example we use `test_results`.\nThe second argument is the commit this data is about.\nThe third argument is what to store, this can be anything that `jq` accepts, including standard JSON.\n\nAll operations must be run from within a git repository.\n\n```console\n$ git-notes-db set test_results HEAD '{passed: false, older_results: []}'\n```\n\nTo read the data back;\n\n```console\n$ git-notes-db get test_results HEAD\n> {\"passed\": false, \"older_results\": []}\n```\n\nWhen updating, the jq expression gets any original value as an input (or null\nif no original value is stored). This allows for selective updating, or merging\ndata.\n\n```console\n$ git-notes-db set test_results HEAD '{passed: true, older_results: .older_results + [.passed]}'\n$ git-notes-db get test_results HEAD\n> {\"passed\": true, \"older_results\": [false]}\n```\n\nOther commands\n--------------\n\n`get_all`\n\nIt's also possible to get all known results with `get_all`. This also accepts\njq expressions which modify the output results.\n\n`match`\n\nReturn's results matching supplied jq expression.\n\n\nTodo\n====\n\n- [ ] Allow limiting queries/get by git revision range.\n- [ ] Add subcommand to run some executable and store result.\n See git-branchless for inspiration.\n - Could make nice tui with textual.\n- [ ] Package and push to pypi.\n- [ ] Nix flake.\n- [ ] Add helper to `push` given notes to a remote.\n- [ ] Add helper to automatically configure git to fetch notes from remote.\n- [ ] Add note merge helper. Use jq expression to handle merge.\n- [ ] Add ability to specify a key (e.g. message).\n When this key is present on a result that's being set, also update a\n secondary *human readable* note for including in git log output with\n `notes.displayRef`.\n- [ ] Add toggle for `match` that outputs just commits newline separated.\n- [ ] Add option for `match` and `get_all` that stops searching after `n`\n results are outputted.\n- [ ] Add option for `match` that fails if number of results is outside\n a given range.\n- [ ] githooks / ci.\n- [ ] More tutorial with usage examples.\n- [ ] Feel like I've reinvented the wheel with the way I've built up the cli\n commands. I've not seen the state of CLI helper libraries recently.\n Maybe try [Typer](https://typer.tiangolo.com/).\n or [felix-martel/pydanclick: Add click options from a Pydantic\n model](https://github.com/felix-martel/pydanclick)\n\nDevelopment Notes\n=================\n- Haven't decided whether I want to primarily use\n [github](https://github.com/cscutcher/git-notes-db) or\n [gitlab](https://gitlab.com/cscutcher-public/git-notes-db).\n- A bit over-engineered. Trying out some stuff.\n- Trying out jujutsu VCS, commits might be weird until I work it out.\n- Had originally planned to use more asyncio. Right now a bunch of stuff is\n async that probably doesn't need to be.\n Will leave this behind incase I end up wanting to parallelise things in\n future.\n- Ruff should be used to format code.\n- Basedpyright and ruff should both be run for static testing.\n- Write unit/integration tests suitable for pytest.\n",
"bugtrack_url": null,
"license": "This is free and unencumbered software released into the public domain.\n \n Anyone is free to copy, modify, publish, use, compile, sell, or\n distribute this software, either in source code form or as a compiled\n binary, for any purpose, commercial or non-commercial, and by any\n means.\n \n In jurisdictions that recognize copyright laws, the author or authors\n of this software dedicate any and all copyright interest in the\n software to the public domain. We make this dedication for the benefit\n of the public at large and to the detriment of our heirs and\n successors. We intend this dedication to be an overt act of\n relinquishment in perpetuity of all present and future rights to this\n software under copyright law.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n \n For more information, please refer to <https://unlicense.org>\n ",
"summary": "Store and access structured data in git-notes",
"version": "0.1.31",
"project_urls": {
"Homepage": "https://gitlab.com/cscutcher-public/git-notes-db",
"Homepage (Mirror)": "https://github.com/cscutcher/git-notes-db",
"Repository": "https://gitlab.com/cscutcher-public/git-notes-db.git",
"Repository (Mirror)": "https://github.com/cscutcher/git-notes-db.git"
},
"split_keywords": [
"git",
" notes",
" cli",
" json",
" jq"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ddf69c01c64264600c8fd9cd20403419e0c0f3c48d7e617b113abbce74b38b9b",
"md5": "7354ff3b13a0e7d884618f2f90f70808",
"sha256": "345f25da37471b1e637f076f22a633ff88906ee5f1dca4be3b28feaa30897041"
},
"downloads": -1,
"filename": "git_notes_db-0.1.31-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7354ff3b13a0e7d884618f2f90f70808",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.13",
"size": 14389,
"upload_time": "2025-07-12T16:44:59",
"upload_time_iso_8601": "2025-07-12T16:44:59.874411Z",
"url": "https://files.pythonhosted.org/packages/dd/f6/9c01c64264600c8fd9cd20403419e0c0f3c48d7e617b113abbce74b38b9b/git_notes_db-0.1.31-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a308b33791a0252e6c40b6de0d4d239cf4270256aa637b76ed92a49639259613",
"md5": "b3d6dd75a6ce540f7c212147c6902896",
"sha256": "17f46a769b57cdd9537fecd6c9f774548feb40ca4a724c9ec5d3a5f06b64ffc1"
},
"downloads": -1,
"filename": "git_notes_db-0.1.31.tar.gz",
"has_sig": false,
"md5_digest": "b3d6dd75a6ce540f7c212147c6902896",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.13",
"size": 14268,
"upload_time": "2025-07-12T16:45:01",
"upload_time_iso_8601": "2025-07-12T16:45:01.100573Z",
"url": "https://files.pythonhosted.org/packages/a3/08/b33791a0252e6c40b6de0d4d239cf4270256aa637b76ed92a49639259613/git_notes_db-0.1.31.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-12 16:45:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cscutcher",
"github_project": "git-notes-db",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "git-notes-db"
}