-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
cmake: more deterministic git describe --abbrev=12 #13608
cmake: more deterministic git describe --abbrev=12 #13608
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13608 +/- ##
==========================================
- Coverage 52.34% 52.3% -0.04%
==========================================
Files 307 307
Lines 45350 45350
Branches 10464 10464
==========================================
- Hits 23737 23721 -16
- Misses 16865 16877 +12
- Partials 4748 4752 +4
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to --abbrev=12, the build should be system-independent.
-1 to --dirty
I often test patches that I expect will not have an affect on the hex file by doing:
build --build-dir=b_0
git stash
build --build-dir=b_1
kdiff b_0 b_1
without --dirty I can verify that my stashed patch did not corrupt the build, but with --dirty I can not.
Presumably, the BUILD_VERSION exists for non-developers to be able to identify their build, any developer worth his salt will not distribute a build with a dirty working directory, so the --dirty flag is not needed in production, and harmful for developers that test like me.
Thanks everyone for the review.
Interesting, I didn't think of that use case. Making a whitespace change after the git stash would be a simple workaround but I get your point. To solve the same problem I typically do something "git add builddir/" and revert / comment out the source changes "manually" instead of using git stash. Then I can keep using all the same and usual set of git diff options than for source code. For non-trivial commits I tend to want finer-grained "revert" abilities anyway, git stash is too coarse and wouldn't work. For coarse reverts I git checkout HEAD~
Depending on what you mean by "distribute" this is actually quite frequent, for instance when several people debug the same hardware and change the code (debug statements, others) frequently. Or even just one person interrupted by meetings or other context switches. Anyway --dirty is unrelated to the this topic so I'll remove it. Maybe I'll try to make it optional in another PR. |
59f10c7
to
113ebce
Compare
Hardcode --abbrev=12 not to depend on personal git config preference. 12 is deemed large enough for the Linux kernel which should leave some room: https://public-inbox.org/git/[email protected]/ Signed-off-by: Marc Herbert <[email protected]>
113ebce
to
b40d6d0
Compare
The last force push doesn't show any difference because github can apparently not compare commit messages. Doh. |
@carlescufi : This is ready to be merged. |
Hardcode --abbrev=12 not to depend on personal git config preference.
12 is deemed large enough for the Linux kernel which should leave some
room:
https://public-inbox.org/git/[email protected]/
Add --dirty because it should be the default: who likes to be duped into
thinking they're debugging an exact version when they're not?
Signed-off-by: Marc Herbert [email protected]