History

feat: add `gix status --untracked` flag

This allows to control how untracked files are folded, but also can completely turn dirwalking off.

GPT 5.5 committed 4 months ago

Commit 9316ff81 parent d8aeaac3 files · +30 −2Browse files

Showing the changes to gitoxide-core/src (1 of 3 files). Show all

Unified · Split

gitoxide-core/src/repository/status.rs+8−2
@@ -41,6 +41,7 @@ pub struct Options { · 40 unmodified lines
41 pub statistics: bool,41 pub statistics: bool,
42 pub allow_write: bool,42 pub allow_write: bool,
43 pub index_worktree_renames: Option<f32>,43 pub index_worktree_renames: Option<f32>,
44 pub untracked: Option<gix::status::UntrackedFiles>,
44}45}
45 46
46pub fn show(47pub fn show(
@@ -58,6 +59,7 @@ pub fn show( · 11 unmodified lines
58 allow_write,59 allow_write,
59 statistics,60 statistics,
60 index_worktree_renames,61 index_worktree_renames,
62 untracked,
61 }: Options,63 }: Options,
62) -> anyhow::Result<()> {64) -> anyhow::Result<()> {
63 if output_format != OutputFormat::Human {65 if output_format != OutputFormat::Human {
@@ -70,9 +72,13 @@ pub fn show( · 6 unmodified lines
70 let start = std::time::Instant::now();72 let start = std::time::Instant::now();
71 let prefix = repo.prefix()?.unwrap_or(Path::new(""));73 let prefix = repo.prefix()?.unwrap_or(Path::new(""));
72 let index_progress = progress.add_child("traverse index");74 let index_progress = progress.add_child("traverse index");
73 let mut iter = repo75 let mut status = repo
74 .status(index_progress)?76 .status(index_progress)?
75 .should_interrupt_shared(&gix::interrupt::IS_INTERRUPTED)77 .should_interrupt_shared(&gix::interrupt::IS_INTERRUPTED);
78 if let Some(untracked) = untracked {
79 status = status.untracked_files(untracked);
80 }
81 let mut iter = status
76 .index_worktree_options_mut(|opts| {82 .index_worktree_options_mut(|opts| {
77 if let Some((opts, ignored)) = opts.dirwalk_options.as_mut().zip(ignored) {83 if let Some((opts, ignored)) = opts.dirwalk_options.as_mut().zip(ignored) {
78 opts.set_emit_ignored(Some(match ignored {84 opts.set_emit_ignored(Some(match ignored {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t