Git hashes still truncated too much
This is a follow-up of https://github.com/NixOS/hydra/issues/1245, which I believe still hasn't been fully fixed.
The truncation still seems to be incorrect for some revs:
For example, [this page](https://hydra.nixos.org/jobset/nixos/release-25.11) currently shows:
> [1822415](https://hydra.nixos.org/eval/1822415) 8h ago nixpkgs → fa83fd8
However, GitHub is unable to resolve the commit with this hash:
- https://github.com/NixOS/nixpkgs/commit/fa83fd8
- https://api.github.com/repos/NixOS/nixpkgs/commits/fa83fd8
Using the full commit hash works:
- https://github.com/NixOS/nixpkgs/commit/fa83fd837f3098e3e678e6cf017b2b36102c7211
- https://api.github.com/repos/NixOS/nixpkgs/commits/fa83fd837f3098e3e678e6cf017b2b36102c7211
Surprisingly, GitHub displays the same 7 character short hash on the commit's page.
## Background
This has happened to me repeatedly over the last few months for varying revisions. My use case is to use `hydra-check` (which uses the short rev displayed on hydra) to update my flake, and it is failing quite often due to the hash being too short.
```
NIXPKGS_REV=$(hydra-check --channel 25.11 --json | jq --raw-output '.["nixos/release-25.11"] | sort_by(.timestamp) | reverse | ((.[0] | select(.finished == true or .queued < 50)) // .[1]) | .short_rev')
nix flake update --override-input nixpkgs "github:NixOS/nixpkgs/$NIXPKGS_REV"
```
2 条评论