Le lun. 13 juil. 2020 à 21:57, Michael Osipov <micha...@apache.org> a
écrit :

> Am 2020-07-13 um 08:10 schrieb Romain Manni-Bucau:
> > Le dim. 12 juil. 2020 à 22:13, Michael Osipov <micha...@apache.org> a
> > écrit :
> >
> >> Am 2020-07-12 um 21:35 schrieb Maarten Mulders:
> >>> Although no formal standards, many cloud-based CI environments agreed
> >>> upon setting CI=true, and I think also Jenkins does that. It might be a
> >>> relatively simple way to detect most CI environments.
> >>>
> >>> The next question is what Maven should do with that information. I feel
> >>> like informing the user is more in the Maven spirit (just as the fact
> >>> that 3.7.0 warns when plugin versions aren't locked). Something like
> >>> "you typically want to set -B in this case". Setting flags the user
> >>> isn't aware of feels a bit odd to me.
> >>
> >> Don't limit your mind to CI only, please.
> >> Here is the most basic use case for isatty() detection:
> >> $ mvn ... > out
> >> $ mvn ... | grep foo
> >>
> >> If nothing passed, the system shall assume --non-interactive.
> >>
> >
> > Why? You can inject input there and you can also use colors.
>
> No, this expected behavior for every decent Unix tool for decades. If
> you are not interactive, you have to force it with --force-interactive.
> See grep, tree, svn, git, ls etc. I don't epect Maven to be different here.
>

Well, yes and no mainly due to the personae (that said not sure it is
important).
Why are grep, svn, git etc behaving like that when not in a tty? Because
they are used in an automation suite (scripts) and it makes it easy, right?
When is mvn used in such piped commands? Mainly in 2 env:
1. on the dev machine
2. on a CI

In both environments you could keep colors most of the time nowadays
(making the output more readable when read by a human who is used to the
colored output now) - and have to admit I was used to that before maven
gets jansi since I was using sed to colorize maven output and it was great
to keep maven highlighting in greps - was making it cat super friendly.
That said this point is not that important probably while we can toggle it
- could even be a toggle script as mvnDebug is.

To be complete let's dig into ls to have an example of this tty/not-tty
mode: what does ls change between tty and not tty modes?
A. printing multiple files per line vs one per line (to become grep
friendly). This one is out of topic for maven since maven does not have an
interactive output (yet maybe ;)) "à la gradle/node", we have one info per
line in all modes.
B. quoting special characters: same, we do nothing about that and not sure
we would gain much from it (maybe in shell mode but not sure in core maven
mode?).

So only thing I can see is that colors can change the way you would write
your grep but since it is already released and tooled - as behavior - and
jansi implicitly already switches off itself in not tty mode
(org.fusesource.jansi.AnsiConsole#wrapPrintStream) then the question is do
we want to go further or not.

I maybe misunderstood the "non-interactive" mode and assumed stdin would be
dropped which would really be an issue for me, if it is just about ensuring
it is pipe friendly, no issue from me to drop colors or whatever garbage
the output can issue.

Also wonder if your comment means you expect default interactive output to
change (basically using ansi.eraseScreen() to repaint a buffer of messages
for example) or if you only cared about the no-tty mode?

Sorry for the "block" but hope it makes things a bit clearer.




>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
>

Reply via email to