Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ansi console #40

Closed

Conversation

ydaveluy
Copy link

Hi,

This is a preliminary work.
The preference page does not support internationalization and should be improved (I am not an UI designer).
The AnsiConsolePageParticipant has an invalid reference. I don't know how to improve this part.

Performances are really good (better than the original ansi-econsole plugin).

To give you a comparison, to print 1_000_000 lines with 10/15 escapes sequences/line:

  • unlimited console output: 29s by default / 33s with ansi sequences interpreted
  • limit console output = 80000: 19s by default / 18s with ansi sequences interpreted

Please test it and give me your feedback.

Yannick

Handle ANSI escape sequences in console.

Inspired from the ansi-econsole plugin
@iloveeclipse
Copy link
Member

Could you please provide some example snippet showing ANSI input or even better a test that shows what is supposed to work now? May be also some screenshots?

@ydaveluy
Copy link
Author

This plugin works for foreground/background colors, font style(italic/bold/underline/...). Others escape sequences are ignored (cursor movement, ...).
It preserve all existing styles.
It works with CDT console (C/C++ builds)

Example snippet:
AnsiConTest.txt

Preference page for Ansi Console:
image

Generated output (from snippet):
image

@ydaveluy
Copy link
Author

An other functionality is that when a preference changes (background/foreground console color, interpret ANSI escape sequences, show escape sequences, ...) the console is update accordingly.

get value directly from store. The getNewValue provide String instead of
Boolean in case of Restore Defaults.
@HannesWell
Copy link
Member

Thanks for your work.

Since this seems to be heavily based on the Eclipse ANSI Console from @mihnita we have to/should reflect that when adding the copy-right headers. Because they have not been added before it probably has to be checked for each file who initially created it and all participants should be mentioned as contributors (since the git history is not retained). In general we need a CQ because the contribution has more than 1000 lines of code and probably also an IP-review?

I also wonder the original code should be added with a first commit added as it is in the ANSI-console profile and then migrated in a second commit to the org.eclipse... namespace to better reflect who did what?

And mentioned in Bug 112948 @mihnita started already some effort to contribute his ANSI Console to Eclipse: mihnita/ansi-econsole#70. Therefore I think it would be good if this work is coordinated to avoid duplication and that everybody gets the credit he deserves. :)

cc @mickaelistria, @laeubi

Copy link
Contributor

@mickaelistria mickaelistria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are already some preferences related to ANSI-support in the Console preference page. Do you plan to reconcile those.

Also, we need IP clearance for that code. Did you author all of it? If not, who are the other contributors? Are you willing to submit it under EPLv2?

@@ -0,0 +1,510 @@
package org.eclipse.ui.internal.console;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing copyright header.

org.eclipse.ui.console/plugin.xml Show resolved Hide resolved
@mickaelistria
Copy link
Contributor

And mentioned in Bug 112948 @mihnita started already some effort to contribute his ANSI Console to Eclipse: mihnita/ansi-econsole#70

We're missing the PR that officializes this will to contribute ;)

Copy link
Author

@ydaveluy ydaveluy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to wait for @mihnita feedback.

@mihnita
Copy link
Contributor

mihnita commented Jun 27, 2022

Sorry, I've only now noticed what is really going on.
And I am kind of... not happy.

Pasting here the comment I've just added to https://bugs.eclipse.org/bugs/show_bug.cgi?id=112948

Sorry guys, I don't think this is cool.

Yannick, what are you doing?

I have been working on that plugin for 10 years, you forked it 3 weeks ago or so, and want to contribute it to Eclipse yourself?

This is (maybe) legal, my project being covered by Apache 2 and EPL 2.

But:
 - if you though to help, you should have asked
 - I have already stared doing this myself. That is why added EPL 2.

For the Eclipse guys: do you want to just have the code as is, or continue to work and get maintenance?
And if you would prefer maintenance, then would you rather have if done by the original author, who maintained and improved this for 10 years?
Or some random guy who forked it?

Also note that the IP is not yet 100% out of the woods.

See the end of https://github.com/mihnita/ansi-econsole/issues/70
"For now though I am working to get a clearance from my employer.
...
TLDR: I don't expect problems, except for some delay.
But I want to make sure I "dot all the i's and cross all the t's" from the legal side.
"

Thank you very much,
Mihai

@mihnita
Copy link
Contributor

