Re: [Monotone-devel] the changelog editor branch is ready for review

2010-04-12 Thread Derek Scherger
On Mon, Apr 12, 2010 at 4:06 PM, Thomas Keller  wrote:

> No, I just tried it out and it already looks much nicer, though I still
> miss the "end" of the editable changelog area somewhat - maybe this is
> just me who looks for some visual separator.
>

One minor peeve I have with the current editor (on mainline) is that you
don't really want to put a blank line after the message or it will be
displayed as 2 blank lines after the revision is committed. If I reformat
the paragraph I'm typing in emacs with fill-paragraph and there is no blank
line following my message it pulls in all the MTN: prefixed lines and makes
a bit of a mess. With the new format I was sort of relying on the fact that
there would be a blank line following the message to prevent fill-paragraph
from being overly greedy. Maybe this delimiter is too subtle though?
Presumably someone could write a monotone-commit-mode for emacs and
something similar for vim that would allow the editor to prevent you from
editing things you're not supposed to.


> I have to admit I used the comment command the first time today. I now
> know what you mean, mtn comment REV fires up an editor with the
> possibility to add multi-line text. While you can add linebreaks in
> other certs as well, its usually a bit harder to do so and people don't
> trap into that. I initially thought that a comment cert's value could
> simply appended to the header section in mtn log or similar, but it
> makes more sense to deal with it just like with normal changelog certs.
>

See 'mtn log -r 0f1782f7e2348f991a0b8eeac03c45a72c8633a2' for a revision
with a few comment certs. I think the current format does a reasonable job
there.

###
> Enter a description of this change following the ChangeLog line.
> The values of Author, Date and Branch may be modified as required.
> Any other modifications will will cause the commit to fail.
> *** REMOVE THIS LINE TO CANCEL THE COMMIT ***
> --
> Author:   m...@thomaskeller.biz
> Date: 12.04.2010 23:44:27
> Branch:   biz.thomaskeller.test3
>
> ChangeLog:
>
>
> --
> Parent: ace2791b0b3df530b449802ce82fd8d731a466f1
>
>  patched  foo
>
> 
>
> What has changed? Parent has been moved down into the ChangeSet section.
>

I had considered this a while ago but then forgot about the idea so thanks
for reminding me. We currently have the Parent listed twice, once in the
header and a second time before the changeset. Maybe we should drop the one
in the header and only include it with the changeset, DRY and all that.

I wouldn't call it ChangeSet but Parent, simply because it is the parent
>

Interestingly (maybe) in the code what is being displayed is exactly the
changeset from the revision which is where the name came from.


> we denote with the revision. Revision is gone from the commit header as
> well - is there any use case displaying this for uncommitted revisions?
>

None that I can think of... I was looking for consistency but I'm fine with
dropping the Revision line from commit and status. Any objection to dropping
(or moving) the Parent lines down with their changeset details?

I would probably not change too much in mtn log, i.e. separators for

marking an editable section are not needed here. I'd also keep most of
> the structure as it is now - also because I think we still have a couple
> of users which read in mtn log and parse it somehow directly because of
> the missing automate functionality for that. I know that this is a bit
> against your aim to provide a single way of displaying cert information,
> but maybe its worth to not do it exactly the same...?
>

I was hoping/expecting to hear from anyone who might be parsing the log
output if they were concerned with the changes being proposed. By unifying
the formats I was hoping that people could see what their revision would
look like before they've committed it so that there aren't any surprises
introduced by the different formats. The mess of functions to display certs
in log is mostly gone on this branch and that's one part of the change that
I'd like to keep. ;)

Hrm, no, probably not that far. Ok, forget the RFC :) If you think its
> easy enough to add some basic custom cert adding, then do it, otherwise
> we wait for a feature request...
>

I'm punting for now. We can add this later if it becomes important.


> > I'll have a look at this and see where the extra newline is coming from.
> >
> >
> >> #
> >> mtn: warning: This revision will create a new branch
> >> Old Branch: biz.thomaskeller.test
> >> New Branch: biz.thomaskeller.test3
> >>
> >> --
>

Status explicitly outputs a blank line after the old/new branch details
which can be changed if we want. I like the idea of adding this information
to the instructions for commit if/when the branch is changi

