[bug] commands output inconsistence

Matthieu Moy Matthieu.Moy at imag.fr
Wed Jul 26 15:50:19 BST 2006


[ s**t, my internet connection went off just when I wanted to send the
  message. Well, it's rendundant with Aaron's and John, but I'm still
  posting it in case ;-) ]

Alexander Belchenko <bialix at ukr.net> writes:

> Probably my english skill is too bad or I simply too dumby to understand
> why different command should emit their information output to different
> streams.
>
> I try to talk not about workarounds. I try to talk about consistency.
> Consistency of output of different bzr commands.

But you're mixing this problem with your encoding problem, which is
another one.

> If I understand correctly there is several types of bzr output:
>
> - errors and warnings messages

I'd say "messages to the attention of the user while the program is
running".

Things like "Using saved location http://foobar" is not an error or
warning, but it's not part of "the output".

> - progress bar (each command could potentially has progress bar)
> - informational output

Well, imagine you have a programming language with functions, you want
to write

result = function(arguments);

and the function may have other side effects. The important thing is
that the result is in the variable "result" at the end.

In the process + redirection world, this is for me the equivalent of

$ command arguments > result.txt

if you take "bzr diff", you can imagine a world where it does

$ bzr diff
Inode changed for file foo
Using some kind of cached version of foo
--- foo
+++ foo
 x
 y
 z
-w
+t
Inode and date didn't change for bar
$ _

Then, you'd want

$ bzr diff > output.txt
Inode changed for file foo
Using some kind of cached version of foo
Inode and date didn't change for bar
$ cat output.txt
--- foo
+++ foo
 x
 y
 z
-w
+t


Well, for many commands, it's not clear whether the output is real
output or informative message. For commit, mkdir, add, the "result" of
the command is the effect on the branch and on the tree, not what
appears on your terminal. So, currently, those commands have no output
and only informative messages.

> I simply wanted to have ability easy redirect output of commands to
> file. It could be useful for creating examples for documentation or for
> preparing bug reports.

For sure.

I don't know how Windows does this, but for me (zsh), I just do

$ command >& file.txt

when I want both stdout and stderr in the file. Then, once again, you
seem to have an encoding problem which is most likely a bug.

Hope this is clearer.

-- 
Matthieu




More information about the bazaar mailing list