From owner-freebsd-git@freebsd.org Sun Aug 9 21:29:15 2020 Return-Path: Delivered-To: freebsd-git@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E447F3BE706 for ; Sun, 9 Aug 2020 21:29:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BPsfy5Bptz4QQp for ; Sun, 9 Aug 2020 21:29:14 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f172.google.com with SMTP id z17so6027490ill.6 for ; Sun, 09 Aug 2020 14:29:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9zn1Gr4RVQlL4bm7cmiNSu2AwKcA5bymSvv7EJClMLE=; b=CptFdOqmnbDvYAZMqZZZ3UfCnFJwX/2irF0eouOT9hIlsR/Gd6yyKDngaCbcTOR/ty zQZhF74rTXsRzeizhUzvNgj/HDXbWjyXw7by6Uq345tD4mM/gHspvvVb96NnXA+M/H1W 6o2bj4OIA2lIywJV3z9TtyXiJ3HIgTAv9365vUuxni9u6TRtNYKZvOy9b0Jsb+M6otES yQ1dMkgldTBY8h0EG+7oh26/irWtA8DE5iWjtI8eK2j40ZgfscMnYsZj3j0bIo4j/gXD u158xuYI5PB+2om/UWNVmEq4BAiBuKbqTDTNkps180sp5TcIMIuMI7JZHAhhfYemIzJ7 WLPA== X-Gm-Message-State: AOAM530vvr+zRMDKKj+YkhFn5SZPdxtp8bmrgBe7so9quf9z7sNy38hs PlfiKMnJWGiUZ3jwFbx+d93B8rzqH+xFAZnpShY= X-Google-Smtp-Source: ABdhPJwxVTBudOPB18teFxeAw5bjUwxUeGkz60PBU3xwdUaeb+xV8lWKnK3CkGKRckNnIyDfs9H6M04/0eg2oa1hqbs= X-Received: by 2002:a92:4b08:: with SMTP id m8mr14615497ilg.11.1597008553123; Sun, 09 Aug 2020 14:29:13 -0700 (PDT) MIME-Version: 1.0 References: <013F16E7-DDBB-4C2F-829D-D08B53CC7585@netapp.com> In-Reply-To: From: Ed Maste Date: Sun, 9 Aug 2020 17:29:00 -0400 Message-ID: Subject: Re: SVN Revision-Like IDs in Git To: Warner Losh Cc: "Sideropoulos, Alexander" , freebsd-git@freebsd.org, "Maxwell, Larus" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BPsfy5Bptz4QQp X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.172 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-2.15 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.01)[-1.011]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-0.97)[-0.973]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-git@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.17)[-0.169]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.172:from]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.172:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Aug 2020 21:29:15 -0000 On Thu, 6 Aug 2020 at 21:27, Warner Losh wrote: > > On Thu, Aug 6, 2020, 4:01 PM Sideropoulos, Alexander < > Alexander.Sideropoulos@netapp.com> wrote: > > > Hey folks, > > > > According to this page... > > > > https://hackmd.io/_lvyl1CfTsayB3L0v4fmLA#What%E2%80%99s-with-the-funny-revision-hashes-I-want-revision-numbers > > > > ...there are no plans to provide an SVN-revision-like ID for Git commits > > once the switch-over happens. > > > > At NetApp, we rely on the SVN revision number to uniquely identify our > > FreeBSD baseline and every cherry-picked patch we apply on top of it. We > > could update all our tooling to accept Git hashes, but this is not a small > > task. And I imagine we are not the only downstream project reliant upon SVN > > revision numbers. > > > > Since the SVN revision ID is really just an arbitrary number, has there > > been any thought in simply continuing to manufacture these numbers for Git > > commits going forward? It could even be a post-commit operation where the > > Git notes are updated with a unique (increasing) ID, just as is done today. > > > > Thoughts? > > > > Git has the ability to generate a number of commits since the last tag (or > maybe arbitrary tag). That is appropriately the same thing if you don't > need temporal stability between branches... Git has a "generation number" that could be used for this purpose, but unfortunately it isn't exposed in a user-facing way. It is possible to count the number of commits from the root to the current head though, and we include this number in the uname if build from git today. It appears as a "-cXXXXXX" suffix. As long as you are tracking or comparing only within a branch (e.g. stable/12) as Warner says it can be used equivalently. In sys/conf/newvers.sh have a look at the block following the "if [ -n "$git_cmd" ] ; then"