darcs

Patch 1420 --machine-readable flag for more parseable whatsnew

Title --machine-readable flag for more parseable whatsnew
Superseder Nosy List gh
Related Issues
Status accepted Assigned To
Milestone 2.10.3

Created on 2016-01-12.13:39:08 by gh, last changed 2016-01-29.15:26:43 by gh.

Files
File name Status Uploaded Type Edit Remove
__machine_readable-flag-for-more-parseable-whatsnew.dpatch gh, 2016-01-12.13:39:07 application/x-darcs-patch
__machine_readable-flag-for-more-parseable-whatsnew.dpatch gh, 2016-01-14.11:27:11 application/x-darcs-patch
__machine_readable-flag-for-more-parseable-whatsnew.dpatch gh, 2016-01-16.11:46:57 application/x-darcs-patch
patch-preview.txt gh, 2016-01-12.13:39:07 text/x-darcs-patch
patch-preview.txt gh, 2016-01-14.11:27:11 text/x-darcs-patch
patch-preview.txt gh, 2016-01-16.11:46:57 text/x-darcs-patch
patch-preview.txt gh, 2016-01-29.10:50:31 text/x-darcs-patch
unnamed gh, 2016-01-12.13:39:07 text/plain
unnamed gh, 2016-01-14.11:27:11 text/plain
unnamed gh, 2016-01-16.11:46:57 text/plain
unnamed gh, 2016-01-29.10:50:31 text/plain
use-f-and-t-instead-of-from-and-to-in-whatsnew-__machine_readable.dpatch gh, 2016-01-29.10:50:31 application/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg18902 (view) Author: gh Date: 2016-01-12.13:39:07
This is work in progress and I'd appreciate comments and
opinions.

This patch adds the flag --machine-readable to whatsnew.

It implies --summary, and makes lines previously shown as:

    M f -N +M rP

now simply shown as:

    M f

Which makes parsing by third party tools much easier
(I'm adding Darcs support to geanyvc).

Another problem solved by this change, is that (very
improbably), a file can be named "f -N" or "f +M" and
be wrongly parsed before this patch.

Apart from this, I wondered if file moves should be
shown as one add and one remove, but this is more
complicated. In cases where we do the renames y -> z
and x -> y, we should maybe show:

    M y
    A z
    D x

This is what mercurial would do. But with Darcs this
seem to require some rewriting of the prim sequence
processed by whatsnew.. I don't think it's worth it.

Note that Bazaar (another system that really tracks
file renames) prefixes the file move lines with R (for
"rename") and the "delete" lines with D (in the output of
`bazaar status --short`). In Darcs these lines are recognizable
by the fact that they start with a space character.

1 patch for repository http://darcs.net:

patch 622d61ee9b425043c0667cf5c9877a27bad92455
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Tue Jan 12 10:20:44 ART 2016
  * --machine-readable flag for more parseable whatsnew
Attachments
msg18907 (view) Author: gh Date: 2016-01-14.11:27:11
I changed the ouput of file renames, we now have the following:

    $ darcs status 
      ./x -> ./y
    $ darcs status --machine-readable 
    From ./x
    To ./y

1 patch for repository http://darcs.net:

patch 6b885c1b754cf932f3eaa4042de4d651f563aba1
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Thu Jan 14 08:33:07 ART 2016
  * --machine-readable flag for more parseable whatsnew
Attachments
msg18926 (view) Author: gh Date: 2016-01-16.11:46:57
Mentionning the file move output format in the help string.

2 patches for repository http://darcs.net:

patch 6b885c1b754cf932f3eaa4042de4d651f563aba1
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Thu Jan 14 08:33:07 ART 2016
  * --machine-readable flag for more parseable whatsnew

patch 341bffd98bf967aa0a8c0bb6eb42d0d2c4d2732f
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Sat Jan 16 08:53:36 ART 2016
  * whatsnew --machine-readable help string update on file moves
Attachments
msg18945 (view) Author: gh Date: 2016-01-21.10:00:34
Greenlighted by Ganesh on IRC, hence accepted.
msg18998 (view) Author: gh Date: 2016-01-29.10:50:31
I figured instead of having `From f` and `To g` we can as well have `F f`
and `T g` since it is not ambiguous and the output is more homogeneous.

I bet nobody has written a parser for watsnew --machine-readable yet
so we should be good...

1 patch for repository http://darcs.net:

patch 391afbf64555c60cd9f60e3122c1bce3a15db5ab
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Fri Jan 29 07:36:19 ART 2016
  * use F and T instead of From and To in whatsnew --machine-readable
Attachments
msg19004 (view) Author: gh Date: 2016-01-29.15:26:43
I'm going to self-accept it now. This is a change of strings in a patch
that was already accepted.
History
Date User Action Args
2016-01-12 13:39:08ghcreate
2016-01-12 15:11:27ghsetmilestone: 2.10.3
2016-01-14 11:27:12ghsetfiles: + patch-preview.txt, __machine_readable-flag-for-more-parseable-whatsnew.dpatch, unnamed
messages: + msg18907
2016-01-16 11:46:58ghsetfiles: + patch-preview.txt, __machine_readable-flag-for-more-parseable-whatsnew.dpatch, unnamed
messages: + msg18926
2016-01-17 08:57:38ghsetstatus: needs-screening -> needs-review
2016-01-21 10:00:34ghsetstatus: needs-review -> accepted
messages: + msg18945
2016-01-29 10:50:31ghsetfiles: + patch-preview.txt, use-f-and-t-instead-of-from-and-to-in-whatsnew-__machine_readable.dpatch, unnamed
messages: + msg18998
2016-01-29 10:51:16ghsetstatus: accepted -> needs-review
2016-01-29 15:26:43ghsetstatus: needs-review -> accepted
messages: + msg19004