Skip to content

Commit

Permalink
cli version: Trim the commit id 16 characters
Browse files Browse the repository at this point in the history
16 characters ought to be enough for anyone :)
  • Loading branch information
ilyagr committed Aug 12, 2023
1 parent 0f7d401 commit e87e099
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ fn main() -> std::io::Result<()> {
}
println!("cargo:rerun-if-env-changed=NIX_JJ_GIT_HASH");

if let Some((date, git_hash)) = get_git_date_and_hash() {
if let Some((date, mut git_hash)) = get_git_date_and_hash() {
git_hash.truncate(16);
println!(
"cargo:rustc-env=JJ_VERSION={}-{}-{}",
version, date, git_hash
Expand Down
4 changes: 1 addition & 3 deletions cli/tests/test_global_opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ fn test_no_subcommand() {
let sanitized = stdout.replace(|c: char| c.is_ascii_hexdigit(), "?");
assert_matches!(
sanitized.as_str(),
"jj ?.?.?\n"
| "jj ?.?.?-????????-????????????????????????????????????????\n"
| "jj ?.?.?-nix-????????????????????????????????????????\n"
"jj ?.?.?\n" | "jj ?.?.?-????????-????????????????\n" | "jj ?.?.?-nix-????????????????\n"
);

let stdout = test_env.jj_cmd_success(test_env.env_root(), &["-R", "repo"]);
Expand Down

0 comments on commit e87e099

Please sign in to comment.