git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] git-gui: change to display the combined diff in the  case of conflicts.
@ 2010-03-30 15:34 Jon Seymour
  2010-03-31  7:20 ` Johannes Sixt
  0 siblings, 1 reply; 10+ messages in thread
From: Jon Seymour @ 2010-03-30 15:34 UTC (permalink / raw)
  To: Git Mailing List, spearce, Johannes Sixt

This variant of the patch uses git diff -c instead of git diff HEAD,
at Johannes Sixt's suggestion.

The diff displayed in case of a merge conflict now shows the
differences between the merge result and each of the local and remote
heads and thus now also allows the user to assess the consequences of
"Use Remote Version" by showing how the merge result affects the state
of the local branch.

I have avoided using gmail client to forward this version of  patch
because of documented word-wrapping issues, so hopefully this will
apply cleanly.

[PATCH v3 1/2] git-gui: Introduce is_unmerged global variable to
encapsulate its derivation.
[PATCH v3 2/2] git-gui: change to display the combined diff in the
case of conflicts.

jon.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] git-gui: change to display the combined diff in the  case of conflicts.
  2010-03-30 15:34 [PATCH v3 0/2] git-gui: change to display the combined diff in the case of conflicts Jon Seymour
@ 2010-03-31  7:20 ` Johannes Sixt
  2010-03-31 11:12   ` Jon Seymour
  0 siblings, 1 reply; 10+ messages in thread
From: Johannes Sixt @ 2010-03-31  7:20 UTC (permalink / raw)
  To: Jon Seymour; +Cc: Git Mailing List, spearce

Am 3/30/2010 17:34, schrieb Jon Seymour:
> This variant of the patch uses git diff -c instead of git diff HEAD,
> at Johannes Sixt's suggestion.
> 
> The diff displayed in case of a merge conflict now shows the
> differences between the merge result and each of the local and remote
> heads and thus now also allows the user to assess the consequences of
> "Use Remote Version" by showing how the merge result affects the state
> of the local branch.
> 
> I have avoided using gmail client to forward this version of  patch
> because of documented word-wrapping issues, so hopefully this will
> apply cleanly.
> 
> [PATCH v3 1/2] git-gui: Introduce is_unmerged global variable to
> encapsulate its derivation.
> [PATCH v3 2/2] git-gui: change to display the combined diff in the
> case of conflicts.

I looked at the result, but it does not convince me. In my case, I have a
large file that has many changes between the "maint" and "master"
branches. Whenever there are conflicts after merging "maint" to "master",
I see all these changes, and really they *are* uninteresting.

But I, too, think that to offer "Use local version" and "Use remote
version" is *very* dangerous in a modify/modify conflict, particularly to
new-comers. I have only ever found these commands useful in the case of
modify/delete conflicts (and they are actually very handy in this case).

Even when the user sees all changes and can make a decision whether "Use
local" or "remote version" is really wanted, it is not at all obvious
which of the changes shown belong the "local" and which to "remote".

Therefore, I suggest to keep the original --cc display, but do not offer
"Use local version" and "Use remote version" when there is a modify/modify
conflict. The user is already offered "Run mergetool", and it is the safe
option besides editing the file.

-- Hannes

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] git-gui: change to display the combined diff in  the case of conflicts.
  2010-03-31  7:20 ` Johannes Sixt
@ 2010-03-31 11:12   ` Jon Seymour
  2010-03-31 11:39     ` Johannes Sixt
  0 siblings, 1 reply; 10+ messages in thread
From: Jon Seymour @ 2010-03-31 11:12 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Git Mailing List, spearce

> I looked at the result, but it does not convince me. In my case, I have a
> large file that has many changes between the "maint" and "master"
> branches. Whenever there are conflicts after merging "maint" to "master",
> I see all these changes, and really they *are* uninteresting.
>

I think you may have missed the point of my patch.

The successfully merged lines may be uninteresting from the point of
deciding what I should *do* but they
are highly relevant to the question of what I really, really should *not* do.

If there are 100 successfully merged lines from each side of the merge
but only 2 conflicting lines, should I

