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

Method format_short

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

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

Calls 4

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