Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git_describe_working_tree dirty/clean detection unreliable #84

Open
bmcdonnell-fb opened this issue Sep 20, 2024 · 1 comment
Open

git_describe_working_tree dirty/clean detection unreliable #84

bmcdonnell-fb opened this issue Sep 20, 2024 · 1 comment

Comments

@bmcdonnell-fb
Copy link

# These functions force a re-configure on each git commit so that you can
# trust the values of the variables in your build system.

Where/how is that implemented?

It is insufficient to cause the git_describe_working_tree function to reliably generate (or not generate) the -dirty suffix. Ideally, it should also force a reconfigure when the git working tree status toggles between dirty/clean. (Or when such status has changed since the last cmake configure.)

To observe:

  1. Setup
    • Set up a project with a target that captures the output of git_describe_working_tree
    • git commit
    • CMake configure & build. Note the captured version is clean (no -dirty suffix)
  2. False clean detection
    • Modify a tracked source file. Git worktree status is now dirty.
    • Build the project
      • CMake does not automatically (re)configure
      • Captured version is missing the -dirty suffix
  3. False dirty detection
    • CMake configure (manually) & build
      • Captured version now correctly contains the -dirty suffix
    • git reset --hard. Build again
      • Captured version still (errantly) contains the -dirty suffix

@rpavlik, @dawid-aurobit (contributor of #41)

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

No branches or pull requests

1 participant