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

cli: add another tip to the "max snapshot size" error #3925

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cli/src/command_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,9 @@ impl From<SnapshotError> for CommandError {
- Run `jj config set --repo snapshot.max-new-file-size {}`
This will increase the maximum file size allowed for new files, in this repository only.
- Run `jj --config-toml 'snapshot.max-new-file-size={}' st`
This will increase the maximum file size allowed for new files, for this command only.",
This will increase the maximum file size allowed for new files, for this command only.
Copy link
Contributor

@ilyagr ilyagr Jun 23, 2024

Choose a reason for hiding this comment

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

Perhaps the distinction should be made that with --config-toml, the file will likely get snapshotted and not warn anymore, while with --ignore-working-copy, it will not. Something like:

  • Run jj --config-toml 'snapshot.max-new-file-size={}' st
    This will increase the maximum file size allowed for new files, for this command
    only. Any such command will snapshot all the files under the higher limit.
    They will no longer be considered "new", and this
    warning should not appear again until other large files are added to the repository.
  • Run a one-off informational command with --ignore-working-copy (e.g. jj log --ignore-working-copy).
    This will ignore changes to the working copy. No files will be snapshotted and this warning will occur again on the next command.

- Run the command with `--ignore-working-copy`
This will ignore changes to the working copy that have not been previously snapshotted.",
size.0, size.0
))
}
Expand Down
4 changes: 4 additions & 0 deletions cli/tests/test_working_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ fn test_snapshot_large_file() {
This will increase the maximum file size allowed for new files, in this repository only.
- Run `jj --config-toml 'snapshot.max-new-file-size=13' st`
This will increase the maximum file size allowed for new files, for this command only.
- Run the command with `--ignore-working-copy`
This will ignore changes to the working copy that have not been previously snapshotted.
"###);

// test with a larger file using 'KB' human-readable syntax
Expand All @@ -50,5 +52,7 @@ fn test_snapshot_large_file() {
This will increase the maximum file size allowed for new files, in this repository only.
- Run `jj --config-toml 'snapshot.max-new-file-size=11264' st`
This will increase the maximum file size allowed for new files, for this command only.
- Run the command with `--ignore-working-copy`
This will ignore changes to the working copy that have not been previously snapshotted.
"###);
}