My previous patch to embed git version info in nodeinfo had some
issues, like it produced `2024.4.4-249-g04d45859e6` when building on
current `develop`, which is arguably correct but not helpful (it
should really say `2025.5.2-dev` somewhere!)
* if we're on a tag, trust `package.json`
* if we're not, *append* the current commit hash
so for example, building on `stable` right now gets you `2025.4.4`,
and building on the parent of this commit gets you
`2025.5.2-dev+g04d45859e6`
the `+` is correct according to https://semver.org/
this will make it much easier to debug problems for instances that run
unreleased versions!
when run on a tagged commit, `git describe --tags` prints the tag name;
otherwise it prints something like `2025.4.3-32-ga4c0ef824c` which
means:
- the closest tag is 2025.4.3
- there are 32 commits between that tag and this commit
- this commit's id is `a4c0ef824c` (the `g` is just a prefix)
notice that the version as reported by the frontend (in
`/about-sharkey` for example) is _not_ changed, that one is still
sourced from `/package.json` (so, for example, you don't get a
"sharkey has been updated!" pop-up every time)
* chore: Add the SPDX information to each file
Add copyright and licensing information as defined in version 3.0 of
the REUSE Specification.
* tweak format
---------
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>