On Sat, Apr 8, 2017 2:38 PM Johan Corveleyn <jcorvel_at_gmail.com> wrote
>> Hm. Would that cover lines that were deleted, rather than added or
>> merely altered? That's one of my objections to a colleague's "just
>> use 'svn blame'!"
>
> I think in general it's hard to say whether you're interested in the
> deletion of line 100 in rev 10, when you're running 'svn log --lines
> 1500:1800' with HEAD being rev 10000. After the line is deleted, how
> would svn know that it's a deletion you're interested in, i.e. that it
> ends up being interesting to your line range? Subversion (currently)
> doesn't have functionality for tracking larger contextual blocks of
> text, so saying "but this line was part of a large block of text that
> got moved and ended up at lines 1500:1800" doesn't help.
>
> Thinking more about this, I guess my initial suggestion was a bit
> naive. The diffs used by 'blame' are just "minimal diffs". This means
> it's the smallest set of deletions and additions of lines that
> transforms X into Y. There is really no notion of a modification of a
> line. Some lines are deleted, some new ones are added. Maybe for you
> they're semantically related (so you see them as modifications), but
> they might just as well be totally unrelated (for instance: a function
> got deleted, and at that same spot a block of comments is introduced
> for the function below).
"svn diff" (and "diff", for that matter) seem to be able to keep pretty
good track of changes in the positions of lines that *aren't* changed
-- the context lines. A patch file notes that an altered block,
with its context lines, has been shifted up or down to a different
position, as long as the alterations aren't too severe; it generally
fails to recognize a block of text that has been moved with respect
to the rest of a file. If we accept that limitation, i.e. that we
can only get the limited history for a block of lines so far back as
the delimiting lines are invariant enough to serve as context lines
for diffs, does that simplify the problem enough to make it tractable?
Joel
Received on 2017-04-10 01:15:52 CEST