diff mbox

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

Message ID 20160818164523.3193-1-michael@niedermayer.cc
State Superseded
Headers show

Commit Message

Michael Niedermayer Aug. 18, 2016, 4:45 p.m. UTC
TODO: tempfiles

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 doc/libav-merge.txt |  4 ++++
 tools/murge         | 13 +++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100755 tools/murge

Comments

Clément Bœsch Aug. 22, 2016, 9:29 a.m. UTC | #1
On Thu, Aug 18, 2016 at 06:45:23PM +0200, Michael Niedermayer wrote:
> TODO: tempfiles
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  doc/libav-merge.txt |  4 ++++
>  tools/murge         | 13 +++++++++++++
>  2 files changed, 17 insertions(+)
>  create mode 100755 tools/murge
> 
> diff --git a/doc/libav-merge.txt b/doc/libav-merge.txt
> index 60c953a..4b2bb76 100644
> --- a/doc/libav-merge.txt
> +++ b/doc/libav-merge.txt
> @@ -103,6 +103,10 @@ It has two modes: merge, and noop. The noop mode creates a merge with no change
>  to the HEAD. You can pass a hash as extra argument to reference a justification
>  (it is common that we already have the change done in FFmpeg).
>  
> +Also see tools/murge, you can copy and paste a 3 way conflict into its stdin
> +and it will display colored diffs. Any arguments to murge (like ones to suppress
> +whitespace differences) are passed into colordiff.
> +
>  TODO/FIXME/UNMERGED
>  ===================
>  
> diff --git a/tools/murge b/tools/murge
> new file mode 100755
> index 0000000..1983fed
> --- /dev/null
> +++ b/tools/murge
> @@ -0,0 +1,13 @@
> +#!/bin/sh
> +
> +grep -A99999 '^<<<<<<<' | grep -B99999 '^>>>>>>>' >murge.X
> +grep -A99999 '^====' murge.X | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)' >murge.theirs
> +grep -B99999 '^||||' murge.X | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)' >murge.ours
> +grep -B99999 '^====' murge.X | grep -A99999 '^||||' | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)'  >murge.common
> +
> +colordiff -du $* murge.ours murge.theirs
> +grep . murge.common > /dev/null && colordiff -du $* murge.common murge.theirs
> +grep . murge.common > /dev/null && colordiff -du $* murge.common murge.ours
> +rm murge.theirs murge.common murge.ours murge.X
> +

I haven't tested yet but it should be fine

Thanks
Michael Niedermayer Aug. 22, 2016, 4:08 p.m. UTC | #2
On Mon, Aug 22, 2016 at 11:29:45AM +0200, Clément Bœsch wrote:
> On Thu, Aug 18, 2016 at 06:45:23PM +0200, Michael Niedermayer wrote:
> > TODO: tempfiles
> > 
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  doc/libav-merge.txt |  4 ++++
> >  tools/murge         | 13 +++++++++++++
> >  2 files changed, 17 insertions(+)
> >  create mode 100755 tools/murge
> > 
> > diff --git a/doc/libav-merge.txt b/doc/libav-merge.txt
> > index 60c953a..4b2bb76 100644
> > --- a/doc/libav-merge.txt
> > +++ b/doc/libav-merge.txt
> > @@ -103,6 +103,10 @@ It has two modes: merge, and noop. The noop mode creates a merge with no change
> >  to the HEAD. You can pass a hash as extra argument to reference a justification
> >  (it is common that we already have the change done in FFmpeg).
> >  
> > +Also see tools/murge, you can copy and paste a 3 way conflict into its stdin
> > +and it will display colored diffs. Any arguments to murge (like ones to suppress
> > +whitespace differences) are passed into colordiff.
> > +
> >  TODO/FIXME/UNMERGED
> >  ===================
> >  
> > diff --git a/tools/murge b/tools/murge
> > new file mode 100755
> > index 0000000..1983fed
> > --- /dev/null
> > +++ b/tools/murge
> > @@ -0,0 +1,13 @@
> > +#!/bin/sh
> > +
> > +grep -A99999 '^<<<<<<<' | grep -B99999 '^>>>>>>>' >murge.X
> > +grep -A99999 '^====' murge.X | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)' >murge.theirs
> > +grep -B99999 '^||||' murge.X | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)' >murge.ours
> > +grep -B99999 '^====' murge.X | grep -A99999 '^||||' | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)'  >murge.common
> > +
> > +colordiff -du $* murge.ours murge.theirs
> > +grep . murge.common > /dev/null && colordiff -du $* murge.common murge.theirs
> > +grep . murge.common > /dev/null && colordiff -du $* murge.common murge.ours
> > +rm murge.theirs murge.common murge.ours murge.X
> > +
> 
> I haven't tested yet but it should be fine

