Skip to content

build: make dist from a git worktree omits VERSION and the generated ChangeLog #4867

Open

Description

@ThalesBarretto

Summary

make dist in a linked worktree (git worktree add) produces a tarball without VERSION, and its ChangeLog is
the tracked one-line placeholder instead of the git log. A normal clone of the same commit produces both.

Cause

gen-VERSION and gen-ChangeLog in the top-level Makefile.am run only when test -d $(top_srcdir)/.git
($(srcdir) for the ChangeLog) is true. 4a6506c (#1856) added that guard so that make dist works without git
(#1855). In a linked worktree .git is a file (gitdir: <path>), so the test is false and both targets are
skipped, although git works there.

Impact

build-aux/pkg-version takes the version from VERSION, else from git describe, else from the current date. The
tarball's own configure is fine, because the version was baked in when autogen.sh ran. Once the tarball is
regenerated with ./autogen.sh or autoreconf, as most distributions do, there is neither a VERSION file nor
git, and the version silently becomes the date:

$ ./configure --version | head -1          # as shipped
glusterfs configure 12dev
$ ./autogen.sh >/dev/null && ./configure --version | head -1
glusterfs configure 2026.10.21

Release branches are commonly checked out as worktrees, so this can reach a real release tarball.

Proposal

Run both targets when .git exists and git works there (test -e plus git -C ... rev-parse --git-dir), PR #4868.

Activity

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