Skip to content

Conversation

jca02266
Copy link
Owner

@jca02266 jca02266 commented May 2, 2025

Generates version strings from the latest Git commit hash when inside a Git work tree, or from .tarball-version when building from a release archive. With the --dist option, omits the commit hash for distribution builds. Automatically generates .tarball-version during 'make dist' and includes it in the tarball.

Generates version strings from the latest Git commit hash when inside a Git work tree,
or from .tarball-version when building from a release archive.
With the --dist option, omits the commit hash for distribution builds.
Automatically generates .tarball-version during 'make dist' and includes it in the tarball.
@hirotosakai
Copy link
Contributor

英語が苦手なので日本語で失礼します。
ぜひmergeしていただきたいと思います。一点、build-aux/gen-build-version.shの14行目と15行目でコマンドが違うのに違和感があります。

HASH=$(git log -1 --pretty=format:"%h")

で良いのでは。

jca02266 added 3 commits May 5, 2025 11:07
Simplifies version generation by replacing separate git commands
with a single git log call. Also adds OUTPUT_FOR_DIST flag.
…cible builds

- dist-hook now forcibly regenerates .tarball-version using gen-build-version.sh --dist,
  ensuring consistent PACKAGE_VERSION for distribution builds.
- Invokes autoconf with --force to always update configure script during dist.
- Moves .tarball-version generation logic directly into dist-hook for clarity.
- gen-build-version.sh prioritizes existing non-empty .tarball-version early for reproducibility.
- gen-build-version.sh now checks for non-empty .tarball-version early using `-s`,
  to avoid mistakenly using an empty file that may briefly exist during `make dist`.
This improves clarity, reproducibility, and avoids issues where an empty `.tarball-version` file
might be created and read within the same `make dist` process.

- Add `-o <file>` option to write the generated version string directly to the specified file,
  replacing the use of shell redirection (`> .tarball-version`) in Makefile.
- Suppress stdout when `-o` is used to avoid duplicate or premature outputs.
- Restore fallback to `.tarball-version` only when `-o` is not specified and no Git info is available.
- Extract version output logic into a unified `output_version` function.
- Move Git working tree checks into `check_git_clean_for_dist` helper for --dist validation.
- Update `Makefile.am` to use `-o .tarball-version`, preventing race conditions where
  an empty `.tarball-version` file might be created and read within the same `make dist` process.
@jca02266
Copy link
Owner Author

jca02266 commented May 6, 2025

英語は全部chatgptですwいい時代になりました

jca02266 added 6 commits May 6, 2025 11:50
…option to gen-build-version.sh

- Modified `configure.ac` to allow the build to proceed without breaking even if there are uncommitted changes.
- Added the `--verify` option to check if the Git repository is clean before generating the version string,
  only when the option is specified.
- Updated `dist-hook` in `Makefile.am` to include the `--verify` option.
@jca02266 jca02266 mentioned this pull request Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants