Revert "feat: add build sha to parser.c header comment" (#4475)

This reverts commit dc4e232e6e.

Reason: The sha in the generated output (which most distro builds of
tree-sitter, including `cargo install`, strip) produces too many
conflicts when verifying via CI that parsers are regenerated on every
grammar change.
This commit is contained in:
Christian Clason 2025-05-29 20:47:06 +02:00 committed by GitHub
parent ca64399f9f
commit e7f9160867
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1 additions and 40 deletions

View file

@ -24,7 +24,6 @@ pub const ABI_VERSION_MIN: usize = 14;
pub const ABI_VERSION_MAX: usize = tree_sitter::LANGUAGE_VERSION;
const ABI_VERSION_WITH_RESERVED_WORDS: usize = 15;
const BUILD_VERSION: &str = env!("CARGO_PKG_VERSION");
const BUILD_SHA: Option<&'static str> = option_env!("BUILD_SHA");
#[clippy::format_args]
macro_rules! add {
@ -324,13 +323,9 @@ impl Generator {
}
fn add_header(&mut self) {
let version = BUILD_SHA.map_or_else(
|| BUILD_VERSION.to_string(),
|build_sha| format!("{BUILD_VERSION} ({build_sha})"),
);
add_line!(
self,
"/* Automatically @generated by tree-sitter v{version} */",
"/* Automatically @generated by tree-sitter v{BUILD_VERSION} */",
);
add_line!(self, "");
}