cli: use git config's `core.abbrev` for SHA-1 abbrevs
Implements radicle_cli::git::get_abbrev(), which will
get git’s core.abbrev, which can be applied to COB IDs
and git OIDs (or any SHA1 abbreviation.)
This also respects special cases where core.abbrev can
be legally set to “auto” or “no”, where “auto” gets an appropriate
length based on a loose count of objects in the current repo, and
“no” which doesn’t abbreviate the SHA1 at all.
2 files changed
+74
-5
bb5355fc
→
13d8a81e
modified radicle-cli/src/git.rs
@@ -13,6 +13,7 @@ use std::ops::{Deref, DerefMut};
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -36,6 +37,10 @@ pub const CONFIG_GPG_FORMAT: &str = "gpg.format";
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -331,6 +336,61 @@ pub fn check_version() -> Result<Version, anyhow::Error> {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -348,9 +408,9 @@ pub fn view_diff(
|
|
|
|
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified radicle-cli/src/terminal/format.rs
@@ -14,6 +14,7 @@ use radicle::profile::{env, Profile};
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -27,7 +28,11 @@ pub fn node(node: &NodeId) -> Paint<String> {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -47,7 +52,11 @@ pub fn command<D: fmt::Display>(cmd: D) -> Paint<String> {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|