[FFmpeg-devel] [PATCH] doc&tools: Add murge script, for analyzing 3 way conflicts.
Michael Niedermayer
michael at niedermayer.cc
Thu Aug 18 19:35:00 EEST 2016
On Wed, Aug 17, 2016 at 07:34:07PM +0200, Nicolas George wrote:
> Le primidi 1er fructidor, an CCXXIV, Clement Boesch a écrit :
> > maybe these files should be in /tmp
> >
> > i'd also suggest
> >
> > TMPFILES="murge.theirs murge.common murge.ours murge.X"
> > trap 'rm -f -- $TMPFILES' EXIT
> >
> > (stolen from configure)
>
> Temporary files are annoying and tricky (and configure does not clean up
> when it is interrupted).
>
> I suggest to require a more advanced shell (bash or zsh; since this tool is
> meant for developers it is acceptable) and use process substitution:
>
> diff <(grep ...) <(grep ...)
>
> It starts both grep processes just like "grep | diff", but then, instead of
> connecting the other end of the pipe to diff's standard input, it gives it
> the corresponding file name as /dev/fd/42.
>
> If temp files are really necessary because the command does not work with
> pipes, then zsh's process substitution can serve:
>
> diff =(grep ...) =(grep ...)
>
> It does the same as <(grep) but with a temp file instead of a pipe; zsh does
> all the cleanup for us.
>
> Last of all, if temp files are necessary because the output needs to be
> processed several times, zsh's process substitution can still be abused:
>
> function do_the_work {
> grep > $1
> grep > $2
> grep > $3
> diff $1 $2
> diff $2 $3
> }
> do_the_work =(:) =(:) =(:)
>
> The strange smileys are just process substitution with a dummy command.
> Therefore, it starts the function with three temp files. They are all empty,
> because the dummy command does not produce output, but they can then be used
> in the function.
It seems you are very interrested in this, this mail after all is
several times longer than the script its about.
maybe it would be easiest if you take over the maintaince of it ?
I used the script for years and never cleaned anything up yet i have
no match for "locate murge" except the script itself, also i dont
have zsh installed
If i would rewrite it based on zsh (which i dont know) fixing
a bug (which apparently never occured in years of actual use)
i have the fear the result will be more buggy, especially as iam not
using it currently and wouldnt notice a new bug ...
These changes should either be done by someone using it or someone
knowing the features he is using.
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160818/fbafb0b0/attachment.sig>
More information about the ffmpeg-devel
mailing list