[FFmpeg-devel] [PATCH] doc&tools: Add murge script, for analyzing 3 way conflicts.

Michael Niedermayer michael at niedermayer.cc
Thu Aug 18 19:45:34 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 =(:) =(:) =(:)

i didnt realize it first but
all these will also break the output

currently what you would get is somethig like below
note the filenames!
IIUC they would be like /dev/fd/42 with these changes making it
unreadable

ill post a patch fixing the other issues but the tempfiles i wont
touch

--- murge.ours  2016-08-18 18:37:05.988944547 +0200
+++ murge.theirs        2016-08-18 18:37:05.984944545 +0200
@@ -1,2 +1,2 @@
-#define LIBAVFILTER_VERSION_MINOR  52
+#define LIBAVFILTER_VERSION_MINOR  47
 #define LIBAVFILTER_VERSION_MICRO 100
--- murge.common        2016-08-18 18:37:05.988944547 +0200
+++ murge.theirs        2016-08-18 18:37:05.984944545 +0200
@@ -1,2 +1,2 @@
-#define LIBAVFILTER_VERSION_MINOR  46
-#define LIBAVFILTER_VERSION_MICRO 102
+#define LIBAVFILTER_VERSION_MINOR  47
+#define LIBAVFILTER_VERSION_MICRO 100
--- murge.common        2016-08-18 18:37:05.988944547 +0200
+++ murge.ours  2016-08-18 18:37:05.988944547 +0200
@@ -1,2 +1,2 @@
-#define LIBAVFILTER_VERSION_MINOR  46
-#define LIBAVFILTER_VERSION_MICRO 102
+#define LIBAVFILTER_VERSION_MINOR  52
+#define LIBAVFILTER_VERSION_MICRO 100

[...]


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.
-------------- 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/5c2867be/attachment.sig>


More information about the ffmpeg-devel mailing list