We add -dirty to the uname version string if the tree does not match the reported hash. Previously, staged but uncommitted changes were ignored.
Details
- Reviewers
imp lwhsu - Group Reviewers
releng - Commits
- rG617c700abae7: newvers.sh: Report -dirty also with staged changes
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
HEAD is a universal pseudo tag that we put into the binary when we add a git tag, so it's perfect. Don't know of a better, faster way unless there's something one can do with git status, but this will certainly do until then.
Gemini says, once you boil away the fluff that
git status --porcelain <path>, but includes untracced files unless ignored. It's for general script checks for local modifications. And is the Fastest ๐. It also handles staged files.
So that might be worth pursuing. '-uno' is what you'd add to skip untracked scanning.
git status --porcelain <path>, but includes untracced files unless ignored. It's for general script checks for local modifications. And is the Fastest ๐. It also handles staged files.
That doesn't provide a useful return code though. Presumably we could check if git status --porcelain -uno returns any output, but I've already tested this change, and I found that and the git diff command have almost identical execution time.