a) pick the remote branch
b) pick the local branch
c) manually edit the conflicting line (or use a merge tool)

The point of my patch it to make it much more likely that you will pick c).

In the current state, the GUI doesn't make it clear that either a) or
b) is almost certainly a huge mistake.

Now, you could disable Use Remote and Use Local for all but the very
simplest cases - but you don't need it for these
cases. Hell, ed would do for these.

jon.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] git-gui: change to display the combined diff in the case of conflicts.
  2010-03-31 11:12   ` Jon Seymour
@ 2010-03-31 11:39     ` Johannes Sixt
  2010-03-31 11:50       ` Jon Seymour
  2010-03-31 12:23       ` Jon Seymour
  0 siblings, 2 replies; 10+ messages in thread
From: Johannes Sixt @ 2010-03-31 11:39 UTC (permalink / raw)
  To: Jon Seymour; +Cc: Git Mailing List, spearce

Am 3/31/2010 13:12, schrieb Jon Seymour:
>> I looked at the result, but it does not convince me. In my case, I have a
>> large file that has many changes between the "maint" and "master"
>> branches. Whenever there are conflicts after merging "maint" to "master",
>> I see all these changes, and really they *are* uninteresting.
>>
> 
> I think you may have missed the point of my patch.
> 
> The successfully merged lines may be uninteresting from the point of
> deciding what I should *do* but they
> are highly relevant to the question of what I really, really should *not* do.

How would you decide that if you cannot read the information that is
presented to you?

Can you tell without thinking for 10 seconds which of these two changes is
lost if you choose "Use local version"?

@@@ ... @@@
  x
 +foo
  y
@@@ ... @@@
  a
- bar
  b

Oh, it's easy for the conflicted part of the diff, which you'll see
elsewhere as well:

@@@ ... @@@
  r
++<<<<<<< HEAD
 +foo
++=======
+ bar
++>>>>>>> some-branch
  s

Do not forget that in a case (like mine) where the non-condensed diff is
actually huge, the conflict markers would no exactly be easy to find in
the diff.

> If there are 100 successfully merged lines from each side of the merge
> but only 2 conflicting lines, should I
> 
> a) pick the remote branch
> b) pick the local branch
> c) manually edit the conflicting line (or use a merge tool)
> 
> The point of my patch it to make it much more likely that you will pick c).

And I was saying almost the same, namely that it should not only be "much
more likely" to pick c, but to *always* pick c (by making it the only
option available).

> In the current state, the GUI doesn't make it clear that either a) or
> b) is almost certainly a huge mistake.

And therefore I suggest to disable these options.

> Now, you could disable Use Remote and Use Local for all but the very
> simplest cases - but you don't need it for these
> cases. Hell, ed would do for these.

Which are those very simplest cases that you are referring to? If you mean
modify/delete conflicts, then I indeed would like to keep the options for
them.

That said, your earlier patch that presented the diff against HEAD was not
bad after all.

