I've been contemplating a URI scheme for referencing objects in Git
I would want this scheme to be able to:
- Reference specific blobs, directories, and commits, by hash, without regard to what repository they are stored in.
- Reference objects within other objects by path (e.g. a file or directory within a commit).
- Indicate any number of repositories in which to look for the object.
It would be nice if it could also:
- Reference latest commit by branch.
- Reference latest commit signed by a key or set of keys.
- References the object file with hash 'asdf1234', including the header.
- References the object encoded by the file with hash 'asdf1234'.
If the object is a blob, this URN would resolve to the blob itself (a sequence of bytes).
If the referenced object is not a blob, then it is not directly representable
as a byte stream, and a strict resolver would return an error if it is asked
to represent it as a byte stream.
- References the object identified by 'asdf1234' and provides a repository from which to fetch it.
More than one 'repository' parameter could be specified.
- Assuming asdf1234 identifies a commit or tree object, #path/to/file
would find the object called 'path/to/file' referenced by that
- References the latest commit on branch 'master' in any of the listed repositories.
- References the latest commit on branch 'master' signed using the specified public key.
Not sure what format the public key would be in. Possibly that output by 'gpg --export'
(which you could fingerprint using 'gpg --with-fingerprint <file>')
- a clearer alternative scheme to
x-git-object when the named object is a commit.
this commit and hints to look
for it in that GitHub repository.