[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Version string with git(1) (-dirty)
From: |
Colin Watson |
Subject: |
Re: Version string with git(1) (-dirty) |
Date: |
Fri, 23 Feb 2024 15:49:40 +0000 |
On Fri, Feb 23, 2024 at 03:25:05PM +0100, Alejandro Colomar wrote:
> On Fri, Feb 23, 2024 at 03:20:58PM +0100, Alejandro Colomar wrote:
> > So, how do you get that "-dirty" suffix? Is it autotools? Or git? Or
> > is it specific to the groff build system? I could use some shell code
> > in the makefile to get it, but was asking mainly in case git already
> > gives that somehow.
>
> Never mind, I should RTFM. :)
>
> $ MANWIDTH=72 man git-describe | sed -n '/^ *--dirty/,/^$/p'
> --dirty[=<mark>], --broken[=<mark>]
> Describe the state of the working tree. When the working tree
> matches HEAD, the output is the same as "git describe HEAD".
> If the working tree has local modification "-dirty" is
> appended to it. If a repository is corrupt and Git cannot
> determine if there is local modification, Git will error out,
> unless ‘--broken’ is given, which appends the suffix
> "-broken" instead.
But also, gnulib's git-version-gen (which groff uses) does this
manually. See:
https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=build-aux/git-version-gen
--
Colin Watson (he/him) [cjwatson@debian.org]