Closed tisonkun closed 1 month ago
Major Git infos:
println!("{}", build::BRANCH); //master
println!("{}", build::SHORT_COMMIT);//8405e28e
println!("{}", build::COMMIT_HASH);//8405e28e64080a09525a6cf1b07c22fcaf71a5c5
println!("{}", build::COMMIT_DATE);//2021-08-04 12:34:03 +00:00
println!("{}", build::COMMIT_AUTHOR);//baoyachi
println!("{}", build::COMMIT_EMAIL);//xxx@gmail.com
println!("{}", build::GIT_CLEAN);//false
println!("{}", build::GIT_STATUS_FILE);//* src/lib.rs (dirty)
Please note that there is a tracking issue and once the last feature (diffing HEAD
with the index) is available, I have already planned to add gix
as option next to using the git
CLI and git2
.
Personally I found using git
(CLI) nice in build scripts as it can save a lot of build-time on CI if the project isn't also using gix
.
Personally I found using git (CLI) nice in build scripts as it can save a lot of build-time on CI if the project isn't also using gix.
Yes. Maybe calling a command is an option, as long as they are not as time-consuming as we were facing in hawkeye to check all the ignored file ..
The reason why shadow-rs
uses git is because it has fewer dependencies and is built faster.
Git CLI is still different from git2. git2 doesn't reduce dependencies too much and you should still compile the -sys crate.
I am very willing to accept PR if it can achieve the same effect while reducing dependence. @tisonkun
@tisonkun I think the reason to support gitoxide
here is to provide another option for projects that…
gitoxide
themselves orgit2
due to portability issues(the points above aren't necessarily mutually exclusive)
This doesn't mean gitoxide
is better or worse, it's pros and cons depending on the usecase. Thus it's not here to replace any of the other options or be a 'successor'.
@tisonkun
By the way,git2
crate dependence are not necessary . shadow-rs
can achieve the same effect using the git command
.
E.g:
[dependencies]
shadow-rs = { version="0.29.0", default-features = false, features = ["tzdb"] }
It looks like it can be closed now.
gix has less dependencies and may have better performance.
I use this crate and notice the dependency of git2 naughty ..
Perhaps I can find some time to give it a try.
cc @Byron