git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: "Martin Vejnár" <vejnar.martin@gmail.com>
Cc: "Randall S. Becker" <rsbecker@nexbridge.com>, git@vger.kernel.org
Subject: Re: Calculating major.minor.patch from commit hash
Date: Fri, 14 Feb 2020 00:27:13 +0000	[thread overview]
Message-ID: <20200214002713.GA6806@camp.crustytoothpaste.net> (raw)
In-Reply-To: <CAJFfRmt3w60Yq+HS9oVmGtfPMzLeKzFSnkwS7v4_xe+eEWSxzw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1089 bytes --]

On 2020-02-13 at 14:54:48, Martin Vejnár wrote:
> On Thu, Feb 13, 2020 at 3:46 PM Randall S. Becker
> <rsbecker@nexbridge.com> wrote:
> > You should consider using annotated tags and the git describe command to derive your release number. [...]
> 
> I'd like to avoid tags in this case, because a new tag/deletion of a
> tag could change the hash->version mapping and I'd like that to be
> stable.

Tags, usually signed tags, are the traditional way to indicate versions,
and with them, git describe is usually used to describe commits.  While
it is possible to rewrite tags, people usually rely on convention and
social sanction to not do that without good cause.

If that isn't enough for you, then you'll probably have to build things
yourself.  I'm not sure Git provides functionality that finds the
longest path between two commits, but you can probably find the commit
depth like the following:

git log --format="%H" -- VERSION | head -n1 | xargs -I{} git rev-list {}..HEAD | wc -l
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]

      reply	other threads:[~2020-02-14  0:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 14:40 Calculating major.minor.patch from commit hash Martin Vejnár
2020-02-13 14:46 ` Randall S. Becker
2020-02-13 14:54   ` Martin Vejnár
2020-02-14  0:27     ` brian m. carlson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200214002713.GA6806@camp.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=rsbecker@nexbridge.com \
    --cc=vejnar.martin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).