mihnita commented Jun 27, 2022

Note that my code had copyright notices with my name in

  • License.txt
  • AnsiConFeature\feature.xml
  • AnsiConsole\about.ini

These seem to be removed in Yannick's code.
Which (IANAL) violates both EPL 2 and Apache 2, which cover the original code.

@mihnita
Copy link
Contributor

mihnita commented Jun 27, 2022

He also seems prepared to publish his fork to Marketplace.
See the readme at https://github.com/ydaveluy/pretty-console

Legal? Maybe.

You guys should think if you want to get my code or his fork.

In balance: someone who reliably maintained and improved this code, fixing issues, and in general being responsive?
Or someone who recurses to such tactics, and has 5 github repos, 4 forked and 1 a modified version of mine?

This is not some abandoned project that he revived.

I am maintaining it (released a version just 2 weeks ago)

And I was working towards integrate into Eclipse.
For the current status of that please see mihnita/ansi-econsole#70
And contact the Eclipse guys in that thread, if you want.

Sorry for the tone, I am pretty angry right now.

Thank you very much,
Mihai

@iloveeclipse
Copy link
Member

@mihnita : I'm sorry, this was surely not intended, see #40 (comment)

I would close this PR now. We will be happy to get your PR.

@mihnita
Copy link
Contributor

mihnita commented Jun 27, 2022

Absolutely no problem. Thank you very much!

My displeasure was not directed towards any of you ("the Eclipse guys").
Also HannesWell chimed in and stopped it, which I highly appreciate.

My PR will come soon, I hope (see the entry about clearing it with my employer, for extra safety)

Mihai

@ydaveluy
Copy link
Author

Mihai,
It was absolutly not my intention to make you angry and my apologize for that.

I first tried to contribute to your plugin to solve some performances issues and improve (in my opinion) the design and you rejected my PR.

I decided to create a fork on my side (what you have seen in my repo) and to re-design other parts of the plugin. I shared with you all the issues I found to improve both your plugin and my fork.
It is a preliminary work and for now does not covers the legal aspects and it is not my intention to violate your IP.

In a second time, I have seen the bug report Bug 112948 and since your last message in 2018 nothing had changed and I believed you abandonned the project to integrate it in Eclipse. After that I said that I would be interested to contribute and provided a preliminary work.

Yannick

@mickaelistria
Copy link
Contributor

@mihnita FWIW, I believe Eclipse Project doesn't need IP clearance from your employer to get the code in. The fact that it is EPLv2 (assuming license was decided correctly, ie all copyright owners have approved this license) is enough to get the code at Eclipse.org. So you could already proceed with building a pull request and we'll then get it processed by Eclipse IP Team. If this becomes too complicated, anyone is actually allowed to take care of the submission or merge.
I think it's why @ydaveluy submitted this PR. There is no clear reason to wait more from Eclips POV, and we're all eager to see concrete progress in this area.

I don't want it to become an exclusive choice between @mihnita and @ydaveluy as contributor on Eclipse Platform. We expect both of you to contribute to the maintenance of ANSI console and to collaborate on that aspect. It's critical that everyone understands the code they submit in open-source is not only theirs any more and that it is very likely, and even desired, that some people fork/extend/modify it. The Eclipse Development Process describes how things must work in practice.

Back to this particular case, the issue is that the discussion and progress that was taking place at mihnita/ansi-econsole#70 was not visible from this tracker nor former bugzilla, which interested parties like @ydaveluy are using as reference. So it's more a communication/visibility issue that triggers this parallel submission.
@mihnita would you mind opening an issue to this tracker referencing mihnita/ansi-econsole#70 and using the eclipse one for further steps? It would be a more visible and central place that would facilitate collaboration ?

@mihnita
Copy link
Contributor

mihnita commented Jun 29, 2022

Hi all,


I believe Eclipse Project doesn't need IP clearance from your employer to get the code in.
The fact that it is EPLv2 (assuming license was decided correctly, ie all copyright owners have approved this license)

Well, the part in the brackets is the tricky one :-)

For those not familiar with copyright in the USA, your employer has copyright on anything you produce.
It does not matter if you did it in your own time and on your own machine.
But that would be to easy :-)
I'm in California, where the employer does not get copyright on things that are not related to their business.
So things become a bit muddy :-)
And I started this project before I even started with my current employer.

