MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / format_short

Method format_short

atomic-cli/src/commands/log/command.rs:304–323  ·  view source on GitHub ↗

Format entries for short output. # Arguments `entries` - History entries to format `hash_length` - Number of hash characters to display # Returns Formatted output string.

(&self, entries: &[HistoryEntry], hash_length: usize)

Source from the content-addressed store, hash-verified

302 ///
303 /// Formatted output string.
304 pub(crate) fn format_short(&self, entries: &[HistoryEntry], hash_length: usize) -> String {
305 let mut output = String::new();
306
307 for entry in entries {
308 let hash_str = format_hash_with_length(&entry.hash, hash_length);
309 let message = entry.message().unwrap_or("(no message)");
310 // Get just the first line
311 let first_line = message.lines().next().unwrap_or(message);
312
313 let tagged_marker = if entry.is_tagged { " *" } else { "" };
314 output.push_str(&format!(
315 "{}{} {}\n",
316 style_hash(&hash_str),
317 hint(tagged_marker),
318 first_line
319 ));
320 }
321
322 output
323 }
324
325 /// Format entries for oneline output.
326 ///

Calls 4

format_hash_with_lengthFunction · 0.85
messageMethod · 0.45
nextMethod · 0.45
linesMethod · 0.45