git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] GIT-VERSION-GEN: make use of git describe --dirty

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 27, 2010, 14:28 UTC
Message-ID
<m3sjzriuc2.fsf@localhost.localdomain>
In-Reply-To
<4CC7D9CA.1080609@debugon.org>
Mathias Lafeldt <misfire@debugon.org> writes:
> Mathias Lafeldt wrote:
Show 18 quoted lines
> > diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
> > index d441d88..5c226f6 100755
> > --- a/GIT-VERSION-GEN
> > +++ b/GIT-VERSION-GEN
> > @@ -16,6 +16,10 @@ elif test -d .git -o -f .git &&
> >         case "$VN" in
> >         *$LF*) (exit 1) ;;
> >         v[0-9]*)
> > +               # As of Git v1.6.6, we can use "git describe --dirty" to
> > +               # determine if the working tree is dirty. However, to still
> > +               # have nice version numbers when building Git with older
> > +               # versions of git installed, we keep using plumbing.
> >                 git update-index -q --refresh
> >                 test -z "$(git diff-index --name-only HEAD --)" ||
> >                 VN="$VN-dirty" ;;
> > 
> 
> Any feedback would be welcome.

I like it, also because people who use GIT-VERSION-GEN from git repository as inspiration would get to know more modern technique.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Mathias LafeldtNext: Mathias Lafeldt
Message 5 of 7 in “GIT-VERSION-GEN: make use of git describe --dirty”
  1. 1/3 GIT-VERSION-GEN: make use of git describe --dirtyMathias Lafeldt, Oct 22, 2010
  2. Jonathan NiederOct 22, 2010
  3. Mathias LafeldtOct 23, 2010
  4. Mathias LafeldtOct 27, 2010
  5. Jakub NarebskiOct 27, 2010
  6. 2/3 GIT-VERSION-GEN: tweak processing of version fileMathias Lafeldt, Oct 22, 2010
  7. 3/3 GIT-VERSION-GEN: style nitpicksMathias Lafeldt, Oct 22, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.