Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shorthand to refer to dataset commits #57

feep opened this issue May 29, 2020 · 1 comment

Shorthand to refer to dataset commits #57

feep opened this issue May 29, 2020 · 1 comment


Copy link

feep commented May 29, 2020

Qri commits can be referred to by their IPFS hash.

46 digits of ID is unwieldy, let’s find a shorthand way to refer to dataset commits.

❯ qri log
for linked dataset [chriswhong/nyc_bridge_bike_counts_2019]

1   Commit:  /ipfs/QmSSJycSd6RUUhMHiGTYfDVUZu21v7XB5L2xdatKnoyqBV
    Date:    Wed Feb 26 10:46:17 PST 2020
    Storage: local
    Size:    1.2 MB

    add note in readme about counting error confirmed by DOT
        added scriptBytes

2   Commit:  /ipfs/QmU4rNyEk7mrwqBhk3NxJxhLJvrFQbDdDakcUmLPtPYLuv
    Date:    Mon Feb 24 07:40:08 PST 2020
    Storage: remote
    Size:    1.2 MB

    Add metadata

Prior art

git partial hash

Git can refer to a version by a partial hash. As long as the commit starts with the fragment, it is unambiguous, and at least four characters long.

As long as no other object in the database has a hash that starts with 1c00, these commands all refer to the same commit:

$ git show 1c002dd4b536e7479fe34593e72e6c6c1819e53b
$ git show 1c002dd4b536e7479f
$ git show 1c00

Other git commands

git log has a flag --abbrev-commit that abbreviates the hashes in the log to seven characters. Longer if required for uniqueness.

git tagged versions

I don’t think anything like tagged versions is planned. But I’m linking it for completeness.

CLI syntax for referring to commits or ranges of commits

dustmop put together a list of special characters that are available for composing command line options.

Copy link

feep commented May 29, 2020

I am new to IPFS, but it looks like the scope of a CID is global.

If we refer to an abbreviation as unique we need to be clear about the scope in which it is unique.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

1 participant