darcs

Issue 860 ensure that patchinfo is separated from primitive patches with newline

Title ensure that patchinfo is separated from primitive patches with newline
Priority wishlist Status given-up
Milestone Resolved in
Superseder Nosy List Serware, btcoburn, darcs-devel, dmitry.kurochkin, kowey, lele, thorkilnaur, tommy
Assigned To
Topics

Created on 2008-05-18.13:15:10 by btcoburn, last changed 2017-07-30.23:52:58 by gh.

Messages
msg4748 (view) Author: btcoburn Date: 2008-05-18.13:15:04
The new patch format omits a linefeed before the first "atomic change". This
adds a totally unnecessary special case to patch parsing.

For example:

[repo change - file added
test@example.com**20080518092406] addfile ./foobar
hunk ./foobar 1
+junk test file....

[another test
test@example.com**20080518092520] hunk ./foobar 1
-junk test file....
+sdklfhsldajkdfhjjunk test file....

Should be:

[repo change - file added
test@example.com**20080518092406]
addfile ./foobar
hunk ./foobar 1
+junk test file....

[another test
test@example.com**20080518092520]
hunk ./foobar 1
-junk test file....
+sdklfhsldajkdfhjjunk test file....


"The cat is already out of the bag" so darcs will have to understand it both
ways. Still, I would like to see darcs format new patches consistently from now on.

Ideally darcs repair would quietly correct this.... However, I suspect
corrections would ripple back through the inventories and break repository
history (by cosmetically rewriting patch file hashes).
msg4749 (view) Author: kowey Date: 2008-05-18.13:25:15
To clarify, where is the inconsistency?  Between darcs2 and darcs1 (both hashed)
or between hashed and unhashed?
msg4753 (view) Author: btcoburn Date: 2008-05-18.18:00:55
The inconsistency is that the first "atomic change" starts in the middle of the
line, while all other "atomic changes" start at the beginning of the line. This
is relevant to anyone writing a parser for the darcs2 patch format.

This appears to be a side effect of the code that removed curly braces from the
patch format.... It looks like an extra newline was removed, that should have
been left alone.

In darcs2 no patches use curly braces. In darcs1 hashed, curly braces are used
on patches with multiple "atomic changes" but are inconsistently omitted from
patches with only one "atomic change". (See more serious bug #862.)
msg5541 (view) Author: tommy Date: 2008-08-15.15:04:32
I don't think this is a new change. I have patches from 2004 (darcs-1) where a
single change (without curly braces) is separated from the closing ] sometimes
with a space and sometimes with a newline. I think the definition simply says
whitespace (don't remember if it's only one or more), and that whitespace is
defined as space, tab or newline.
msg6775 (view) Author: lele Date: 2008-12-05.12:57:31
Is there any technical/tricky impedence that prevents this?

This is just to join the original request: it is so common to review
each other's changesets over email, that this little wart hits the
eyes badly.

If, as Tommy said, """... is separated from the closing ] sometimes
with a space and sometimes with a newline""", I guess it should be
hard starting from now to change that to "always newline".

I know I'd like to give up trying to focus on my possible new job and
learn another bit of Haskell trying to figure it out on my
own instead... but I'll try to resist, waiting for other opinions :)

thanks&bye,
lele.
-- 
nickname: Lele Gaifax    | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas    | comincerò ad aver paura di chi mi copia.
lele@nautilus.homeip.net |                 -- Fortunato Depero, 1929.
msg6776 (view) Author: lele Date: 2008-12-05.13:01:06
> If, as Tommy said, """... is separated from the closing ] sometimes
> with a space and sometimes with a newline""", I guess it should be
> hard starting from now to change that to "always newline".

Err, I meant "it should NOT be hard", sorry.
msg6778 (view) Author: tommy Date: 2008-12-05.20:32:33
On Fri, Dec 05, 2008 at 01:01:08PM -0000, Lele Gaifax wrote:
> > If, as Tommy said, """... is separated from the closing ] sometimes
> > with a space and sometimes with a newline""", I guess it should be
> > hard starting from now to change that to "always newline".
> 
> Err, I meant "it should NOT be hard", sorry.

Exactly. The parser that reads patches should accept any
whitespace (tab, newline or space), so when we write patches we
can use whichever we like. I too would like newline, because
it's so much easier to read for humans.
msg10578 (view) Author: kowey Date: 2010-03-30.13:22:12
I once tried to fix this, but I think my change overshot (was creating
too much whitespace) and so I gave up.
History
Date User Action Args
2008-05-18 13:15:10btcoburncreate
2008-05-18 13:25:17koweysetstatus: unread -> unknown
nosy: + kowey
messages: + msg4749
2008-05-18 13:27:24koweysetnosy: tommy, beschmi, kowey, dagit, btcoburn, Serware
title: wart, inconsistent formatting of hunks in darcs2 & hashed repos -> wart, inconsistent formatting of atomic changes in darcs2 & hashed repos
2008-05-18 18:00:56btcoburnsetnosy: tommy, beschmi, kowey, dagit, btcoburn, Serware
messages: + msg4753
2008-05-19 14:59:43droundysetpriority: bug -> wishlist
nosy: tommy, beschmi, kowey, dagit, btcoburn, Serware
2008-08-15 15:04:34tommysetnosy: + darcs-devel
messages: + msg5541
2008-08-15 15:08:06droundysetnosy: tommy, beschmi, kowey, darcs-devel, dagit, btcoburn, Serware
2008-08-15 15:08:28droundysetnosy: tommy, beschmi, kowey, darcs-devel, dagit, btcoburn, Serware
2008-08-15 15:09:58droundysetnosy: - darcs-devel
2008-12-05 12:57:34lelesetnosy: + dmitry.kurochkin, lele, simon, thorkilnaur
messages: + msg6775
2008-12-05 13:01:08lelesetnosy: tommy, beschmi, kowey, dagit, lele, simon, thorkilnaur, btcoburn, dmitry.kurochkin, Serware
messages: + msg6776
2008-12-05 20:32:36tommysetnosy: tommy, beschmi, kowey, dagit, lele, simon, thorkilnaur, btcoburn, dmitry.kurochkin, Serware
messages: + msg6778
2009-08-06 21:05:05adminsetnosy: - beschmi
2009-08-11 00:14:29adminsetnosy: - dagit
2009-08-21 23:18:49koweysetstatus: unknown -> has-patch
nosy: tommy, kowey, lele, simon, thorkilnaur, btcoburn, dmitry.kurochkin, Serware
topic: - Darcs2, Regression
title: wart, inconsistent formatting of atomic changes in darcs2 & hashed repos -> ensure that patchinfo is separated from primitive patches with newline
assignedto: kowey
2009-08-25 17:35:42adminsetnosy: + darcs-devel, - simon
2009-08-27 14:29:01adminsetnosy: tommy, kowey, darcs-devel, lele, thorkilnaur, btcoburn, dmitry.kurochkin, Serware
2009-10-23 22:43:04adminsetnosy: + serware, - Serware
2009-10-23 23:29:02adminsetnosy: + Serware, - serware
2010-03-30 13:22:12koweysetstatus: has-patch -> needs-implementation
assignedto: kowey ->
messages: + msg10578
2017-07-30 23:52:58ghsetstatus: needs-implementation -> given-up