From patchwork Thu Aug 18 16:45:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 213 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp447263vsd; Thu, 18 Aug 2016 10:10:35 -0700 (PDT) X-Received: by 10.194.178.102 with SMTP id cx6mr2955208wjc.58.1471540235173; Thu, 18 Aug 2016 10:10:35 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x6si462067wmg.52.2016.08.18.10.10.34; Thu, 18 Aug 2016 10:10:35 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 145B4689C02; Thu, 18 Aug 2016 20:10:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (unknown [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A05DB689CE7 for ; Thu, 18 Aug 2016 19:46:13 +0300 (EEST) Received: from mfilter19-d.gandi.net (mfilter19-d.gandi.net [217.70.178.147]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 6CA3CA80C4 for ; Thu, 18 Aug 2016 18:46:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter19-d.gandi.net Received: from relay3-d.mail.gandi.net ([IPv6:::ffff:217.70.183.195]) by mfilter19-d.gandi.net (mfilter19-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id xWUPoeH7wmmW for ; Thu, 18 Aug 2016 18:46:01 +0200 (CEST) X-Originating-IP: 213.47.41.20 Received: from localhost (213-47-41-20.cable.dynamic.surfer.at [213.47.41.20]) (Authenticated sender: michael@niedermayer.cc) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id B98BFA80DF for ; Thu, 18 Aug 2016 18:46:01 +0200 (CEST) Date: Thu, 18 Aug 2016 18:45:34 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20160818164534.GJ5460@nb4> References: <20160817170644.16566-1-michael@niedermayer.cc> <20160817172222.GO26860@leki> <20160817173407.GA2578962@phare.normalesup.org> MIME-Version: 1.0 In-Reply-To: <20160817173407.GA2578962@phare.normalesup.org> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [FFmpeg-devel] [PATCH] doc&tools: Add murge script, for analyzing 3 way conflicts. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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