threads / discuss / 16805

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

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

## tl;dr

4 messages between Dec 20, 2008 and Dec 20, 2008.

replies: 3people: 2as markdown or json

Mark Burton· Dec 20, 2008, 10:42 UTC · lore
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
Mark Burton· Dec 20, 2008, 17:22 UTC · re: Mark Burton · lore

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

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
Junio C Hamano· Dec 20, 2008, 20:09 UTC · re: Mark Burton · lore

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

Mark Burton <markb@ordern.com> writes:
> 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...

> 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.
Mark Burton· Dec 20, 2008, 20:21 UTC · re: Junio C Hamano · lore

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

On Sat, 20 Dec 2008 12:09:05 -0800 Junio C Hamano <gitster@pobox.com> wrote:

Show 9 quoted lines
> 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...
> 
> > 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

← back to recent threads