What is Hunk history button in sublime merge - sublimemerge

In Sublime Merge, while looking at the file history, on hovering the code diff area there appears a Hunk history button.
What is the functionality offered with this button?

It limits the history to show only the history for those specific lines in that specific file.

Related

How do I use the VS Code Timeline to do the equivalent of git revert?

In VS Code under the timeline dropdown there is list of commits. Clicking on a commit causes a split page to appear, one red on the left and the other green on the right. How do I revert to cause the code in the file to go from green back to red? The top right has a ellipsis that when clicked there is a option to 'revert selected ranges' but when trying to select the ranges and clicking the 'revert selected ranges nothing happens'? Does the 'revert selected ranges' not do the equivalent of git revert?
Under the timeline if I right click and copy commit ID and then in the terminal run git revert it does what is excepted, created a new commit which reverts the changes

Using VSCode, how do I compare two non-consecutive commits on a file in Gitlens

When I use Gitlens in VScode, I cannot find an option to compare commits on a file when they are not consecutive. If I use 'open changes' on a certain commit in the 'File History' panel, it always compares that version of the file with the previous one. Is there a way to choose to compare one revision of the file (and not necessarily the latest revision) with another revision of my choosing of that file?
You can compare two nonconsecutive commits via the following steps (assuming you have the Gitlens extension installed):
Source Control tab (or Gitlens tab) -> Open the Branches menu.
From the branches menu -> Open the branch of interest.
Right click on a particular commit and select "Select for Compare"
Similarly, find the other commit you're interested in, right click and select "Compare with Selected"
You will see that under the "Search & Compare" menu, your two different commits are compared.
edit note: you might not see a Gitlens tab anymore as it was (optionally) merged with the Source Control tab, in version 11.2.1.
First, install gitlens plugin
Second, press F1, input gitlens:compare references
Third, input 1st commit hash and 2nd commit hash
Then, in the right side bar, find SEARCH & COMPARE
You will find the two commits' diff details
You can do this without Gitlens:
Right click on the file
Choose "Commit Changes"
Choose "Open Changes with Revision..."
Then choose the commit you want to compare your file with.
One way is to checkout one of the commits you want to diff in terminal
git checkout <commit_hash>
and the select the other comit in gitlens, click open changes to see diff.

Is there any way to adjust Netbeans to show history line by line aside programming area?

I am using Git. For looking into history we need to click history tab and another window opens show dif to previous and current.
Like Intellij, where history of Line is shown in left gadget, which show date and author who checked in code. Is there any way or plugin to get similar screens in netbeans?
Right click on the editor's tab, then ghoose "Git -> Show Annotations"
The last commit and the committer are shown in the left area of the editor then. If you hover the mouse over that is also shows you the commit message:

How to view a file's full history in P4V?

I've got a file that's been branched a few times and I would like to see it's full history in the History tab in P4V. Perforce has this data as I can do a timelapse view of the file with "Use branch history" and see all the previous versions of the file (as I'd expect). Is there an option somewhere in P4V to show this branch history, or history of a file across branches? It'd be rather useful.
In the upper right corner of the File History pane there's a "branch history" dropdown (it's the same icon as the "Show Branch History" button in Time-Lapse View). Click that, and check the option to "Follow Branch Actions". This will make File History follow the linear history of a file backward through "branch from" relationships, exactly as happens in Time-Lapse View when "Show Branch History" is enabled.

Highlighting modified lines in Eclipse

In netbeans, if I open a file which is under version control the lines which are modified are highlighted in the left. (green for new lines and blue for modified lines)
Is it possible to get a similar effect in Eclipse?
Open the Preferences window
Search for "diff"
Select Quick Diff
Change the "Use this reference source" to a SCM provider (like CVS, SVN or Git)
By default, it compares to the latest version on disk, which, if you've saved the file, is no diff at all. You have to activate the comparison against a SCM repo. I'm not sure what happens if you more than one type of SCM since this is only a single selection.
With Subversive, you can do Team > Show Annotations, and it will annotate the lines with the author and date of the last modification of that line.
Right-click on the file > Team > Show annotation.
A brown tape will appear on the left-side of the code (it represents commited lines), and the modified lines will be shown in white.
In Eclipse by using its Quick Diff feature. This is easy to do:
Go to Window -> Preferences -> General -> Editors -> Text Editors ->
Quick Diff. This is the dialog from where it can be configured.
Turn on Quick Diff, by enabling the option Enable quick diff.
Choose the version control system for which Quick Diff is needed
from the dropdown Use this reference source. Git, SVN and CVS should
be present here. Mercurial appears if the MercurialEclipse plugin is
installed.
The overview ruler is the ruler to the right of the scrollbar in the
editor. If you would like to see the uncommitted lines to be marked
on it, enable the option Show differences in overview ruler.
Choose Apply and OK. Close all editor windows and reopen the source
file that you want in the editor.
You should be able to see the newly added, modified or deleted lines marked in colors in the left bar on which line numbers are usually displayed. The colors used are the ones set in the Quick Diff dialog (see above steps). You can also view these uncommitted locations marked along the overview ruler on the right.
For Eclipse Version: 2019-03 (4.11.0) Go to
Select 'window'
Select 'Preferences'
Go to General -> Editors -> Text Editors -> Quick Diff
Tick 'Enable quick diff'
Tick 'Show differences in overview ruler'
If you want to keep the changes after you save your local copy, then you need to tell the eclipse to compare the local copy with the repository version. To do that change the reference source accordingly.
EGit plugin's Quick Diff does exactly the same as netbans modified lines feature.
http://wiki.eclipse.org/EGit/User_Guide/State
There are at least two things you must do to get revision-based change highlighting (i.e., ones that do not disappear when the file is saved) to show up in Eclipse's "overview ruler" when using Git:
Prior to import, make sure that Preferences > Team > Git > Projects > Automatically Share project that are located inside Git repositories is checked or import the project into your workspace using Import... > Git > Projects from Git (as pointed out by #cornelius in a comment on another answer)
Enable Quick Diff and select "A Git Revision" as the reference source: Preferences > Editors > Text Editors > Quick Diff
In eclipse too you will get the line highlighted which is changed util you save the file.
and highlight is nothing but the change in color at the left panel of the editor before the start of that changed line.