Re: git-rev-list: add "--dense" flag
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:09
Linus Torvalds [off-list ref] writes:
Yes. Note that git-rev-list doesn't actually _do_ the diff, it only checks whether the tree is changed. You still just get a list of commits out of it, and it is up to you to decide what to do with it. If you're just going to feed them to diff-tree _anyway_, then you might as well not even do the dense thing, because quite frankly, you're just doing extra work. But let's say that you want to follow a certain filename, what you can do is basically (fake shell syntax with "goto restart") ... or something similar.
Isn't that only true because you are not doing more than "have these paths change" in the new rev-list that already has part of diff-tree? If rev-list can optionally be told to detect renames internally (it has necessary bits after all), it could adjust the set of paths to follow when it sees something got renamed, either by replacing the original path given from the command line with its previous name, or adding its previous name to the set of path limitters (to cover the copy case as well).