Skip to content

Commit

Permalink
Allow builds from 'git archive' generated tarballs (extrawurst#2187)
Browse files Browse the repository at this point in the history
Co-authored-by: extrawurst <776816+extrawurst@users.noreply.github.com>
  • Loading branch information
2 people authored and IndianBoy42 committed Jun 4, 2024
1 parent 6c043b8 commit 7c364d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 7c364d8

Please sign in to comment.