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

Method format_short

atomic-cli/src/commands/log/command.rs:331–350  ·  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

329 ///
330 /// Formatted output string.
331 pub(crate) fn format_short(&self, entries: &[HistoryEntry], hash_length: usize) -> String {
332 let mut output = String::new();
333
334 for entry in entries {
335 let hash_str = format_hash_with_length(&entry.hash, hash_length);
336 let message = entry.message().unwrap_or("(no message)");
337 // Get just the first line
338 let first_line = message.lines().next().unwrap_or(message);
339
340 let tagged_marker = if entry.is_tagged { " *" } else { "" };
341 output.push_str(&format!(
342 "{}{} {}\n",
343 style_hash(&hash_str),
344 hint(tagged_marker),
345 first_line
346 ));
347 }
348
349 output
350 }
351
352 /// Format entries for oneline output.
353 ///

Calls 4

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