Re: [Monotone-devel] the changelog editor branch is ready for review

2010-04-12 Thread Thomas Keller
Am 12.04.10 04:09, schrieb Derek Scherger:
>>> Trimming is probably required if we choose to left align the headers
>> anyway
>>> so I should probably just do that.
>>
>> Right.
>>
> 
> Done.
> 
> 
>> The right-aligned version seems to be the better choice.
>>
> 
> Oops. I had the left aligned version done before your message. Let me know
> if you think we should change it. I have a very slight preference for the
> left aligned version now. In emacs shell-mode there is some colorization
> done by default and the left aligned headers are colored differently that
> other output lines. This doesn't seem to work with the right aligned
> versions. I'm not stuck on this and will change if you have a strong
> preference the other way.

No, I just tried it out and it already looks much nicer, though I still
miss the "end" of the editable changelog area somewhat - maybe this is
just me who looks for some visual separator.

> Hrm, I haven't thought of the "comment" cert at all, is this a much used
>> feature after all? If not I'd probably don't care about it and would
>> display it like any other cert value we have.
>>
> 
> I'm not quite sure what you mean by this. Comment certs are much like
> changelog certs, for the few that appear in the monotone database anyway and
> are quite likely to be multi-line comments so displaying them like the
> Date/Author/Branch certs doesn't make a lot of sense.

I have to admit I used the comment command the first time today. I now
know what you mean, mtn comment REV fires up an editor with the
possibility to add multi-line text. While you can add linebreaks in
other certs as well, its usually a bit harder to do so and people don't
trap into that. I initially thought that a comment cert's value could
simply appended to the header section in mtn log or similar, but it
makes more sense to deal with it just like with normal changelog certs.

>> Right, there is only one small nitpick I have with a syntax like
>> "Changes:" - this pretty much then looks like a cert and in total like
>> the continuation of the header section. To make it clearer that this is
>> not the case I thought adding another separator line might be a good
>> idea, but I'm open for other ideas here.
>>
> 
> I'm not sure that representing the changes similar to the certs is good or
> bad. The latest version is using "ChangeSet:" as the header for these
> summaries but I'm still open to suggestions.

I think my underlying problem is just that I head for a representation
which makes it dead obvious which sections are editable and which not.
If its dead obvious, only minimal to no in-place documentation is
needed. Take the current state for example:

###
Enter a description of this change following the ChangeLog line.
The values of Author, Date and Branch may be modified as required.
Any other modifications will will cause the commit to fail.
*** REMOVE THIS LINE TO CANCEL THE COMMIT ***
--
Revision: c243dd99b9c92cf0f9b20f6b2f65861722d81635
Parent:   ace2791b0b3df530b449802ce82fd8d731a466f1
Author:   m...@thomaskeller.biz
Date: 12.04.2010 23:44:27
Branch:   biz.thomaskeller.test3

ChangeLog:



ChangeSet: ace2791b0b3df530b449802ce82fd8d731a466f1

  patched  foo



I skim over this and see a lot of sections starting with a noun,
followed by a colon and some value. Only a few of these are actually
editable and I'd probably "group" these accordingly to make this obvious:


###
Enter a description of this change following the ChangeLog line.
The values of Author, Date and Branch may be modified as required.
Any other modifications will will cause the commit to fail.
*** REMOVE THIS LINE TO CANCEL THE COMMIT ***
--
Author:   m...@thomaskeller.biz
Date: 12.04.2010 23:44:27
Branch:   biz.thomaskeller.test3

ChangeLog:


--
Parent: ace2791b0b3df530b449802ce82fd8d731a466f1

  patched  foo



What has changed? Parent has been moved down into the ChangeSet section.
I wouldn't call it ChangeSet but Parent, simply because it is the parent
we denote with the revision. Revision is gone from the commit header as
well - is there any use case displaying this for uncommitted revisions?
And finally, there are clean separators which mark the editable area.
One could argue if it could also look like this


--
Author:m...@thomaskeller.biz
Date:  12.04.2010 23:44:27
Branch:biz.thomaskeller.test3
ChangeLog:

--


to save space and still make it clear that ChangeLog can contain
multiple lines of text and I would find that this is ok as well, however
it would probably collide with the output of log and status.

I would probably n