Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes: > Then I would make modified "texts" from the blob of the file in the > current revision and its parent revision, by inserting newlines after > every single byte (probably replacing the original newlines by other > values, such as \x01). > > The reason for this touchup is that the diff machinery in Git only handles > line-based diffs. > > Then you can parse the hunk headers, adjust the offsets accordingly,... I would agree that text converted to "byte-per-line" format would be the easiest way to re-use the diff engine, but if you go one more step, you can even reusel the blame engine as well. You convert the text into "byte-in-hex-and-lf" (e.g. "AB C\n" becomes "41\n42\n20\n43\n0a\n") and feed it into existing blame and have it produce script-readable output, instead of feeding that to your reinvention of blame using diff engine. You would need to postprocess the computed result (either by diff or blame) to lay out the final text output in either case anyway, and making the existing blame engine do the work for you would be a better approach, I think. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html