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

Re: StGit: kha/{safe,experimental} updated

From
Karl Hasselström <kha@treskal.com>
Date
May 20, 2008, 21:02 UTC
Message-ID
<20080520210249.GA19465@diana.vm.bytemark.co.uk>
In-Reply-To
<b0943d9e0805201019x10bf87ecr1c11c8ee474f6138@mail.gmail.com>
On 2008-05-20 18:19:02 +0100, Catalin Marinas wrote:
Show 33 quoted lines
> 2008/5/20 Karl Hasselström <kha@treskal.com>:
>
> > The system I built works like this at install time:
> >
> >  i1. Create stgit/builtin_version.py, populated with git-describe
> >      output.
> >
> >  i2. Install as usual.
>
> Fine (with some notes for releases, see below).
>
> > And at runtime:
> >
> >  r1. If we have a .git directory, ask git what version we are.
> >      (Actually, we just try to run git describe and see if it
> >      succeeds.)
> >
> >  r2. Otherwise, go with the built-in version (only works if
> >      stgit/builtin_version.py exists).
>
> OK.
>
> > Now, as to released versions, you could simply plop a suitably
> > prepared stgit/builtin_version.py in the tarball, and it'll all
> > work. i1 should fail silently when run from an unpacked tarball,
> > so i2 will pick up the builtin_version.py from the tarball. And at
> > runtime, r1 will fail and we'll fall back to r2.
>
> I build release tarball from the directory under Git control and I
> always get a builtin_version.py generated. In my initial patch I had
> a check in setup.py for a .release file. I could add a check in
> write_builtin_version to ignore the extra .git stuff if I am making
> a release (only keep the tag name).

Nah, easier to just change the order of the checks (try r2 before r1) as I outlined. I'll whip up a patch.

> Another alternative is to check for the number of commits from the
> latest tag and, if this is 0, simply ignore the Git id.

If you're exactly on a tagged commit, git-describe will return just the name of that tag, so you don't need to do anything extra.

> BTW, Git seems to use 6 characters for the current commit id and
> StGIT 5. Should we change this for consistency?

Both git and we call git-describe with --abbrev=4, which I think means "describe the commit uniquely with as few digits as possible, but no less than four". So we'll get upgraded automatically when it becomes necessary.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Catalin MarinasNext: Karl Hasselström
Message 11 of 16 in “StGit: kha/{safe,experimental} updated”
  1. Karl HasselströmMay 14, 2008
  2. 1/2 Import version to a separate namespaceKarl Hasselström, May 14, 2008
  3. 2/2 Better StGit version trackingKarl Hasselström, May 14, 2008
  4. Emacs mode: automatically cd up to root of worktreeKarl Hasselström, May 14, 2008
  5. David KågedalMay 14, 2008
  6. Karl HasselströmMay 14, 2008
  7. New command: stg redoKarl Hasselström, May 14, 2008
  8. Catalin MarinasMay 19, 2008
  9. Karl HasselströmMay 20, 2008
  10. Catalin MarinasMay 20, 2008
  11. Karl HasselströmMay 20, 2008
  12. Try the built-in version string before git-describeKarl Hasselström, May 20, 2008
  13. Catalin MarinasMay 21, 2008
  14. Karl HasselströmMay 21, 2008
  15. Catalin MarinasMay 21, 2008
  16. Karl HasselströmMay 21, 2008

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.