Skip to content

Allow builds from 'git archive' generated tarballs #2187

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

Merged
merged 2 commits into from
May 30, 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ but this also allows us now to define colors in the common hex format:

Checkout [THEMES.md](./THEMES.md) for more info.

### Added
* support `TAR_COMMIT_ID` enabling builds from `git archive` generated source tarballs or other outside a git repo [[@alerque](https://github.com/alerque)] ([#2187](https://github.com/extrawurst/gitui/pull/2187))

### Fixes
* update yanked dependency to `libc` to fix building with `--locked`.
* document breaking change in theme file format.
Expand Down
7 changes: 6 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ use chrono::TimeZone;
fn get_git_hash() -> String {
use std::process::Command;

// Allow builds from `git archive` generated tarballs if output of `git get-tar-commit-id` is
// set in an env var.
if let Ok(commit) = std::env::var("TAR_COMMIT_ID") {
return commit[..7].to_string();
};
let commit = Command::new("git")
.arg("rev-parse")
.arg("--short")
.arg("--short=7")
.arg("--verify")
.arg("HEAD")
.output();
Expand Down
Loading