Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to define custom merge and diff drivers in your git config, and then use attributes to associate them with the files.</p> <p><strong>This just does a simple text merge on the dumps, so it could very well produce total nonsense. You will absolutely need to check its work to make sure it did the right thing</strong> It should take the tedium out of the easy merges though.</p> <p>In your .git/config:</p> <pre><code>[merge "sqlite3"] name = sqlite3 merge driver driver = merge-sqlite3 %O %A %B [diff "sqlite3"] name = sqlite3 diff driver command = diff-sqlite3 </code></pre> <p>in .gitattributes:</p> <pre><code>signons.sqlite diff=sqlite3 merge=sqlite3 </code></pre> <p>And somewhere in your path, named diff-sqlite3</p> <pre><code>#!/usr/bin/perl -w use File::Temp qw/ :POSIX /; use IPC::Run qw/run/ ; @ARGV == 7 or die sprintf 'wtf %s', join(' ', @ARGV); my ($name, $x, $y) = ($ARGV[0], $ARGV[1], $ARGV[4]); my ($a, $b); eval { $a = tmpnam(); $b = tmpnam(); run ['sqlite3', $x, '.dump'], '&gt;', $a or die 'sqlite3 failed'; run ['sqlite3', $y, '.dump'], '&gt;', $b or die 'sqlite3 failed'; print "diff-sqlite3 a/$name b/$name\n"; run ['diff', '-u', $a, $b, '--label', "a/$name", '--label', "b/$name"], '&gt;', \*STDOUT; unlink $a; unlink $b; 1; } or do { unlink $a if defined $a; unlink $b if defined $b; die $@; } </code></pre> <p>also in your path, named merge-sqlite3 </p> <pre><code>#!/usr/bin/perl -w use File::Temp qw/ :POSIX /; use IPC::Run qw/run/ ; @ARGV == 3 or die sprintf 'wtf %s', join(' ', @ARGV); my ($o, $a, $b) = @ARGV; print "MERGEING SQLITE FILES $o $a $b\n"; eval { $ad = tmpnam(); $bd = tmpnam(); $od = tmpnam(); run ['sqlite3', $o, '.dump'], '&gt;', $od or die 'sqlite3 failed'; run ['sqlite3', $a, '.dump'], '&gt;', $ad or die 'sqlite3 failed'; run ['sqlite3', $b, '.dump'], '&gt;', $bd or die 'sqlite3 failed'; run ['merge', $ad, $od, $bd] or do { my $newname = "$a.dump"; my $n = 0; while (-e $newname) { ++$n; $newname = "$a.dump.$n"; } print "merge failed, saving dump in $newname\n"; rename $ad, $newname; undef $ad; die 'merge failed'; }; unlink $a or die $!; my $err; run ['sqlite3', $a], '&gt;', \*STDOUT, '2&gt;', \$err, '&lt;', $ad; if ('' ne $err) { print STDERR $err; die 'sqlite3 failed'; } unlink $ad if defined $ad; unlink $bd; unlink $od; 1; } or do { unlink $ad if defined $ad; unlink $bd if defined $bd; unlink $od if defined $od; die $@; } </code></pre> <p>I just hacked these up right now, now so you may have to iron out the kinks. </p> <p>see: <a href="http://git-scm.com/docs/gitattributes" rel="noreferrer">http://git-scm.com/docs/gitattributes</a> and <a href="http://git-scm.com/docs/git-config" rel="noreferrer">http://git-scm.com/docs/git-config</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload