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

Fix logic to update version when HEAD changes. #10896

Merged
merged 1 commit into from
Jun 6, 2024

Commits on Jun 6, 2024

  1. Fix logic to update version when HEAD changes.

    Fixes helix-editor#10855.
    
    The loader build.rs tries to determine when HEAD changes,
    so it can re-run and update the embedded version.
    
    It was shelling out to do this, and capturing a trailing newline,
    so it always thought HEAD did not exist.
    
    I confirmed that if I update helix-term, helix-loader rebuilds and updates the commit hash:
    
    ```
    [rcorre@midgar helix]$ git rev-parse --short HEAD
    e24eed2c
    [rcorre@midgar helix]$ hx --version
    helix 24.3 (e24eed2c)
    [rcorre@midgar helix]$ hx helix-term/src/main.rs
    [rcorre@midgar helix]$ git cma "test changing helix-term"
    [fix-version cbb68bab] test changing helix-term
     1 file changed, 1 insertion(+)
    [rcorre@midgar helix]$ cargo install --path helix-term --locked
      Installing helix-term v24.3.0 (/home/rcorre/src/helix/helix-term)
        Updating crates.io index
       Compiling helix-loader v24.3.0 (/home/rcorre/src/helix/helix-loader)
       Compiling helix-term v24.3.0 (/home/rcorre/src/helix/helix-term)
       ... snip ...
    [rcorre@midgar helix]$ git rev-parse --short HEAD
    cbb68bab
    [rcorre@midgar helix]$ hx --version
    helix 24.3 (cbb68bab)
    ```
    rcorre committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    f8b0f5e View commit details
    Browse the repository at this point in the history