-- Hannes

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] git-gui: change to display the combined diff in  the case of conflicts.
  2010-03-31 11:39     ` Johannes Sixt
@ 2010-03-31 11:50       ` Jon Seymour
  2010-03-31 12:23       ` Jon Seymour
  1 sibling, 0 replies; 10+ messages in thread
From: Jon Seymour @ 2010-03-31 11:50 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Git Mailing List, spearce

On Wed, Mar 31, 2010 at 11:39 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> Am 3/31/2010 13:12, schrieb Jon Seymour:
>>> I looked at the result, but it does not convince me. In my case, I have a
>>> large file that has many changes between the "maint" and "master"
>>> branches. Whenever there are conflicts after merging "maint" to "master",
>>> I see all these changes, and really they *are* uninteresting.
>>>
>>
>> I think you may have missed the point of my patch.
>>
>> The successfully merged lines may be uninteresting from the point of
>> deciding what I should *do* but they
>> are highly relevant to the question of what I really, really should *not* do.
>
> How would you decide that if you cannot read the information that is
> presented to you?
>
> Can you tell without thinking for 10 seconds which of these two changes is
> lost if you choose "Use local version"?
>
> @@@ ... @@@
>  x
>  +foo
>  y
> @@@ ... @@@
>  a
> - bar
>  b
>
> Oh, it's easy for the conflicted part of the diff, which you'll see
> elsewhere as well:
>
> @@@ ... @@@
>  r
> ++<<<<<<< HEAD
>  +foo
> ++=======
> + bar
> ++>>>>>>> some-branch
>  s
>
> Do not forget that in a case (like mine) where the non-condensed diff is
> actually huge, the conflict markers would no exactly be easy to find in
> the diff.

But that's exactly the point - not to make the choice easy, but to
make it obvious that the choice is *not easy*.

The problem is that as it stands the user things the only choice is
between choosing "foo" and choosing "bar".

> ++<<<<<<< HEAD
>  +foo
> ++=======
> + bar
> ++>>>>>>> some-branch

This is a false choice but it is not obviously so.

The point of using diff -c is *precisely* to help the user understand
that it isn't a choice between foo and bar, but a choice
between losing all the changes that came with foo and all the changes
that came with bar.


> And therefore I suggest to disable these options.
>

I agree that this would be a better solution than leaving the behaviour as is.

> Which are those very simplest cases that you are referring to? If you mean
> modify/delete conflicts, then I indeed would like to keep the options for
> them.

The simplest case is when the presented diff presents the *whole*
difference between the local and remote branches.

As it stands, the gui can mislead the user into believing that the
presented diff is the whole difference and that their only
choice is between foo and bar.

Sure, users who have been bitten by this misapprehension will learn,
but it is hard lesson to learn.

>
> That said, your earlier patch that presented the diff against HEAD was not
> bad after all.

I prefer the -c version - not because the output is easy to
understand, but precisely because it gives pause.

jon.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] git-gui: change to display the combined diff in  the case of conflicts.
  2010-03-31 11:39     ` Johannes Sixt
  2010-03-31 11:50       ` Jon Seymour
@ 2010-03-31 12:23       ` Jon Seymour
  2010-03-31 13:51         ` Johannes Sixt
  1 sibling, 1 reply; 10+ messages in thread
From: Jon Seymour @ 2010-03-31 12:23 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Git Mailing List, spearce

What about the safe (but complicated) diff -c by default (to prevent
misinformed Use Remote/Local decisions, by default) and a "Conflicts
Only" option (disabled by default) that shows the diff --cc output for
those who know what they are doing?

jon.

On Wed, Mar 31, 2010 at 11:39 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> Am 3/31/2010 13:12, schrieb Jon Seymour:
>>> I looked at the result, but it does not convince me. In my case, I have a
>>> large file that has many changes between the "maint" and "master"
>>> branches. Whenever there are conflicts after merging "maint" to "master",
>>> I see all these changes, and really they *are* uninteresting.
>>>
>>
>> I think you may have missed the point of my patch.
>>
>> The successfully merged lines may be uninteresting from the point of
>> deciding what I should *do* but they
>> are highly relevant to the question of what I really, really should *not* do.
>
> How would you decide that if you cannot read the information that is
> presented to you?
>
> Can you tell without thinking for 10 seconds which of these two changes is
> lost if you choose "Use local version"?
>
> @@@ ... @@@
>  x
>  +foo
>  y
> @@@ ... @@@
>  a
> - bar
>  b
>
> Oh, it's easy for the conflicted part of the diff, which you'll see
> elsewhere as well:
>
> @@@ ... @@@
>  r
> ++<<<<<<< HEAD
>  +foo
> ++=======
> + bar
> ++>>>>>>> some-branch
>  s
>
> Do not forget that in a case (like mine) where the non-condensed diff is
> actually huge, the conflict markers would no exactly be easy to find in
> the diff.
>
>> If there are 100 successfully merged lines from each side of the merge
>> but only 2 conflicting lines, should I
>>
>> a) pick the remote branch
>> b) pick the local branch
>> c) manually edit the conflicting line (or use a merge tool)
>>
>> The point of my patch it to make it much more likely that you will pick c).
>
> And I was saying almost the same, namely that it should not only be "much
> more likely" to pick c, but to *always* pick c (by making it the only
> option available).
>
>> In the current state, the GUI doesn't make it clear that either a) or
>> b) is almost certainly a huge mistake.
>
> And therefore I suggest to disable these options.
>
>> Now, you could disable Use Remote and Use Local for all but the very
>> simplest cases - but you don't need it for these
>> cases. Hell, ed would do for these.
>
> Which are those very simplest cases that you are referring to? If you mean
> modify/delete conflicts, then I indeed would like to keep the options for
> them.
>
> That said, your earlier patch that presented the diff against HEAD was not
> bad after all.
>
> -- Hannes
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] git-gui: change to display the combined diff in the case of conflicts.
  2010-03-31 12:23       ` Jon Seymour
