Matthieu Moy <[EMAIL PROTECTED]> writes: > Stephen Leake <[EMAIL PROTECTED]> writes: > >> So I had it backwards; I thought calling "sh" explicitly was there to >> combine stderr and stdout, but it's actually there to separate them. >> I'll add a comment that explains that. > > Yes. Typically, you can get > > $ DVC status > stderr> comparing files in dir with repo > stderr> Oh, be carefull, you have something weird in your config! > stderr> ......... # this is a progress bar > stderr> I'm almost finished. > stdout> M file1.c > stdout> A file2.c > > And you really want to parse only stdout. stderr are for warnings and > informative messages, but should not be parsed. > > The sh -c "foo 2> error-file" thing is an ugly hack, but I know no way > to do it better, and this is what people advised me to do.
Right. I think this is a reasonable solution, given that Emacs in general needs support from a POSIX shell for many of its utilities. I think the ultimate best solution would be for Emacs to offer a variant of start-process that routes stdout to one buffer and filter and stderr to another. I looked at the Emacs C code for this, and there's no way that's going to happen. That is the hairiest piece of hacked up C I've ever seen; every other line is an #ifdef on a different flag; I cannot figure out what's going on. Clearly getting output to a buffer on all the platforms Emacs supports is a major headache. > Another way would be to distribute an executable, i.e. stdouterr > running like: > > $ stdouterr stdout-file stderr-file cmd args > > This executable could be a sh script on unix, and anything else on > windows. As Christian points out, this would work for one-shot commands. But monotone has an on-going session style of interface, where this would be useless. -- -- Stephe _______________________________________________ Dvc-dev mailing list [email protected] https://mail.gna.org/listinfo/dvc-dev
