From: Felipe Contreras <felipe.contreras@gmail.com>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>,
Todd Zullinger <tmz@pobox.com>,
Felipe Contreras <felipe.contreras@gmail.com>
Subject: [PATCH v2 12/15] version-gen: move v fix into sed
Date: Mon, 24 Apr 2023 10:50:38 -0600 [thread overview]
Message-ID: <20230424165041.25180-13-felipe.contreras@gmail.com> (raw)
In-Reply-To: <20230424165041.25180-1-felipe.contreras@gmail.com>
We are already using sed, might as well take advantage of it.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
GIT-VERSION-GEN | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 40502363dd..6bf932c281 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -4,7 +4,7 @@ GVF=GIT-VERSION-FILE
DEF_VER=2.40.GIT
describe () {
- git describe --match "v[0-9]*" --dirty 2>/dev/null | sed -e 's/-/./g'
+ git describe --match "v[0-9]*" --dirty 2>/dev/null | sed -e 's/-/./g' -e 's/^v//'
}
# First see if there is a version file (included in release tarballs),
@@ -15,7 +15,6 @@ then
elif test -d "${GIT_DIR:-.git}" -o -f .git
then
VN=$(describe)
- VN=${VN#v}
fi
: "${VN:=$DEF_VER}"
--
2.40.0+fc1
next prev parent reply other threads:[~2023-04-24 16:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-24 16:50 [PATCH v2 00/15] version-gen: complete revamp/rewrite Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 01/15] version-gen: reorganize Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 02/15] version-gen: trivial cleanup Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 03/15] version-gen: refactor default version Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 04/15] version-gen: simplify v prefix removal Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 05/15] version-gen: simplify update check Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 06/15] version-gen: simplify `git describe` checks Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 07/15] version-gen: simplify dirty check Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 08/15] version-gen: move describe fix into function Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 09/15] version-gen: describe and sed in one go Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 10/15] version-gen: refactor describe function Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 11/15] version-gen: do v fix only when necessary Felipe Contreras
2023-04-24 16:50 ` Felipe Contreras [this message]
2023-04-24 16:50 ` [PATCH v2 13/15] version-gen: refactor main functionality Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 14/15] version-gen: refactor GIT_VERSION string Felipe Contreras
2023-04-24 16:50 ` [PATCH v2 15/15] version-gen: get rid of GVF variable Felipe Contreras
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230424165041.25180-13-felipe.contreras@gmail.com \
--to=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=tmz@pobox.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.
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).