ok, what about the temp files ?
should i apply the patch as is or wait ?
nicolas seemed not happy about the temp files ?

[...]
Clément Bœsch Aug. 22, 2016, 4:13 p.m. UTC | #3
On Mon, Aug 22, 2016 at 06:08:08PM +0200, Michael Niedermayer wrote:
> On Mon, Aug 22, 2016 at 11:29:45AM +0200, Clément Bœsch wrote:
> > On Thu, Aug 18, 2016 at 06:45:23PM +0200, Michael Niedermayer wrote:
> > > TODO: tempfiles
> > > 
> > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > > ---
> > >  doc/libav-merge.txt |  4 ++++
> > >  tools/murge         | 13 +++++++++++++
> > >  2 files changed, 17 insertions(+)
> > >  create mode 100755 tools/murge
> > > 
> > > diff --git a/doc/libav-merge.txt b/doc/libav-merge.txt
> > > index 60c953a..4b2bb76 100644
> > > --- a/doc/libav-merge.txt
> > > +++ b/doc/libav-merge.txt
> > > @@ -103,6 +103,10 @@ It has two modes: merge, and noop. The noop mode creates a merge with no change
> > >  to the HEAD. You can pass a hash as extra argument to reference a justification
> > >  (it is common that we already have the change done in FFmpeg).
> > >  
> > > +Also see tools/murge, you can copy and paste a 3 way conflict into its stdin
> > > +and it will display colored diffs. Any arguments to murge (like ones to suppress
> > > +whitespace differences) are passed into colordiff.
> > > +
> > >  TODO/FIXME/UNMERGED
> > >  ===================
> > >  
> > > diff --git a/tools/murge b/tools/murge
> > > new file mode 100755
> > > index 0000000..1983fed
> > > --- /dev/null
> > > +++ b/tools/murge
> > > @@ -0,0 +1,13 @@
> > > +#!/bin/sh
> > > +
> > > +grep -A99999 '^<<<<<<<' | grep -B99999 '^>>>>>>>' >murge.X
> > > +grep -A99999 '^====' murge.X | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)' >murge.theirs
> > > +grep -B99999 '^||||' murge.X | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)' >murge.ours
> > > +grep -B99999 '^====' murge.X | grep -A99999 '^||||' | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)'  >murge.common
> > > +
> > > +colordiff -du $* murge.ours murge.theirs
> > > +grep . murge.common > /dev/null && colordiff -du $* murge.common murge.theirs
> > > +grep . murge.common > /dev/null && colordiff -du $* murge.common murge.ours
> > > +rm murge.theirs murge.common murge.ours murge.X
> > > +
> > 
> > I haven't tested yet but it should be fine
> 
> ok, what about the temp files ?

I was just pointing out a potentially better solution, but it's not really
important. I don't think you should spend much more time on this.

> should i apply the patch as is or wait ?

I'm fine with applying the patch as is.

