Files
Gert Pellin - GPEandFredApps 391cb01710 --version: name the commit of a dev build from git (#5247) (#5300)
* --version: name the commit of a dev build from git (#5247)

A plain cargo build reported only '0.8.2 (dev build)'. The desktop and
CLI build scripts now read the checkout's commit (git rev-parse HEAD,
rerun when HEAD moves) and the binaries hand it to build_info at start,
giving '0.8.2 (dev build, 6f8505421)'. Release builds keep
PHOTOCRAFT_BUILD_SHA and their format; without git, or when the
workspace isn't the root of the checkout (a source tarball unpacked in
another repository), it stays '(dev build)'. The engine itself still
doesn't shell out, so a commit doesn't rebuild it.

* --version: only watch git paths that exist (#5247)

Cargo treats a missing rerun-if-changed path as always changed: it re-ran
the build script and recompiled photocraft and photocraft-cli on every
build when packed-refs (or the branch's loose ref) did not exist. Watch
HEAD and packed-refs only when present, and for a packed branch the
nearest existing directory under refs/, so the first commit on it, which
writes the loose ref, still triggers a rebuild.

* --version: watch an unborn branch and reftable checkouts (#5247)

The git paths are now registered before asking for the commit, so the first
commit on an unborn branch re-runs the build script. A reftable checkout
watches reftable/tables.list, which every ref update rewrites, instead of a
loose ref or packed-refs.

* --version: git fixtures ignore the caller's repository and ref format (#5247)

The test fixtures run git without GIT_DIR, GIT_WORK_TREE, GIT_COMMON_DIR,
GIT_INDEX_FILE and GIT_DEFAULT_REF_FORMAT, and the files-format fixtures pass
init.defaultRefFormat=files, so a reftable default or an inherited GIT_DIR
can't move or reshape them.

* --version: the git fixtures join the app's tests/it binary (#5247)

Main builds each crate's integration tests as one binary. The desktop
--version test now hands the checkout's commit to build_info as the
binary does, so both print the same dev build string.

---------

Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-28 08:11:58 +01:00
..
2026-11-26 00:25:17 +01:00
2026-11-15 15:18:27 +01:00
2026-11-12 23:46:00 +00:00
…