How to Git Blame/Authors a previous revision with Xcode 11?

XcodeGit BlameXcode11

Xcode Problem Overview


With Xcode 10.2, I could select the "Authors" view, then select a previous git revision to blame from the bottom picker: picker is available

But with Xcode 11 beta, when I select the "Authors" view, I'm unable to select a past revision to blame because the picker is missing: picker is missing

Was that feature removed, or are there new steps to do to blame the lines of code for a past revision? To illustrate it even more, I'd like to see in Xcode 11 a past Blame like GitHub does when you blame a specific previous revision.

Xcode Solutions


Solution 1 - Xcode

It has been moved here

enter image description here

It has been moved here

Solution 2 - Xcode

for a git blame version click Editor->Author as it, sure it moved enter image description here

you can selectenter image description here the icon located in top-right of Xcode to find a previous revision

Solution 3 - Xcode

Select the enter image description here icon in the window title bar to enter "Code Review" mode.

git log (History) is available at Cmd-Alt-2. There you can open a specific commit in code review mode via the context menu.

Solution 4 - Xcode

Mine wasn't showing up until I went to Editor > Show Last Change For Line. After I selected that, the 'Authors' row appeared in Editor > Authors, as well as in the 'Adjust Editor Options' icon in the top right of the page.

Solution 5 - Xcode

Answer to the original question:

You can't. Since Xcode 11, you can only git-blame your working copy. Note: This is my suggested answer after a lot of trying and googling. I'd be happy to learn the opposite.

Further information:

Many people, including me, seem to land on this page because they don't find the git-blame feature AT ALL in Xcode 11.

In Xcode < 10, the version editor came in three flavors: 1) Comparison view (=side-by-side diff), 2) Author (=git-blame) 3) Log. In all three flavors, you could choose a specific revision to look at.

flavors of Xcode 10 version editor

In Xcode >= 11, the version editor (now called “Code Review”) only encompasses the comparison view (=side-by-side diff). The Code Review mode is toggled on/off with the double arrow button in the tool bar.

Code Review in Xcode 11

The Authors view (a.k.a. git-blame) is now a side-pane of the normal editor and can be toggled on/off in the Editor main menu. THIS OPTION IS NOT AVAILABLE WHEN YOU ARE IN CODE REVIEW MODE! For me, this caused confusion when looking for the Authors view.

enter image description here

The fact that the Authors view is not part of the version editor might be the reason that we cannot choose to look at arbitrary revisions. I have filed a suggestion with Apple to re-enable this feature. You should consider to do the same to give the issue more visibility.

Solution 6 - Xcode

In Xcode 11, the previous "Authors" menu item doesn't appear by default in the menu set. The simplest way to make it appear is to press the default key bind shift+control+command+A. After that, you'll find that "Minimap", "Authors", and "Code Coverage" now appear in the "Editors" menu.

Solution 7 - Xcode

If you go up to the top of Xcode, go to "View" and tap on "Show code review", you'll be able to get the git history with author information like on older versions of Xcode.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCœurView Question on Stackoverflow
Solution 1 - Xcode腾 吉View Answer on Stackoverflow
Solution 2 - XcodeActonView Answer on Stackoverflow
Solution 3 - XcodeOrtwin GentzView Answer on Stackoverflow
Solution 4 - XcodeclaassenAppsView Answer on Stackoverflow
Solution 5 - XcodefieresView Answer on Stackoverflow
Solution 6 - XcodebleaterView Answer on Stackoverflow
Solution 7 - XcodevidleView Answer on Stackoverflow