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

With Xcode 10.2, I could select the "Authors" view, then select a previous git revision to blame from the bottom picker:
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:
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.

It has been moved here
It has been moved here

for a git blame version click Editor->Author as it, sure it moved
you can select the icon located in top-right of Xcode to find a previous revision

Select the 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.

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.

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.
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.
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.
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.

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.

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.

Related

Xcode 11 Won't Open New Editor Pane

So Xcode 11 changed the way editor panes are added and removed. Ok, fine, I got used to it soon enough. But a few days after using the Xcode 11 GM build, the option to add an editor is suddenly disabled.
Could be a bug, could be a 'feature' that I've inadvertently triggered. Neither the menu, toolbar button nor shortcut (^⌘T) will give me another editor (though they all did with the same build yesterday).
Any ideas?
(Note: this screenshot has the Navigator pane hidden for simplicity. Its presence/absence doesn't help with this issue)
Ok, this is embarrassing. I was in a 'focus' mode and could only add editors after I had 'hidden focus'. There are a few ways to do this:
View > Editor > Hide Focus
Tap the 'arrows pointing at each other' icon in the top left of the editor toolbar
^⇧⌘↩︎
ps. I was seriously tempted to delete my question when I realised how dumb I'd been, but I'm leaving it up as I suspect this UI quirk might also trip up others (let me know if it does, it'll help me feel like less of a fool)

Is there a better way to see which Git branch I am on in the XCode 7 Interface?

I'd like to be able to see which Git branch I am currently working on at a glance in the XCode 7 (beta 5) interface without going through the menu system. Is this possible? I want to see the equivalent of running git branch from the command line which adds a star next to the current branch.
There are other questions which ask the question for earlier versions of XCode and I'd like to know if anything has changed or if anyone has any cleaver workarounds / solutions.
The only place I can see it is in the Source Control Menu after the project name:
Its also in the File Inspector in the Source Control Section which I can quickly show/hide using keyboard shortcuts but it would be nicer if I could see it as it is displayed in the Version Editor but without having to switch to the version editor:
Hi Codecowboy yes in Xcode 12.3 if you click on the so-called source code navigator (blue) x in the left menu panel header icon bar you should see the name of the project and the associated branch :-)

Xcode 6.3 shows random files instead of counterparts in assistant editor

I always have my Xcode assistant editor open with counterparts option. It's very handy to have an *.m file opened at standard editor while having corresponding *.h file in assistant editor.
After recent update to version 6.3 Xcode started to show random instead of corresponding headers quite often. Several clicks to "four squares" icon and mode usually brings it back (but it's very annoying).
Do you experience this too? How to fix it?
Note: deleting DerivedData didn't helped
As a workaround, one could use the Reset Editor command with the keyboard shortcut Command+Option+Shift+Z (US keyboard layout). If your keyboard layout doesn't match, you can see the key binding in View->Assistant Editor->Reset Editor. A word of caution, though, this will close any additional Assistant Editors you may have opened (the ones that open by clicking "+").
Another thing I noticed is the bug happens when you are switching Xcode windows or tabs but not when you are switching files within the same tab.
It looks like it's a just bug after all. I filed a bug report rdar://20684654. For a workaround see the accepted answer.
UPDATE: it's fixed in Xcode 6.4 beta

Restore top panel in NetBeans

I'm using NetBeans for my work. Suddenly top panel disappeared from all windows. I'm talking about panel where you can switch between current source and local history. See screenshot for better understanding: http://i62.tinypic.com/v8hdnp.png
As you can see i'm using latest stable version of NetBeans. Do i accidentally pressed some key combination that removed that panel or this is a bug?
Thanks
Found the solution. Right click on line numbers panel and then check "Show Editor Toolbar" option.
http://i58.tinypic.com/332c61g.png

XCode source control: view changes for one file

Is it possible to view a "timeline" (history) for a selected file for like 50 commits? I mean changes made to this particular file and and view commits when they were made and users who changed them? I know Xcode got some powerful version control features, I just can not find this one.
What it sounds like you want is the "Blame View", if we were on the terminal you could write git blame <file-name> to see the commit/time/and user for every single line of a particular file. In Xcode you can accomplish the same thing by activating the blame view. I've posted a picture to show you where the Blame View button resides. From there you should be all set.
For xcode 11.0, If you select a file, changes for that file is available on right panel.
The commit history is in the Version Editor.
Select the file for which you want to see the commit history. Then go to View > Version Editor > Show Version Editor (or just select the Comparison view from the top-right toolbar icon - same place as the Blame view).
Clicking on the commit label below the editor will reveal the history including dates.
Yes. Xcode's Comparison view is exactly for that. When you select a source file, and choose comparison view, you have a time-machine like user-interface that besides letting you compare any two versions of the file, will also present (when you hover) all the commits of the file with their descriptions. This UI opens when you click the clock button in the bottom between the two versions of the .
Pay attention, that Xcode will list all the commits, but will fail to show the content of versions of the file if the file-name or path changed. I think Xcode makers thought that because sources are considered "different" if they are named differently or located differently, there's no point in showing them. It may be, though that they just overlooked the --follow parameter to git.
Xcode 13
Enable Code Review (default: cmd+shift+opt+Enter to toggle)
On the right of the bottom bar (or if you have the debug area opened: the bar that sits on top of it) there are a couple of buttons used for comparing commits: clicking them allows you to pick which commits to use for the comparison on the current file.
Enable Code Review button
Comparison buttons on Debug Area

Resources