-
-
Notifications
You must be signed in to change notification settings - Fork 445
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
Git integration (issue #7) #495
Conversation
Codecov Report
@@ Coverage Diff @@
## master #495 +/- ##
==========================================
+ Coverage 88.48% 88.76% +0.27%
==========================================
Files 36 40 +4
Lines 3535 3951 +416
==========================================
+ Hits 3128 3507 +379
- Misses 407 444 +37
Continue to review full report at Codecov.
|
I found a bug when I use options |
f197535
to
4556325
Compare
Since git2 has inconsistent behaviors on
|
* Enabled using `cargo build --feature=git` * git block is by default on the left of name block * use `lsd --git --long` to enable git status info (only available on long display) * sort by git status using `lsd --sort=git --long`
Test enum completeness in color map using enum iteration from strum macros
Parent directory git status will not fetch another parent repository if different of the current one.
color::tests::test_elem_map_completeness verify the consistency between between Elem value and theme. Elem::TreeEdge could be re-enabled when its theme will ok.
4556325
to
c7baca2
Compare
|
NB: to support conditional compilation, I used a stub file ( |
Hey, sorry about the delay. I have been pretty busy the past few weeks. Will try to get this reviewed by this week. |
If I may give feedback, I've been using this branch on my machine for more than a week and found no issues whatsoever. |
Thank you for your comment. I will check ASAP (probably next week) what happens in this case and how to fix it. |
May be https://crates.io/crates/git-repository could be a simple replacement to git2-rs. |
Hey @hpwxf , sorry for kinda abandoning this PR. If you are still interested and won't mind fixing up the conflicts and addressing the previous issue we can get this in. |
What do you think are the primary advantages of switching to this? |
I'm closing this, but if folks want to continue on this, we can open this back up and continue work on this. Sorry that the work you did could not get merged. |
Add git integration (cf issue #7)
Use git2-rs to get git info. Unfortunately, it is not available on all targets. To enable it, use
cargo build --features=git
.In travis config, this feature is enabled using a new FEATURES environment variable (where it is not set, git2-rs does not compile; cf https://travis-ci.com/github/hpwxf/lsd/builds/219208311).
git_stub.rs
file contains a minimal set of empty/disabled features to minimize condition compilation in other files.--blocks
optionlsd --git --long
to enable git status info (only available on long display)lsd --sort=git --long
NB: crate
log
has also been defined in Cargo.toml to provide debug feature.release_max_level_error
feature disables log macros in release mode.cargo fmt