Skip to content

Building up the delta parser

Jonathan Nieder git 1 version In review

Get series with b4
b4 am 20101013091714.GA32608@burratino

Versions newest first

  1. v1 Latest11 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11fixup! vcs-svn: Learn to parse variable-length integersvcs-svn/svndiff.c+2 -10 replies
2/11vcs-svn: Skeleton of an svn delta parserMakefile t/t9011-svn-da.sh test-svn-fe.c +2 more+189 -90 replies
3/11vcs-svn: Read the preimage while applying deltast/t9011-svn-da.sh vcs-svn/svndiff.c+53 -72 replies
4/11vcs-svn: Read inline data from deltast/t9011-svn-da.sh vcs-svn/svndiff.c+36 -30 replies
5/11vcs-svn: Read instructions from deltast/t9011-svn-da.sh vcs-svn/svndiff.c+23 -50 replies
6/11vcs-svn: Implement copyfrom_data delta instructiont/t9011-svn-da.sh vcs-svn/svndiff.c+112 -50 replies
7/11vcs-svn: Check declared number of output bytesvcs-svn/svndiff.c+5 -00 replies
8/11vcs-svn: Reject deltas that do not consume all inline datat/t9011-svn-da.sh vcs-svn/svndiff.c+5 -90 replies
9/11vcs-svn: Let deltas use data from postimaget/t9011-svn-da.sh vcs-svn/svndiff.c+70 -20 replies
10/11vcs-svn: Reject deltas that read past end of preimaget/t9011-svn-da.sh vcs-svn/sliding_window.c+10 -110 replies
11/11vcs-svn: Allow deltas to copy from preimaget/t9011-svn-da.sh vcs-svn/svndiff.c+58 -40 replies
11/11vcs-svn: Allow deltas to copy from preimaget/t9011-svn-da.sh vcs-svn/svndiff.c+58 -40 replies

Reviews trailers per patch

None of the 12 patches has a Reviewed-by or Acked-by.

PatchRamkumar RamachandraDavid Barr
1/11
2/11Helped-by Helped-by
3/11Helped-by Helped-by
4/11Helped-by Helped-by
5/11
6/11
7/11
8/11
9/11
10/11Helped-by Helped-by
11/11Helped-by Helped-by Helped-by Helped-by
11/11Helped-by Helped-by Helped-by Helped-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH/RFC 0/11] Building up the delta parser
Quoted 1 line · Jonathan Nieder

Implement an svndiff 0 interpreter

I hear that was nigh unreadable, so here's a reroll. Less cargo-cult support for broken deltas, more readability and tests. Patches apply on top of "[PATCH 15/16] t9010 (svn-fe): Eliminate dependency on svn perl bindings". As before, the end result includes a 'test-svn-fe -d' command that can apply svndiff0-format deltas, meaning less binary garbage to worry about as you puzzle over that confusing "svnrdump dump" output in debugging sessions.

Questions? Improvements? Bugs?

Patch 1 is a fixup to the variable-length integer parsing code, to report unexpected EOF (i.e., declared content length too long) correctly when it occurs in the middle of such an integer.

Patch 2 is the svndiff0 interpreter in broad strokes: read window, read window, read window, .... The patch doesn't encode any knowledge about what actually goes _in_ a window aside from the header, so it will error out for nonempty windows.

Patch 3 teaches the nacent interpreter to keep the appropriate piece of the preimage in memory. This is probably earlier in the series than it ought to be, but I wanted to try out the sliding window code.

With patches 4 and 5, the interpreter learns to read the "data" and "instructions" section of a window. The effect is observable because it finds the beginning of the next window correctly.

Patch 6 is an example instruction (copyfrom_data).

Patches 7-8 introduce some sanity checks.

Patches 9 and 10 are another instruction (copyfrom_target) and another sanity check.

Patch 11 is the last instruction (copyfrom_source). That's it. You can apply deltas now!

If anything seems unclear, please don't spend time puzzling it out --- just yell at me, so the code or documentation can be cleaned up. Happy reading.