Skip to content

git plugin's track-tags option isn't enough for gnulib's git-version-gen #4

Open

Description

@abderrahim

When the track-tags option of the git plugin is enabled, it generates a slimmed-down .git directory enough for git describe and git log to succeed.

However gnulib's git-version-gen script relies on git log . which doesn't work, and returns an error like

fatal: unable to read tree 1bdaa2ce628b458ab6a7c9e03023a9aed221cf75

Activity

  1. nanonyme commented on Jan 26, 2022

    @nanonyme
    Contributor

    Looks like simply writing .tarball-version is enough to convince git-version-gen to do nothing.

  2. nanonyme commented on Apr 19, 2022

    @nanonyme
    Contributor

    Turns out there are bootstrap commands where this workaround doesn't really work.

  3. nanonyme commented on Aug 14, 2022

    @nanonyme
    Contributor

    Reading https://github.com/coreutils/gnulib/blob/master/build-aux/git-version-gen#L157 it looks like it's mostly only using this to test that there is a commit. Git log doesn't need to show more things than the single commit.

  4. abderrahim commented on Aug 14, 2022

    @abderrahim
    ContributorAuthor

    Essentially what I noticed (and implemented for https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/merge_requests/9009) is that to get every corner case covered (mainly git log -1, git log -1 ., git describe --dirty), you need to add all tree objects. Basically a shallow clone until the tag, with all blob objects removed (and with loose objects for reproducibility)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions