This is an archive of the discontinued Mercurial Phabricator instance.

diff: replace --merge option by config option
ClosedPublic

Authored by martinvonz on Feb 5 2021, 3:04 AM.

Details

Summary

I can't think of any reason you'd want to enable the merge diff on a
run-to-run basis; you'd probably either always or never want it set
(though I can't see why you'd never want it set). If you have it set,
you'll probably also want the same output in hg log -p
output. Having a single config option for the feature makes sense.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Feb 5 2021, 3:04 AM
marmoute requested changes to this revision.Feb 5 2021, 7:13 AM
marmoute added a subscriber: marmoute.

This seems too premature for a quite new feature we don't have much experience with.

The current behavior for diff on merge is well established and have valid usecase (eg: when doing traversal following first parents). Keeping this as an explicit flag for now seems preferable.

This revision now requires changes to proceed.Feb 5 2021, 7:13 AM

This seems too premature for a quite new feature we don't have much experience with.
The current behavior for diff on merge is well established and have valid usecase (eg: when doing traversal following first parents). Keeping this as an explicit flag for now seems preferable.

I'm confused about your comment. Do you plan to test it frequently enough that you want to be able to turn it on and off with --merge instead of --config diff.merge=yes? You noticed that it's an experimental flag that turned into an experimental config, right?

martinvonz requested review of this revision.Feb 5 2021, 11:13 AM

This seems too premature for a quite new feature we don't have much experience with.
The current behavior for diff on merge is well established and have valid usecase (eg: when doing traversal following first parents). Keeping this as an explicit flag for now seems preferable.

I'm confused about your comment. Do you plan to test it frequently enough that you want to be able to turn it on and off with --merge instead of --config diff.merge=yes? You noticed that it's an experimental flag that turned into an experimental config, right?

Yes. The flag (with --merge and --no-merge variant) seems like a good idea, at least for a while. We can have a config to change the default flag value (while keeping the flag).

This seems too premature for a quite new feature we don't have much experience with.
The current behavior for diff on merge is well established and have valid usecase (eg: when doing traversal following first parents). Keeping this as an explicit flag for now seems preferable.

I'm confused about your comment. Do you plan to test it frequently enough that you want to be able to turn it on and off with --merge instead of --config diff.merge=yes? You noticed that it's an experimental flag that turned into an experimental config, right?

Yes. The flag (with --merge and --no-merge variant) seems like a good idea, at least for a while. We can have a config to change the default flag value (while keeping the flag).

I assume I can't convince you to use hg diff --from foo^1 --to foo instead. Do you want me to add the --merge flag to hg log -p, hg incoming, and hg outgoing as well or do you think you'll only be experimenting with the feature on hg diff -c?

pulkit accepted this revision.Feb 10 2021, 7:21 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.