All of the above is of of course my very rough summary of the proper legalese (that I don't really understand, as IANAL :-)

But long story short: I wanted to be 100% that I don't mess up things.
Better safe than sorry.


@mihnita would you mind opening an issue to this tracker referencing

Would reusing https://bugs.eclipse.org/bugs/show_bug.cgi?id=112948 be OK?
If not, I can open a new one, just to track the Ansi Console => Eclipse integration.

Mihai

@mihnita
Copy link
Contributor

mihnita commented Jun 29, 2022

And now, sorry, but some dirty laundry :-(

I am sorry that I start this collaboration with the wrong foot.
But at least we all know where we are.
That's how it is with me: cards on the table, no backstabbing.
If I have something to say, I'll say it, as politely as I can, but as clear as I can.

So I will try to explain a bit my reaction, before I bury it forever :-)

  • The fork created by Yannick removed the Apache License 2, which covers the code
    I added EPL about one month ago.
  • The fork also removed all mentions of my copyright
    Both EPL 2 and Apache 2 require one to keep the copyright notices from the previous contributors

That's the legal part.

Now the "ownership" and communication.

I fully understand that under both Apache 2 and EPL 2 anyone is free to fork and do whatever they want with the code.

But how it is done also matters.
I've spent some time reading articles, to see if I overreacted.

And it looks like the general consensus is that forking is bad:

All articles I've linked are very good reads.

In general it looks like there should be good some reasons for a fork
(project abandoned, bad governance, unresponsive owners, etc.)

I don't think that was the case here.

The pull request that I rejected was with explanations why, and with a request to separate the bug fix, the refactoring that improve performance (if any), and refactoring based on taste. And removed existing functionality.
You be the judge(s): mihnita/ansi-econsole#76

This was a PR out of nowhere, with no prior communication.
In projects where I work with others (for work or open source) when I plan a refactoring I explain it in advance, what I want to do and why.

On the communication side, indeed https://bugs.eclipse.org/bugs/show_bug.cgi?id=112948 does not reflect mihnita/ansi-econsole#70

But Yannick was in direct contact with me, and I was responsive, and I actually fixed most of the bugs:

His offer to contribute to Eclipse was June 20.

So all he had to do before offering to fix Bug 112948 was to ask me "Hey, this bug is untouched for 3 years. If you are too busy, or you don't care, I intend to do it, if that's ok?"
But he didn't do that.

For example this was me asking the author of m2e-chromatic (forcing colors for Maven) if it is OK to implement that functionality in Ansi Console directly: sidespin/m2e-chromatic#3
Without using any of his code.
I though that is just common courtesy.

And this is his offer to help:
"I would be interested to contribute to this functionality. I developed a preliminary version ...")
Note "I DEVELOPED". No mention that it is in fact a fork of my project until asked directly by Hannes Wellmann.


So, sorry, but I don't think I overreacted.
There are too many missteps, not one or two.

With this out of the way, I hope we can focus on making this work, as professionally as possible.

I know Eclipse is a very well established project, and probably has most things documented.
But I know I will need quite a bit of handholding until I get up to speed.
I hope not much, but at least pointing me to the right documents.
And be a bit patient with my questions, at least in the beginning :-)

Best regards,
Mihai

@mickaelistria
Copy link
Contributor

Would reusing https://bugs.eclipse.org/bugs/show_bug.cgi?id=112948 be OK?

At this stage and given there have been good progress since the issue was 1st created, I think it's better to create a new fresgmissue on GitHub which would be more focused on this contribution.

The fact that it is EPLv2 (assuming license was decided correctly, ie all copyright owners have approved this license)

Well, the part in the brackets is the tricky one :-)

OK, so please notify as soon as this tricky part is safe so we can move forward.

@mihnita
Copy link
Contributor

mihnita commented Jun 30, 2022

I got the a copyright waiver from my employer.
Ready to go.


I've created the "Integrate in the ANSI Escapes in the Eclipse Console plugin #47" issue

I've updated https://bugs.eclipse.org/bugs/show_bug.cgi?id=112948 pointing to it.
I've updated mihnita/ansi-econsole#70 pointing to it (and suggested to close it)


I expect to prepare a PR over the week-end (4th of July, long week-end here :-)

Regards,
M.

@mickaelistria
Copy link
Contributor

@mihnita Great news! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants