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

build(utils/version): add correct git HEAD paths #719

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ module.exports = {
'code-review-rule': ({subject}) => {
const REVIEW_COMMENTS = `Please don't merge code-review commits, instead squash them in the parent commit`;
if (subject.includes('code-review')) return [ false, REVIEW_COMMENTS ];
if (subject.includes('review comments')) return [ false, REVIEW_COMMENTS ];
if (subject.includes('address comments')) return [ false, REVIEW_COMMENTS ];
if (subject.includes('review comment')) return [ false, REVIEW_COMMENTS ];
if (subject.includes('address comment')) return [ false, REVIEW_COMMENTS ];
if (subject.includes('addressed comment')) return [ false, REVIEW_COMMENTS ];
return [ true ];
},
},
Expand Down
3 changes: 3 additions & 0 deletions scripts/git/branch_ancestor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ function findBranchesSharingFirstCommonCommit() {
local BASE_BRANCH
if [[ -z "${1+x}" || "$1" == '.' ]]; then
BASE_BRANCH="$CURRENT_BRANCH"
if [ "$CURRENT_BRANCH" = "" ]; then
return
fi
else
BASE_BRANCH="$1"
fi
Expand Down
13 changes: 10 additions & 3 deletions utils/utils-lib/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@ fn main() -> BuildResult {
String::from_utf8_lossy(&output.stderr)
);

let git_path = std::path::Path::new("../../.git");
if git_path.exists() {
println!("cargo:rerun-if-changed=../../.git/HEAD");
fn add_git_head(root: &str) {
let git_path = std::path::Path::new(root).join(".git/HEAD");
if git_path.exists() {
println!("cargo:rerun-if-changed={}", git_path.display());
}
}

add_git_head("../..");
if let Ok(ext) = std::env::var("EXTENSIONS_SRC") {
add_git_head(&ext);
}

Ok(())
Expand Down
Loading