From: Patrick Steinhardt Date: Wed, 05 Jun 2024 08:02:19 GMT Subject: Re: [PATCH v3 6/6] update-ref: add support for 'symref-update' command Message-ID: In-Reply-To: <20240530120940.456817-7-knayak@gitlab.com> On Thu, May 30, 2024 at 03:09:40PM +0300, Karthik Nayak wrote: > From: Karthik Nayak > > Add 'symref-update' command to the '--stdin' mode of 'git-update-ref' to > allow updates of symbolic refs. The 'symref-update' command takes in a > , which the will be updated to. If the doesn't > exist it will be created. > > It also optionally takes either an `ref ` or `oid > `. If the is provided, it checks to see if the > targets the before the update. If is provided > it checks to ensure that it is a regular ref and is the > OID before the update. This by extension also means that this when a > zero is provided, it ensures that the ref didn't exist before. > > The divergence in syntax from the regular `update` command is because if > we don't use a `(ref | oid)` prefix for the old_value, then there is > ambiguity around if the value provided should be treated as an oid or a > reference. This is more so the reason, because we allow anything > committish to be provided as an oid. It would be nice to explain why this isn't needed for symref-delete and symref-create, which also both have an old value. Patrick