-
Notifications
You must be signed in to change notification settings - Fork 346
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
Redesigning config for diff and merge editors #1285
Comments
My feeling for Somewhat related: Should these tools be defined in the single |
I think that all makes sense. Regarding item 5: Since the arguments usually have to be specified anyway, it doesn't seem like much more work to specify the name of the binary, even if it's often the same as the tool name, like
I agree. I think that's what item 4 says, right? I.e. that we can allow more complex form but we can also allow a form that's easier to read and write for when that's good enough (which is most of the time).
I think we can reuse the |
Yeah, this is one of the problems I wanted to solve. Instead I want configs to look as follows: ui.diff-editor = ["cmd", "tool"]
ui.merge-editor = { command = "...", env = "..."}
# ui.diff-editor = "TOOL" is also valid
[tools.merge.TOOL]
command = "..."
args = ["..."] # This might look different if we implement my point number 5.
env = ["..."]
[tools.diff.TOOL]
command = "..."
args = ["..."]
env = ["..."]
# The following could also be valid, maybe
[tools.diff]
ANOTHER_TOOL = ["sh", "-c", "script", "$left", "$right"] This could potentially support different kinds of tools as well. |
Oh, I though Mercurial started with separate diff-tools/merge-tools sections, and they've got merged later.
I think it's not uncommon on Windows to override only the executable path. |
Good point, that's good to remember. Registry paths are also an interesting point, though to me it doesn't seem prohibitive to simply repeat them. I doubt end users often use them, so it's just a matter of the default config. |
True. It's not meant for user to configure.
A diff tool of Regarding "diff viewer" vs "diff editor", command arguments can be different. I wouldn't pass |
This is basic implementation. There's no config knob to enable the external diff command by default. It reuses the merge-tools table because that's how external diff/merge commands are currently configured. We might want to reorganize them in jj-vcs#1285. If you run "jj diff --tool meld", GUI diff will open and jj will wait for meld to quit. This also applies to "jj log -p". The "diff --tool gui" behavior is somewhat useful, but "log -p --tool gui" wouldn't. We might want some flag to mark the tool output can't be streamed. Another thing to consider is tools that can't generate directory diffs. Git executes ext-diff tool per file, but we don't. Difftastic can compare directories, and doing that should be more efficient since diffs can be computed in parallel (at the expense of unsorted output.) Closes jj-vcs#1886
This is basic implementation. There's no config knob to enable the external diff command by default. It reuses the merge-tools table because that's how external diff/merge commands are currently configured. We might want to reorganize them in jj-vcs#1285. If you run "jj diff --tool meld", GUI diff will open and jj will wait for meld to quit. This also applies to "jj log -p". The "diff --tool gui" behavior is somewhat useful, but "log -p --tool gui" wouldn't. We might want some flag to mark the tool output can't be streamed. Another thing to consider is tools that can't generate directory diffs. Git executes ext-diff tool per file, but we don't. Difftastic can compare directories, and doing that should be more efficient since diffs can be computed in parallel (at the expense of unsorted output.) Closes jj-vcs#1886
This is basic implementation. There's no config knob to enable the external diff command by default. It reuses the merge-tools table because that's how external diff/merge commands are currently configured. We might want to reorganize them in jj-vcs#1285. If you run "jj diff --tool meld", GUI diff will open and jj will wait for meld to quit. This also applies to "jj log -p". The "diff --tool gui" behavior is somewhat useful, but "log -p --tool gui" wouldn't. We might want some flag to mark the tool output can't be streamed. Another thing to consider is tools that can't generate directory diffs. Git executes ext-diff tool per file, but we don't. Difftastic can compare directories, and doing that should be more efficient since diffs can be computed in parallel (at the expense of unsorted output.) Closes jj-vcs#1886
This is basic implementation. There's no config knob to enable the external diff command by default. It reuses the merge-tools table because that's how external diff/merge commands are currently configured. We might want to reorganize them in jj-vcs#1285. If you run "jj diff --tool meld", GUI diff will open and jj will wait for meld to quit. This also applies to "jj log -p". The "diff --tool gui" behavior is somewhat useful, but "log -p --tool gui" wouldn't. We might want some flag to mark the tool output can't be streamed. Another thing to consider is tools that can't generate directory diffs. Git executes ext-diff tool per file, but we don't. Difftastic can compare directories, and doing that should be more efficient since diffs can be computed in parallel (at the expense of unsorted output.) Closes jj-vcs#1886
This is basic implementation. There's no config knob to enable the external diff command by default. It reuses the merge-tools table because that's how external diff/merge commands are currently configured. We might want to reorganize them in #1285. If you run "jj diff --tool meld", GUI diff will open and jj will wait for meld to quit. This also applies to "jj log -p". The "diff --tool gui" behavior is somewhat useful, but "log -p --tool gui" wouldn't. We might want some flag to mark the tool output can't be streamed. Another thing to consider is tools that can't generate directory diffs. Git executes ext-diff tool per file, but we don't. Difftastic can compare directories, and doing that should be more efficient since diffs can be computed in parallel (at the expense of unsorted output.) Closes #1886
Continuing a discussion with @martinvonz and @yuja from ... (couldn't find where), it might be good to redesign the configuration for merge and diff editors along the following lines:
ui.merge-editor
can be either a single word like "TOOL", or a value that would be valid formerge-tools.TOOL
.ui.diff-editor
can be either a single word like "TOOL", or a value that would be valid fordiff-tools.TOOL
. We might also allow it to be a command that can be executed ascommand $left $right
.vim
to execute a scriptvimdirdiff
(orsh -c SOMETHING
) while the merge toolvim
executesvimdiff
.ui.merge-editor
orui.diff-editor
can take is a TOML table, an array["command", "arg1", "arg2"]
, maybe a space-separated string.args
key that works likemerge-args
anddiff-args
work now, as well as acommand
key that always includes the command. It would then be illegal to specify both.Part of the motivation is that I expect the config for diff and merge tools to become more complex with time. For example, we might want to support diff tools that cannot compare dirs but only compare two files. There may be multiple way to call such tools (some might support opening many tabs with separate diffs, some might not) This seems to make the overlap between a merge tool and a diff tool configs confusing as well as the difference between what can be specified where.
WDYT?
The text was updated successfully, but these errors were encountered: