I was comparing two patchsets unaware of the fact that the newer one had been rebased. Hence, it took me a while to understand why I was seeing some changes that could not possibly have been introduced in the newer patchset.
To me, the root of the problem is that Gerrit's interface doesn't make it clear when rebases have occurred during the patchset history. The "Base" link, preceeding the numeric links to each patchset, is different from them because it isn't a fixed link as I thought it was. It really points to the parent of the currently selected patchset commit, right? I mean, for instance, if there is a rebase between patchsets 1 and 2, when you select patchset 1 the base link points to #1's parent and when you select patchset 2 the base link changes to point to #2's parent.
I agree that we must have a link pointing to the currently selected patchset's parent commit. However, it's confusing to have a single link that changes where it points to depending on the context. It's very subtle and can lead to misunderstandings.
I think that perhaps we need more "base" links: one for the first patchset and an extra one for each rebase. I'm thinking of something like this. Suppose we have a series of 6 patchsets and that we had a rebase before #3 and another one before #5. In this case the patchset links in the diff interface could be something like this:
Base 1 2 Base 3 4 Base 5 6
Or, perhaps, using some vertical spacing to enhance the visualization, something like this:
1 2 3 4 5 6
Base Base Base
The first Base link points the the parent commit of patchsets 1 and 2. The second Base points to the parent commit of patchsets 3 and 4. The third Base points to the parent commit of patchsets 5 and 6. This makes it clear where rebases occurred and avoids a source of misunderstandings. It also allows one to compare different bases, something I don't think is possible in the current interface, right?
The default diff endpoints should remain the same, i.e., the last patchset against it's own Base (the last one).
What do you think?
--