[...]
Michael Niedermayer Aug. 22, 2016, 4:34 p.m. UTC | #4
On Mon, Aug 22, 2016 at 06:13:05PM +0200, Clément Bœsch wrote:
> On Mon, Aug 22, 2016 at 06:08:08PM +0200, Michael Niedermayer wrote:
> > On Mon, Aug 22, 2016 at 11:29:45AM +0200, Clément Bœsch wrote:
> > > On Thu, Aug 18, 2016 at 06:45:23PM +0200, Michael Niedermayer wrote:
> > > > TODO: tempfiles
> > > > 
> > > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > > > ---
> > > >  doc/libav-merge.txt |  4 ++++
> > > >  tools/murge         | 13 +++++++++++++
> > > >  2 files changed, 17 insertions(+)
> > > >  create mode 100755 tools/murge
> > > > 
> > > > diff --git a/doc/libav-merge.txt b/doc/libav-merge.txt
> > > > index 60c953a..4b2bb76 100644
> > > > --- a/doc/libav-merge.txt
> > > > +++ b/doc/libav-merge.txt
> > > > @@ -103,6 +103,10 @@ It has two modes: merge, and noop. The noop mode creates a merge with no change
> > > >  to the HEAD. You can pass a hash as extra argument to reference a justification
> > > >  (it is common that we already have the change done in FFmpeg).
> > > >  
> > > > +Also see tools/murge, you can copy and paste a 3 way conflict into its stdin
> > > > +and it will display colored diffs. Any arguments to murge (like ones to suppress
> > > > +whitespace differences) are passed into colordiff.
> > > > +
> > > >  TODO/FIXME/UNMERGED
> > > >  ===================
> > > >  
> > > > diff --git a/tools/murge b/tools/murge
> > > > new file mode 100755
> > > > index 0000000..1983fed
> > > > --- /dev/null
> > > > +++ b/tools/murge
> > > > @@ -0,0 +1,13 @@
> > > > +#!/bin/sh
> > > > +
> > > > +grep -A99999 '^<<<<<<<' | grep -B99999 '^>>>>>>>' >murge.X
> > > > +grep -A99999 '^====' murge.X | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)' >murge.theirs
> > > > +grep -B99999 '^||||' murge.X | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)' >murge.ours
> > > > +grep -B99999 '^====' murge.X | grep -A99999 '^||||' | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)'  >murge.common
> > > > +
> > > > +colordiff -du $* murge.ours murge.theirs
> > > > +grep . murge.common > /dev/null && colordiff -du $* murge.common murge.theirs
> > > > +grep . murge.common > /dev/null && colordiff -du $* murge.common murge.ours
> > > > +rm murge.theirs murge.common murge.ours murge.X
> > > > +
> > > 
> > > I haven't tested yet but it should be fine
> > 
> > ok, what about the temp files ?
> 
> I was just pointing out a potentially better solution, but it's not really
> important. I don't think you should spend much more time on this.
> 
> > should i apply the patch as is or wait ?
> 
> I'm fine with applying the patch as is.

nicolas, ok if i apply it as is ?

[...]
Nicolas George Aug. 22, 2016, 4:39 p.m. UTC | #5
Le sextidi 6 fructidor, an CCXXIV, Michael Niedermayer a écrit :
> nicolas, ok if i apply it as is ?

Just like Clément, I was only pointing possible avenues for enhancement.

Regards,
Michael Niedermayer Aug. 22, 2016, 4:45 p.m. UTC | #6
On Mon, Aug 22, 2016 at 06:39:24PM +0200, Nicolas George wrote:
> Le sextidi 6 fructidor, an CCXXIV, Michael Niedermayer a écrit :
> > nicolas, ok if i apply it as is ?
> 
> Just like Clément, I was only pointing possible avenues for enhancement.

ok

applied

thx

[...]
diff mbox

Patch

diff --git a/doc/libav-merge.txt b/doc/libav-merge.txt
index 60c953a..4b2bb76 100644
--- a/doc/libav-merge.txt
+++ b/doc/libav-merge.txt
@@ -103,6 +103,10 @@  It has two modes: merge, and noop. The noop mode creates a merge with no change
 to the HEAD. You can pass a hash as extra argument to reference a justification
 (it is common that we already have the change done in FFmpeg).
 
+Also see tools/murge, you can copy and paste a 3 way conflict into its stdin
+and it will display colored diffs. Any arguments to murge (like ones to suppress
+whitespace differences) are passed into colordiff.
+
 TODO/FIXME/UNMERGED
 ===================
 
diff --git a/tools/murge b/tools/murge
new file mode 100755
index 0000000..1983fed
--- /dev/null
+++ b/tools/murge
@@ -0,0 +1,13 @@ 
+#!/bin/sh
+
+grep -A99999 '^<<<<<<<' | grep -B99999 '^>>>>>>>' >murge.X
+grep -A99999 '^====' murge.X | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)' >murge.theirs
+grep -B99999 '^||||' murge.X | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)' >murge.ours
+grep -B99999 '^====' murge.X | grep -A99999 '^||||' | egrep -v '^(=======|<<<<<<<|>>>>>>>|\|\|\|\|\|\|\|)'  >murge.common
+
+colordiff -du $* murge.ours murge.theirs
+grep . murge.common > /dev/null && colordiff -du $* murge.common murge.theirs
+grep . murge.common > /dev/null && colordiff -du $* murge.common murge.ours
+rm murge.theirs murge.common murge.ours murge.X
+
+