Repository navigation
What's changed since v0.4.1
Fixes
-
Git notes: a note can be stored for any commit again (#254).
Once a repository's notes are split into subdirectories, storing a note
for a commit whose subdirectory already existed wrote a tree with a
duplicate entry. Servers that check pushed objects, GitHub among them,
refused the push withunpack index-pack failed. A commit could only be
given a note if no other noted commit shared the first two digits of its
SHA, so the failure rate grew with every note stored. The note is now
written into the existing subdirectory, next to the notes already there.
The notes on the remote were never damaged: the bad pushes were rejected. -
Repository type registry: safe for concurrent use (#252).
RepositoryFromStringread the registry of repository types without
taking its lock. A lookup that overlapped a registration, as when the
default types are loaded on first use while repositories are already
being built, was a concurrent map read and write, which ends the
process. Lookups now take a read lock, and registering checks for an
existing type under the same lock as the write. -
Git notes: a note can be stored for any commit again (#254).
Once a repository's notes are split into subdirectories, storing a note
for a commit whose subdirectory already existed wrote a tree with a
duplicate entry. Servers that check pushed objects, GitHub among them,
refused the push withunpack index-pack failed. A commit could only be
given a note if no other noted commit shared the first two digits of its
SHA, so the failure rate grew with every note stored. The note is now
written into the existing subdirectory, next to the notes already there.
The notes on the remote were never damaged: the bad pushes were rejected. -
Repository type registry: safe for concurrent use (#252).
RepositoryFromStringread the registry of repository types without
taking its lock. A lookup that overlapped a registration, as when the
default types are loaded on first use while repositories are already
being built, was a concurrent map read and write, which ends the
process. Lookups now take a read lock, and registering checks for an
existing type under the same lock as the write. -
Git notes: a rejected push is retried (#251).
Every note of a repository lives under one ref, so a writer that read the
notes before another writer pushed had its own push rejected and the
attestation was lost. For a cloned repository the push is now tried up to
three times, each time on top of the remote's current notes. Existing
notes are kept and the attestation is written once. A local repository's
notes are never reset, and a push refused for lack of access is not
retried.
Features
gitcollector: authentication (#250).
NewWithTokenandWithAuthoptions let thegitcollector read
private repositories. The credentials are sent on every request it makes:
resolving a ref, cloning, fetching a commit by SHA, and fetching the
commits a subject query asks about. An empty token keeps it anonymous.
Changes in output
- Signature attestations name and locate their commit (#253).
The attestation synthesized from a commit's signature now has
"<remote>@<sha>"as its subject name, where it had the repository URL
alone, and a VCS locator as its subjecturi
(git+https://host/org/repo@<sha>), which was empty. Digests are
unchanged. Credentials embedded in a remote's URL are no longer copied
into the subject. Tag signature attestations are not changed.
Upgrade notes
- Anything that compares a signature attestation's subject name to a
bare repository URL needs updating; matching on digests is unaffected. - No API was removed.
WithTokenandWithAuthon thegitcollector
are additions.