Skip to contentSkip to conversation

RFC: Change whatchanged to report changes from merges by default?

DISCUSSION Mark Burton 2 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

Is it just an accident of history or by design that whatchanged requires the -m option to show changes introduced by merges but diff and git log show those changes without requiring any extra options?

Would it not make more sense to have git whatchanged show the changes introduced by merges by default and then people can use the (already supported) --no-merges option to suppress that behaviour?

It appears that just setting rev.ignore_merges to 0 in cmd_whatchanged() would do the trick. Shall I submit a patch?

Mark

#1 lore raw

Hi,

On further studying, I see that 1aec7917dc (git log: don't do merge diffs by default) makes git log only show the log message by default for merges. OK, no problem with that.

However, in my mind, whatchanged is misleading when it doesn't output anything (by default) for merges because, in my mind, that implies that nothing has changed when, in fact, whole heaps of stuff could have been merged in. So, if you forget to add the -m option, whatchanged will silently ignore all the merged stuff and leave the poor user in the dark.

So, if changing the default behaviour is acceptable, I still think it would be better if ignore_merges is set to 0 in cmd_whatchanged() but I guess an alternative would be to set always_show_header, instead.

Any thoughts?

Cheers,

Mark

#2 lore raw
In reply to Mark Burton
Quoted 4 lines · Mark Burton

Is it just an accident of history or by design that whatchanged requires the -m option to show changes introduced by merges but diff and git log show those changes without requiring any extra options?

Mostly personal preference and inertia..

I personally do not see any reason for anybody to use whatchanged (what a long single-word to type!) since around git version v1.0.0 or so. Back then, whatchanged was a good way to satisfy "I want a quick sanity check, but I want to see a bit more than just names of files to assure me. But I want to get that without actually running the diffs or stats because I consider that anything that takes more than half a second is too expensive." But ever since we made the diff generation built-in, the performance objection ceased to be an issue. These days I'd imagine that "log --name-only" or even "log --stat" would be perfectly acceptable and easier to explain alternative, especially if you happen to be a very early adopter whose fingers are trained to type "whatchanged".

IOW, I consider "whatchanged" a command that is kept only for old timers' sake. There is no reason to promote it, but there is no reason to deprecate it, either. Which means the answer to this question...

Quoted 3 lines

Would it not make more sense to have git whatchanged show the changes introduced by merges by default and then people can use the (already supported) --no-merges option to suppress that behaviour?

... is a NO spelled in capital letters.

#3 lore raw
Quoted 9 lines · On Sat, 20 Dec 2008 12:09:05 -0800 Junio C Hamano <[email protected]> wrote:

IOW, I consider "whatchanged" a command that is kept only for old timers' sake. There is no reason to promote it, but there is no reason to deprecate it, either. Which means the answer to this question...

Quoted 3 lines

Would it not make more sense to have git whatchanged show the changes introduced by merges by default and then people can use the (already supported) --no-merges option to suppress that behaviour?

... is a NO spelled in capital letters.

OK (spelled in capital letters), I won't submit the patch.

Cheers,

Mark