@ 2010-03-31 13:51         ` Johannes Sixt
  2010-03-31 19:52           ` Jon Seymour
  0 siblings, 1 reply; 10+ messages in thread
From: Johannes Sixt @ 2010-03-31 13:51 UTC (permalink / raw)
  To: Jon Seymour; +Cc: Git Mailing List, spearce

Am 3/31/2010 14:23, schrieb Jon Seymour:
> What about the safe (but complicated) diff -c by default (to prevent
> misinformed Use Remote/Local decisions, by default) and a "Conflicts
> Only" option (disabled by default) that shows the diff --cc output for
> those who know what they are doing?

You would like to have the worst of all three?

1. dangerous menu options
2. incomprehensible diff -c output
3. and a config option on top of it

I think we should have none of them.

Yes, I suggested diff -c, but after seeing how it works (better: not
works), I changed my mind.

What sort of user guidance is it to present alluring menu options "Use
local/remote version", but at the same time a scaring amount of diff -c
output.

-- Hannes

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] git-gui: change to display the combined diff in  the case of conflicts.
  2010-03-31 13:51         ` Johannes Sixt
@ 2010-03-31 19:52           ` Jon Seymour
  2010-04-02  8:37             ` Johannes Sixt
  0 siblings, 1 reply; 10+ messages in thread
From: Jon Seymour @ 2010-03-31 19:52 UTC (permalink / raw)
  To: Johannes Sixt, Git Mailing List, spearce

| apologies - missed the list

I agree that removing the options is better than preserving the
current behaviour,

My argument is simply this:

That it is better to inform a user that an action is potentially
dangerous than to "protect" them from
a "scaring" amount of diff -c output by presenting a conflict-only
summary. You claimed this output was "uninteresting" and hence should
be suppressed, my point was that supresssing output because it was
"uninteresting" is a dangerous thing to do because it is relevant to a
decision not to act.

My preference for options are:

* preserve the actions, but provide more information to the user
* remove the actions
* preserve the actions, make the safer output the default and enable
the simpler, more dangerous output as an option
* preserve the actions, make the current output the default and enable
the safer, less dangerous output an option.
* do nothing

We disagree about the relative order of options 1 and 2. But
seriously, if you agree the actions are dangerous I can't see how you
can argue that is preferable to suppress the scary amount of diff -c
output.

I would imagine that a change that proposed to remove the actions,
without an option to enable them, would encounter stiff resistance
from the list. However, perhaps the list can respond?

jon.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] git-gui: change to display the combined diff in the case of conflicts.
  2010-03-31 19:52           ` Jon Seymour
@ 2010-04-02  8:37             ` Johannes Sixt
  2010-04-04  6:44               ` Jon Seymour
  0 siblings, 1 reply; 10+ messages in thread
From: Johannes Sixt @ 2010-04-02  8:37 UTC (permalink / raw)
  To: Jon Seymour; +Cc: Git Mailing List, spearce

Am 31.03.2010 21:52, schrieb Jon Seymour:
> I agree that removing the options is better than preserving the
> current behaviour,

So, we are in agreement in this. Suppose we do remove them. What remains 
that is dangerous?

The user has no option to accidentally revert changes that are not 
displayed even if the current diff --cc remains. The user is forced to run 
mergetool or to go to the editor.

