ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/cli
Evan Mesterhazy fc49d35daa Fix empty files can't be selected in the builtin diff editor
This fixes several issues that made working with empty files difficult using
the builtin diff editor.

1. The scm-record library used for the editor expects each file to have at
least one section. For new empty files this should be a file mode section. jj
wasn't rendering this mode section, which prevented empty files from being
selected at all.

2. The scm-record library returns `SelectedContents::Absent` if the file has no
contents after the diff editor is invoked. This can be because of several
reasons: 1) the file is new and empty; 2) the file was empty before and is
still empty; 3) the file has been deleted. Perhaps this is a bug in scm-record
and it should return `SelectedContents::Unchanged` or
`SelectedContents::Present` if the file hasn't been deleted. Until this is
patched upstream, we can work around it by disambiguating these cases.

See https://github.com/arxanas/scm-record/issues/26 for the upstream bug.


Fixes #3016
2024-04-15 23:28:06 -04:00
..
examples cli_util: support multiple extensions consistently 2024-04-12 14:07:33 -04:00
src Fix empty files can't be selected in the builtin diff editor 2024-04-15 23:28:06 -04:00
testing revset: add support for file(kind:pattern) syntax 2024-04-07 19:43:29 +09:00
tests cli: migrate "cat" to matcher API, warn unmatched paths 2024-04-16 10:12:31 +09:00
build.rs
Cargo.toml test_conflicts and test_resolve_command: use indoc! to indent conflict markers in tests 2024-03-22 23:27:25 -07:00
LICENSE