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

Feature request: Expose git information #1590

Closed
nbigaouette opened this issue Apr 27, 2023 · 1 comment
Closed

Feature request: Expose git information #1590

nbigaouette opened this issue Apr 27, 2023 · 1 comment

Comments

@nbigaouette
Copy link

I like to include git information in my builds. So for that I shell out at the top of my justfile to git to set variables:

git_commit_short := `git rev-parse --short HEAD`
git_commit_full  := `git rev-parse HEAD`
git_branch_name  := `git branch --show-current` # Requires git 2.22

(and potentially others)

This requires:

  1. git is installed
  2. a subshell

I try to minimize the amount of subshelling I do as to try to prevent cross platform issues (looking at you powershell).

Using gix/gitoxide (https://github.com/Byron/gitoxide/) would probably work out to get that information natively in Rust.

@casey
Copy link
Owner

casey commented May 1, 2023

This would be cool, but it doesn't seem worth including git/gitoxide in just, which are large dependencies which would increase build time and executable size.

@casey casey closed this as completed May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants