From ff52ea7223235925d3044c976c18ecee0e4a56f6 Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Sat, 11 Feb 2023 19:51:42 +0100 Subject: [PATCH] cli: Show patch id when we run `rad patch list` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit includes a simplification in finding the long patch id in order to perform operations like `patch show ` and `patch checkou `. Actual output ``` ➜ rio git:(main) rad patch list - YOU PROPOSED - patch text 8c94760699e R0 f1b2740 (macros/rad_patch) ahead 1, behind 0 └─ * opened by z6MkuvfwAkZ6yD6Z5TT6YXfJjFNPMQz9fPi9BSU7gwhS9s2x (you) 12 minutes ago └─ * patch id 8c94760699e3e2da64aa9f14f4d2cecfe7b754ad patch text 78e0fb5ad45 R0 f1b2740 (macros/rad_patch) ahead 1, behind 0 └─ * opened by z6MkuvfwAkZ6yD6Z5TT6YXfJjFNPMQz9fPi9BSU7gwhS9s2x (you) 24 minutes ago └─ * patch id 78e0fb5ad45481d225a6fb45f51422e468b55c94 - OTHERS PROPOSED - Nothing to show. ``` Signed-off-by: Vincenzo Palazzo --- radicle-cli/examples/rad-patch.md | 1 + radicle-cli/src/commands/patch/list.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/radicle-cli/examples/rad-patch.md b/radicle-cli/examples/rad-patch.md index e979a8f2..3637e8dc 100644 --- a/radicle-cli/examples/rad-patch.md +++ b/radicle-cli/examples/rad-patch.md @@ -57,6 +57,7 @@ $ rad patch define power requirements d4ef85f57a8 R0 3e674d1 (flux-capacitor-power) ahead 1, behind 0 └─ * opened by z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [..] +└─ * patch id d4ef85f57a849bd845915d7a66a2192cd23811f6 - OTHERS PROPOSED - diff --git a/radicle-cli/src/commands/patch/list.rs b/radicle-cli/src/commands/patch/list.rs index a19b7734..81dcfc67 100644 --- a/radicle-cli/src/commands/patch/list.rs +++ b/radicle-cli/src/commands/patch/list.rs @@ -112,6 +112,7 @@ fn print( common::pretty_sync_status(storage.raw(), *revision.oid, target_head)?, ); term::info!("{}", author_info.join(" ")); + term::info!("{prefix}* patch id {}", term::format::highlight(patch_id)); let mut timeline = Vec::new(); for merge in revision.merges.iter() {