I’m going through source file revision history in the Xcode 7.2 Version Editor. It shows the current git revision of a source file at the bottom of the right source code pane. Clicking on this revision shows a popup of older revisions. When I click on an item in the list, I can go back to a previous revision and compare it with the current source file.
Most of the time this works fine. However, sometimes selecting a previous revision shows an error:
The source controler operation failed because the revision “MyFile.m” could not be found. Make sure a valid revision exists in the repository and try again.
Checking the file’s revision with git command line:
git log <path to my file>
and it shows only one revision, the first one listed in the Xcode revision list. Hmmm…that’s funny, where are all the extra revisions coming from?
Digging into git documentation, I see the following command-line switch for the git log command:
--follow Continue listing the history of a file beyond renames (works only for a single file).
Ok, I use this switch with the log command and I see all revisions shown in the Xcode revision list.
So, can I conclude that the Xcode uses the —follow switch to populate the revision list but the code to actually show the revision doesn’t use this information?
Doug Hill |