Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show untracked files in jj status #5138

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cstoitner
Copy link

This adds the plumbing to get the untracked files from the snapshot to the status command and displays them similar to mercurial. I am not sure if this is the right way to do this.

This might be the last thing to fix #323.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

Copy link
Contributor

@yuja yuja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The implementation generally looks good to me.

// TODO: Report this path to the caller
self.untracked_paths_tx
.send((path, UntrackedReason::FileNotAutoTracked))
.ok();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just reminder: we also need to report untracked directories containing untracked files, but that can be addressed separately.

cli/src/cli_util.rs Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some tests?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will be out of town over the weekend and I'm not sure how much time a will have next week, so it might be a while before I get to that.

@@ -85,6 +87,14 @@ pub(crate) fn cmd_status(
)?;
}

formatter.with_label("diff", |formatter| {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you leave a TODO comment about watchman somewhere?

See 168c797 for the issue.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -258,6 +258,8 @@ pub enum UntrackedReason {
/// Maximum allowed size.
max_size: u64,
},
/// Setting snapshot.auto-track did not match this file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I initially parsed "Setting" as a verb. Maybe "Setting" -> "Config"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-add of untracked files screws me up every time
3 participants