Skip to content

Git hashes still truncated too much #1566

@cmfcmf

Description

@cmfcmf

This is a follow-up of #1245, which I believe still hasn't been fully fixed.

The truncation still seems to be incorrect for some revs:

For example, this page currently shows:

1822415 8h ago nixpkgs → fa83fd8

However, GitHub is unable to resolve the commit with this hash:

Using the full commit hash works:

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions