Re: [PATCH v2] builtin/clone: teach git-clone(1) the --revision= option
- From
Jeff King <peff@peff.net>
- Date
- Dec 2, 2024, 21:17 UTC
- Message-ID
- <20241202211715.GA787456@coredump.intra.peff.net>
- In-Reply-To
- <Z02_YwCgHp_MVj3M@pks.im>
On Mon, Dec 02, 2024 at 03:08:35PM +0100, Patrick Steinhardt wrote:
Show 8 quoted lines
> > Add option `--revision` to git-clone(1). This option accepts a fully > > qualified reference, or a raw commit hash. This enables the user to > > clone and checkout any revision they want. `--revision` can be used in > > s/checkout/check out/ > > Does this have to be a raw commit hash, or do we also accept an > arbitrary committish like a tag that peels down to a commit?
I don't think anything except a raw hash will be possible without a protocol extension. upload-pack accepts only a full object id on its "want" lines, so the client needs to either start with one, or start with a refname that it can convert to one from the advertisement.
(There's also the "want-ref" extension, but it only takes full refnames).
-Peff