darcs

Issue 1190 conflict marking for hunk/replace conflicts

Title conflict marking for hunk/replace conflicts
Priority feature Status needs-implementation
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, ganesh, kowey, twb
Assigned To
Topics Conflicts, Core, UI

Created on 2008-11-01.22:52:15 by dagit, last changed 2023-03-31.10:15:17 by ganesh.

Messages
msg6553 (view) Author: dagit Date: 2008-11-01.22:52:12
The following script demonstrates the problem.  What happens is that hunks which
conflict with replaces do not get marked up.  Probably the biggest problem is
that the result is very confusing.

The script below could probably be simplified.  I was actually chasing a
slightly different problem with replace patches and this script almost hits that
case but not quite.

\begin{bash}
rm -rf temp1 temp2

mkdir temp1
cd temp1
darcs init
echo "Line1" > foo
echo "Line2" >> foo
echo "Line3" >> foo
echo "Line4" >> foo
echo "3eniL" >> foo

darcs add foo
darcs record -am 'foo1'

cd ..

darcs get temp1 temp2

cd temp2

darcs replace Line1 1eniL foo
darcs replace --force 3eniL Line3 foo
darcs record -am 'replaces'

cd ../temp1

echo "Line1" > foo
echo "Line2" >> foo
echo "edityou" >> foo
echo "Line4" >> foo
echo "3eniL" >> foo

darcs record -am 'edityou'

cd ../temp2

darcs pull -a ../temp1
\end{bash}
msg7555 (view) Author: twb Date: 2009-03-29.07:24:04
On Sat, Nov 01, 2008 at 11:52:12AM +0000, Jason Dagit wrote:
> The following script demonstrates the problem.  What happens is that
> hunks which conflict with replaces do not get marked up.  Probably
> the biggest problem is that the result is very confusing.

I have pushed this into bugs/.
msg8230 (view) Author: kowey Date: 2009-08-18.08:46:14
Better conflict marking would always be nice.  I imagine this is not nearly as
difficult as issue833.

I think we need a mock-up for sensible UI when replace and hunk patches conflict.

There are loads of other conflicts I think we could think about marking up
better like mv, addfile etc.  I'd suggest maybe putting together a wiki page
where we think about this in more detail.
msg10595 (view) Author: kowey Date: 2010-03-31.13:13:17
Ganesh has been working on improving the conflict marking a bit.  I'm
adding him to this bug in case he's interested.
msg23220 (view) Author: bfrk Date: 2023-03-28.20:44:47
At least nowadays darcs displays the conflicts it cannot mark.

To make progress here we need to come up with a design: how should 
such a markup look like? This is not trivial. The reason why 
conflict markup for hunk/hunk conflicts is possible is that this 
affects only a (hopefully small) portion of the file, IOW it is a 
local change. Replace patches, however, act on the whole file i.e. 
all lines that contain the token to be replaced.

One way to solve the problem is to re-interpret the replace as a 
series of hunks; then some of these hunks will conflict and we 
generate markup for those conflicts. But what about the replace-
hunks that don't conflict? Should we mark them somehow or should we 
just apply them without markup?
msg23232 (view) Author: ganesh Date: 2023-03-31.10:15:17
> One way to solve the problem is to re-interpret the replace as a
> series of hunks; then some of these hunks will conflict and we
> generate markup for those conflicts. But what about the
> replace-hunks that don't conflict? Should we mark them somehow
> or should we just apply them without markup?

I agree with the idea of treating the replace as a series of hunks.

I assume that the most common use for this markup is to help
someone record a patch that correctly resolves the conflict.
With that in mind I think we should only show markup for the hunks
that do conflict, which seems consistent with what would happen if
it had really been a hunk patch to begin with.
History
Date User Action Args
2008-11-01 22:52:15dagitcreate
2009-03-29 07:24:06twbsetstatus: unread -> unknown
nosy: + twb
messages: + msg7555
2009-08-10 23:50:08adminsetnosy: - dagit
2009-08-18 08:46:21koweysetstatus: unknown -> needs-reproduction
priority: bug -> feature
title: When replace patches and hunk patches conflict there are no marked conflicts -> conflict marking for hunk/replace conflicts
nosy: kowey, simon, twb, thorkilnaur, dmitry.kurochkin
messages: + msg8230
topic: + Conflicts, UI, Core
2009-08-25 17:33:13adminsetnosy: + darcs-devel, - simon
2009-08-27 14:26:01adminsetnosy: kowey, darcs-devel, twb, thorkilnaur, dmitry.kurochkin
2010-03-31 13:12:37koweysetnosy: - thorkilnaur
2010-03-31 13:13:20koweysetnosy: + ganesh
messages: + msg10595
2017-08-11 19:45:27bfrksetstatus: needs-reproduction -> needs-implementation
2023-03-28 20:44:48bfrksetmessages: + msg23220
2023-03-31 10:15:17ganeshsetmessages: + msg23232