On Wed, Feb 03, 2021 at 10:23:37AM +0100, Julian Andres Klode wrote: > On Tue, Feb 02, 2021 at 01:03:23PM +0000, Robie Basak wrote: > > We need the Refs field because git is designed not to be able to fetch a > > commit by hash, but by a ref that can reach it only. So Vcs-Git-Refs > > must specify what ref(s), when fetched will make the commit given to be > > reachable. In practice this could just be the branch name prefixed by > > 'refs/heads/' as in this example. > > I don't buy this argument. A ref is just a file containing the commit > name, it doesn't matter to git.
It's more complicated than this. See uploadpack.allowReachableSHA1InWant in git-config(1). It defaults to false because of the computational complexity. Your example probably works because it's local. Try it with a remote (eg. Launchpad) and with a commit hash that isn't the tip of any branch (or tag), and you get, for example: error: Server does not allow request for unadvertised object 28a1d92b5823a971399dc275683c4ece1c7ebc86 In the general case, it doesn't work. I suppose one could specify that the hash specified in Vcs-Git-Commit must be fetchable as a bare hash, but I don't think that would be useful. Better to require a ref, and it's clearer for everyone. Robie
signature.asc
Description: PGP signature
-- ubuntu-devel mailing list ubuntu-devel@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel