[darcs-users] In long comment, stuff after "***DARCS***" is not ignored.

Kannan Goundan cakoose at yahoo.com
Fri Oct 29 00:19:01 UTC 2004


When I enter a long comment, the stuff after "***DARCS***" isn't
ignored.  The problem looks like it has to do with DOS vs Unix line
endings.  I'm using Win32 Darcs and Win32 GVim on Windows 2000.

To reproduce:

1. Set the environment variable DARCS_EDITOR="gvim -f"
2. Open a "cmd" shell.
3. > darcs initialize
4. > gvim File.txt
  [Add a couple lines to File.txt]
  [Save the file in DOS format]
5. > darcs add File.txt
6. > darcs record -a
  [Set patch name to "Add File.txt"]
  [Say 'y' to add a long comment]
  [GVim opens up.  Autodetects DOS file format.]
  [Add a long comment, save in autodetected format (DOS)]
7. Darcs says: "'inished recording patch 'Add File.txt"
  [looks like the "\r" is causing trouble]
8. > darcs changes
  [All the stuff after "***DARCS***" shows up]

When editing the long comment in Vim, I saved a separate copy of the
file.  That extra copy has the proper DOS line endings.  But when I
open up the file in "_darcs/patches/", some of the lines have "\r",
some don't.

Stuff that has "\r":
  - Patch name
  - Long comment
  - All the stuff that was supposed to be ignored (including the
"***DARCS***" line)
  - The content of the diff hunk (the lines in "File.txt")

Stuff that doesn't have "\r":
  - "cakoose at yahoo.com**20041028235713"
  - "addfile ./File.txt"
  - "hunk ./File.txt 1"
  - The lines with the braces and brackets.

When editing the long comment in Vim, if I force Vim to save with
Unix line endings, everything works fine.
  - The "darcs changes" don't have the extra lines
  - The file in "_darcs/patches/" only has "\r"s on the contents of
the diff hunk.
  - The line that says "Finished recording patch 'AddFile.txt'" comes
out OK (the first character isn't overwritten by the last single
quote).

By the way, "unrecord" is awesome.  Without that feature, this bug
would have caused a LOT more pain.



	
		
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail




More information about the darcs-users mailing list