[darcs-devel] [issue1989] conflict marking should eliminate all identical blocks (nub)

Eric Kow bugs at darcs.net
Fri Nov 5 01:42:54 UTC 2010


New submission from Eric Kow <kowey at darcs.net>:

Need-action: discussion from darcs-users on the sanity of my suggestion.

I think this might be a small piece of low-hanging conflicts UI fruit,
not a whole lot of bang, but not a whole lot of buck either.

The attached patch bundle to screened (at the time of this writing; use
darcs get --context) has a conflict in it.  If you mark it up, you get
something unpleasant like this:

v v v v v v v
    if os(windows)
      hs-source-dirs: src/win32
      include-dirs:   src/win32
      other-modules:  CtrlC
                      System.Posix
                      System.Posix.Files
                      System.Posix.IO
      cpp-options:    -DWIN32
      c-sources:      src/win32/send_email.c
      build-depends:  unix-compat >= 0.1.2
============= (BLOCK A)
    cpp-options:      -DGADT_WITNESSES=1

    if os(windows)
      hs-source-dirs: src/win32
      include-dirs:   src/win32
      other-modules:  CtrlC
                      System.Posix
                      System.Posix.Files
                      System.Posix.IO
      cpp-options:    -DWIN32
      c-sources:      src/win32/send_email.c
      build-depends:  unix-compat >= 0.1.2,
                      regex-posix >= 0.94.4 && < 0.95
************* (BLOCK B)
  cpp-options:      -DGADT_WITNESSES=1

  if os(windows)
    hs-source-dirs: src/win32
    include-dirs:   src/win32
    other-modules:  CtrlC
                    System.Posix
                    System.Posix.Files
                    System.Posix.IO
    cpp-options:    -DWIN32
    c-sources:      src/win32/send_email.c
    build-depends:  unix-compat >= 0.1.2,
                    regex-posix >= 0.94.4 && < 0.95
************* (BLOCK C)
  if os(windows)
    hs-source-dirs: src/win32
    include-dirs:   src/win32
    other-modules:  CtrlC
                    System.Posix
                    System.Posix.Files
                    System.Posix.IO
    cpp-options:    -DWIN32
    c-sources:      src/win32/send_email.c
    build-depends:  unix-compat >= 0.1.2,
                    regex-posix >= 0.94.4 && < 0.95
************* (BLOCK D)
  if os(windows)
    hs-source-dirs: src/win32
    include-dirs:   src/win32
    other-modules:  CtrlC
                    System.Posix
                    System.Posix.Files
                    System.Posix.IO
    cpp-options:    -DWIN32
    c-sources:      src/win32/send_email.c
    build-depends:  unix-compat >= 0.1.2,
                    regex-posix >= 0.94.4 && < 0.95
^ ^ ^ ^ ^ ^ ^

I've annotated the blocks as BLOCK {A,B,..}

I claim that the output would be very slightly less unpleasant version
of this output would not have BLOCK D because if you do a diff on BLOCKS
C and D, they turn out to have exactly the same textual context.

Now I haven't had the "pleasure" of meeting the conflicts marking code
yet, so I have no idea if this would be actually easy to accomplish, but
if somehow darcs conflict marking was aware that it was writing out
different blocks of output, it seems like it would be very easy for it
to do a simple nub on those blocks to get rid of duplicates.

Also, (and perhaps this should be a separate ticket), maybe arbitrarily
naming the blocks as I've done would make it easier to follow [this is
debatable; it could just be confusion for nothing].

Anyway, I don't think we can get very far until somebody who knows the
conflict marking code can confirm if implementation-wise, this really is
as "easy" as I'm hoping it would be.

----------
files: force-regex_posix-version-to-be-greater-than-0_94_4-on-windows-to-avoid-linking-errors.dpatch
messages: 12912
nosy: dmitry.kurochkin, kowey
priority: feature
status: need-action
title: conflict marking should eliminate all identical blocks (nub)
topic: Conflicts, UI

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1989>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: force-regex_posix-version-to-be-greater-than-0_94_4-on-windows-to-avoid-linking-errors.dpatch
Type: application/octet-stream
Size: 95730 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20101105/e6fb9619/attachment-0001.obj>


More information about the darcs-devel mailing list