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

Method print_short_format

atomic-cli/src/commands/status.rs:387–431  ·  view source on GitHub ↗

Print the status in short (porcelain) format.

(&self, status: &RepositoryStatus)

Source from the content-addressed store, hash-verified

385
386 /// Print the status in short (porcelain) format.
387 fn print_short_format(&self, status: &RepositoryStatus) -> CliResult<()> {
388 // Print added files and directories
389 for entry in status.added() {
390 let path_str = entry.path().display().to_string();
391 let is_dir = entry.details().map(|d| d == "directory").unwrap_or(false);
392 if is_dir {
393 println!("AD {}", path_str);
394 } else {
395 println!("A {}", path_str);
396 }
397 }
398
399 // Print modified files
400 for entry in status.modified() {
401 let path_str = entry.path().display().to_string();
402 println!("M {}", path_str);
403 }
404
405 // Print deleted files and directories
406 for entry in status.deleted() {
407 let path_str = entry.path().display().to_string();
408 let is_dir = entry.details().map(|d| d == "directory").unwrap_or(false);
409 if is_dir {
410 println!("DD {}", path_str);
411 } else {
412 println!("D {}", path_str);
413 }
414 }
415
416 // Print conflicted files
417 for entry in status.conflicted() {
418 let path_str = entry.path().display().to_string();
419 println!("C {}", path_str);
420 }
421
422 // Print untracked files
423 if !self.no_untracked {
424 for entry in status.untracked() {
425 let path_str = entry.path().display().to_string();
426 println!("?? {}", path_str);
427 }
428 }
429
430 Ok(())
431 }
432
433 /// Print a stable, versioned status document for editor integrations.
434 fn print_json_format(

Calls 8

displayMethod · 0.80
detailsMethod · 0.80
conflictedMethod · 0.80
untrackedMethod · 0.80
addedMethod · 0.45
pathMethod · 0.45
modifiedMethod · 0.45
deletedMethod · 0.45