Skip to content

Sometimes the hash prefix returned by git-describe is 8 instead of 7 chars long #6

@agross

Description

@agross

I have this strange situation where git describe --always (as invoked by git-describe from npm) returns 8 instead of 7 characters.

The issue appears to be dependent on the machine, it's not consistent but happens sometimes:

Machine 1:

agross@gh-runner-1 $ git describe --always
384f5105

agross@gh-runner-1 $ git rev-list --count HEAD
1

Machines 2:

agross@gh-runner-2 $ git describe --always
384f510

agross@gh-runner-2 $ git rev-list --count HEAD
1

I can get the has down to 7 chars by passing --abbrev-7. It seems as if git-describe (from npm) supports that flag:

const gitInfo = gitDescribeSync({ customArguments: ['--abbrev=7'] });

It would be very beneficial for this situation to hard-code the hash to 7 characters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions