Skip to content

Add git commit hash tracking to library build#95

Merged
moticless merged 2 commits into
redis:mainfrom
moticless:librdb-print-commitid
Jun 3, 2026
Merged

Add git commit hash tracking to library build#95
moticless merged 2 commits into
redis:mainfrom
moticless:librdb-print-commitid

Conversation

@moticless
Copy link
Copy Markdown
Collaborator

@moticless moticless commented Mar 29, 2026

Summary

This PR adds automatic git commit hash tracking to the library build system, making it easier to identify which version of the code is running.

Changes

  • Evaluate short 6-character git commit hash in src/lib/Makefile
  • Pass commit hash as compile-time define via CFLAGS
  • Add fallback to 'unknown' if git commit cannot be determined
  • Log commit hash during parser finalization for version tracking

Example Output

INFO  : Finalizing parser configuration (commit: a70659)

This helps with debugging and support by clearly showing which git commit was used to build the library.


Note

Low Risk
Small build/logging change with no parsing, auth, or data-path behavior changes.

Overview
The library build now bakes in a short git commit id at compile time and prints it when the parser finishes configuration.

src/lib/Makefile resolves a 6-character HEAD hash (or unknown outside git) and passes it via -DLIBRDB_GIT_COMMIT. parser.c defines a fallback macro and extends the existing finalize log line to include (commit: …).

Reviewed by Cursor Bugbot for commit 51492ca. Bugbot is set up for automated code reviews on this repo. Configure here.

@moticless moticless merged commit 4d1b3fc into redis:main Jun 3, 2026
13 checks passed
@moticless moticless deleted the librdb-print-commitid branch June 3, 2026 11:01
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