Loading ...
Sorry, an error occurred while loading the content.
 

Bug in gvim: diffpatch can't handle reversed patches

Expand Messages
  • Andreas Bernauer
    Hi, when I apply a reversed patch on an open file with diffpatch , gvim opens a window with an empty buffer instead of the patched file. godlygeek on IRC
    Message 1 of 5 , Feb 4, 2009
      Hi,

      when I apply a reversed patch on an open file with 'diffpatch', gvim opens a
      window with an empty buffer instead of the patched file. 'godlygeek' on IRC
      suggested reporting this bug on this mailing list.

      It seems, gvim automatically answers the questions from the patch program
      'Reversed (or previously applied) patch detected! Assume -R? [n]'
      and
      'Apply anyway? [n] '
      with the default answer for me (as if I pressed 'Enter'), resulting in the empty
      buffer.

      I expected to be able to answer the questions myself :-) as it happens in vim.

      How to reproduce:
      - Have two files which differ, e.g. each contains a single but different line
      (eg., see attached files 'text' and 'text-new')
      - Create patch:
      $ diff text text-new > patch
      - Start vim with the newer file
      ./vim-7.2 -u NONE -U NONE -i NONE --noplugin -N -g text-new
      - in gvim, try to apply patch file:
      :diffpatch patch

      Result is empty file instead of (reversely) patched file because gvim does not
      allow me to answer patch questions 'Assume -R?' and 'Apply anyway?'.

      Note, the bug only appears if gui (-g) AND non-compatible mode (-N) are enabled.
      If not in gui mode, the bug never appears (either compatible or non-compatible
      mode). If in gui mode and in compatible mode, the bug only appears when ':set
      nocompatible' is executed before the diffpatch command.

      vim-7.2 is the freshly built vim from the tarball from the homepage
      (ftp://ftp.vim.org/pub/vim/unix/vim-7.2.tar.bz2)

      I added the '-u NONE -U NONE -i NONE --noplugin' flags only to keep
      bugreport.txt small; the bug still appears when these flags are missing.

      Cheers,

      Andreas.


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... That would be version 7.2.0 (i.e., 7.2 with no bugfixes). Since then, almost a hundred official patches have been published: see what they are about (one
      Message 2 of 5 , Feb 4, 2009
        On 04/02/09 11:08, Andreas Bernauer wrote:
        > Hi,
        >
        > when I apply a reversed patch on an open file with 'diffpatch', gvim opens a
        > window with an empty buffer instead of the patched file. 'godlygeek' on IRC
        > suggested reporting this bug on this mailing list.
        >
        > It seems, gvim automatically answers the questions from the patch program
        > 'Reversed (or previously applied) patch detected! Assume -R? [n]'
        > and
        > 'Apply anyway? [n]'
        > with the default answer for me (as if I pressed 'Enter'), resulting in the empty
        > buffer.
        >
        > I expected to be able to answer the questions myself :-) as it happens in vim.
        >
        > How to reproduce:
        > - Have two files which differ, e.g. each contains a single but different line
        > (eg., see attached files 'text' and 'text-new')
        > - Create patch:
        > $ diff text text-new> patch
        > - Start vim with the newer file
        > ./vim-7.2 -u NONE -U NONE -i NONE --noplugin -N -g text-new
        > - in gvim, try to apply patch file:
        > :diffpatch patch
        >
        > Result is empty file instead of (reversely) patched file because gvim does not
        > allow me to answer patch questions 'Assume -R?' and 'Apply anyway?'.
        >
        > Note, the bug only appears if gui (-g) AND non-compatible mode (-N) are enabled.
        > If not in gui mode, the bug never appears (either compatible or non-compatible
        > mode). If in gui mode and in compatible mode, the bug only appears when ':set
        > nocompatible' is executed before the diffpatch command.
        >
        > vim-7.2 is the freshly built vim from the tarball from the homepage
        > (ftp://ftp.vim.org/pub/vim/unix/vim-7.2.tar.bz2)
        >
        > I added the '-u NONE -U NONE -i NONE --noplugin' flags only to keep
        > bugreport.txt small; the bug still appears when these flags are missing.
        >
        > Cheers,
        >
        > Andreas.

        That would be version 7.2.0 (i.e., 7.2 with no bugfixes). Since then,
        almost a hundred "official" patches have been published: see what they
        are about (one line per patch) at
        http://ftp.vim/org/pub/vim/patches/7.2/README

        See also my Compiling HowTo
        http://users.skynet.be/antoine.mechelynck/vim/compunix.htm


        Best regards,
        Tony.
        --
        What you don't know can hurt you, only you won't know it.

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Andreas Bernauer
        ... [...] ... Bug happens in r1341 of the subversion version, too. -- Andreas. --~--~---------~--~----~------------~-------~--~----~ You received this message
        Message 3 of 5 , Feb 4, 2009
          Andreas Bernauer wrote:
          > when I apply a reversed patch on an open file with 'diffpatch', gvim opens a
          > window with an empty buffer instead of the patched file. 'godlygeek' on IRC
          > suggested reporting this bug on this mailing list.
          [...]
          >
          > vim-7.2 is the freshly built vim from the tarball from the homepage
          > (ftp://ftp.vim.org/pub/vim/unix/vim-7.2.tar.bz2)

          Bug happens in r1341 of the subversion version, too.

          --
          Andreas.

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Andreas Bernauer
          ... Sorry, didn t know that. Bug happens at patch level 7.2.095, too. -- Andreas. --~--~---------~--~----~------------~-------~--~----~ You received this
          Message 4 of 5 , Feb 4, 2009
            Tony Mechelynck wrote:
            > On 04/02/09 11:08, Andreas Bernauer wrote:
            >> Hi,
            >>
            >> when I apply a reversed patch on an open file with 'diffpatch', gvim opens a
            >> window with an empty buffer instead of the patched file. 'godlygeek' on IRC
            >> suggested reporting this bug on this mailing list.
            >> [...]
            >> vim-7.2 is the freshly built vim from the tarball from the homepage
            >> (ftp://ftp.vim.org/pub/vim/unix/vim-7.2.tar.bz2)

            > That would be version 7.2.0 (i.e., 7.2 with no bugfixes). Since then,
            > almost a hundred "official" patches have been published: see what they
            > are about (one line per patch) at
            > http://ftp.vim/org/pub/vim/patches/7.2/README

            Sorry, didn't know that.

            Bug happens at patch level 7.2.095, too.

            --
            Andreas.

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Matt Wozniski
            ... And regardless of guipty - though I haven t yet sourcedived to figure out exactly what is going wrong. ~Matt
            Message 5 of 5 , Feb 4, 2009
              On Wed, Feb 4, 2009 at 6:24 AM, Andreas Bernauer wrote:
              > Tony Mechelynck wrote:
              >> On 04/02/09 11:08, Andreas Bernauer wrote:
              >>> when I apply a reversed patch on an open file with 'diffpatch', gvim opens a
              >>> window with an empty buffer instead of the patched file. 'godlygeek' on IRC
              >>> suggested reporting this bug on this mailing list.
              >>> [...]
              >>> vim-7.2 is the freshly built vim from the tarball from the homepage
              >>> (ftp://ftp.vim.org/pub/vim/unix/vim-7.2.tar.bz2)
              >>
              >> almost a hundred "official" patches have been published
              >
              > Sorry, didn't know that.
              >
              > Bug happens at patch level 7.2.095, too.

              And regardless of 'guipty' - though I haven't yet sourcedived to
              figure out exactly what is going wrong.

              ~Matt

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            Your message has been successfully submitted and would be delivered to recipients shortly.