It is now an orthogonal matter whether diff --cc is helpful. Here I do 
agree somewhat that diff against HEAD is more helpful than the current 
diff --cc.

> I would imagine that a change that proposed to remove the actions,
> without an option to enable them, would encounter stiff resistance
> from the list. However, perhaps the list can respond?

Who knows? There was not a lot discussion when the feature was presented 
to the list, not even a word of excitement.

http://thread.gmane.org/gmane.comp.version-control.git/94425/focus=94426

-- Hannes

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] git-gui: change to display the combined diff in  the case of conflicts.
  2010-04-02  8:37             ` Johannes Sixt
@ 2010-04-04  6:44               ` Jon Seymour
  0 siblings, 0 replies; 10+ messages in thread
From: Jon Seymour @ 2010-04-04  6:44 UTC (permalink / raw)
  To: spearce, Johannes Sixt; +Cc: Git Mailing List

On Fri, Apr 2, 2010 at 7:37 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> Am 31.03.2010 21:52, schrieb Jon Seymour:
>>
>> I agree that removing the options is better than preserving the
>> current behaviour,
>
> So, we are in agreement in this. Suppose we do remove them. What remains
> that is dangerous?

Stage to commit is still somewhat dangerous if the current "diff"
output is displayed because all the successfully staged changes
already in the index that will be purged by the "Stage to commit"
action will still not be visible until after the action is taken -
hence the original suggestion to use the "diff HEAD" output.

>
> The user has no option to accidentally revert changes that are not displayed
> even if the current diff --cc remains. The user is forced to run mergetool
> or to go to the editor.
>
> It is now an orthogonal matter whether diff --cc is helpful. Here I do agree
> somewhat that diff against HEAD is more helpful than the current diff --cc.

I am not sure the issues are completely orthogonal since I would still
argue that in the case the "Use Local/Use Remote" actions are
preserved, the diff -c output is the only output that provides enough
information to inform the user of the likely consequences of taking
each action. [ rationale: diff HEAD allows the consequences of Use
Local to be assessed, but does not allow the consequences of Use
Remote to be adequately assessed. ] That said, I agree that
the "diff HEAD" output is still better than the current "diff" output
in this situation since it does at least tell you want "Stage to
commit" will do with respect to the current HEAD (if not with respect
to successfully staged changes in the index).

I agree in the case that the "Use Local/Remote" actions are removed
from the UI, then the only remaining action of consequence is "Stage
to commit" and that for this "diff HEAD" output is the most
appropriate output to use in order to evaluate the expected
consequences of taking that action.

Until such time as I see some indication that Shawn will accept a
"Remove Use ... actions" patch, I'll assume that he won't. I will
likely re-roll the existing patch so that the user can choose via
configuration the diff options to be used for merge conflicts so that
people who don't like "diff -c" output can configure it to use "diff
HEAD" output instead.

>
>> I would imagine that a change that proposed to remove the actions,
>> without an option to enable them, would encounter stiff resistance
>> from the list. However, perhaps the list can respond?
>
> Who knows? There was not a lot discussion when the feature was presented to
> the list, not even a word of excitement.
>
> http://thread.gmane.org/gmane.comp.version-control.git/94425/focus=94426
>

True. Perhaps I should submit a "git-gui: Remove Use Remote/Local
actions" patch just to generate some excitement?

Shawn: any thoughts on any of this?

jon.

> -- Hannes
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-04-04  6:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-30 15:34 [PATCH v3 0/2] git-gui: change to display the combined diff in the case of conflicts Jon Seymour
2010-03-31  7:20 ` Johannes Sixt
2010-03-31 11:12   ` Jon Seymour
2010-03-31 11:39     ` Johannes Sixt
2010-03-31 11:50       ` Jon Seymour
2010-03-31 12:23       ` Jon Seymour
2010-03-31 13:51         ` Johannes Sixt
2010-03-31 19:52           ` Jon Seymour
2010-04-02  8:37             ` Johannes Sixt
2010-04-04  6:44               ` Jon Seymour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).