VSCode 1.71.2 source control on Ubuntu22.04 misses some items - version-control

On windows with the vscode 1.71.2, it shows a lot of items such as Source Control Repositories and Source Control, File History, Line History, Stash, Branches, Tags. Then I can enable the item I need.
On Ubuntu22.04 vscode, click ... on the right side of SOURCE CONTROL, it just shows two items: Source Control Repositories and Source Control refer to attached pic. Then I have no way to access Stash, Branch now.

Related

Is it possible to show each repository in the Source Control sidebar as 2 lines in VS Code?

I have a lot of repos open in my VS Code project and when looking at these in the Source Control sidebar, it's hard seeing which is which without resizing the sidebar.
Before I open a feature request, I thought I'd ask here.
Is there any way to get it to show each repository on 2 lines instead of having just a single heading with all the info and buttons on it.
So for instance, instead of having this:
<RepoName> <Branch> Sync, Commit Graph, Commit, PR, Refresh
See: https://i.stack.imgur.com/EyiIi.png
I'd prefer it to be like this:
<RepoName>
<Branch>, Sync, Commit Graph, Commit, PR, Refresh
See: https://i.stack.imgur.com/yI3BS.png
Thanks!

Linking to a line of code in a particular version of a file in Azure DevOps (VSTS)

I want to link to a line of code in such a way that the link will continue to work even when the file is updated in future commits.
In Github I would do this by pressing 'y' to move to a version of the page that includes the blob SHA:
https://github.com/rails/rails/blob/b49e38b76b0998b0a8312d8c08c98728d3de2006/activerecord/lib/arel/attributes/attribute.rb#L30
(Alternatively GitHub has a 'copy permalink' option in the '...' menu that appears in the margin when you select a line - documented here.)
Is there an equivalent in Azure DevOps?
The link that I get when I select a line has the form:
https://.../_git/project?path=XXXX&version=GBmaster&line=426&lineStyle=plain&lineEnd=427&lineStartColumn=1&lineEndColumn=1
Lots of parameters defining the selection but nothing pinning the file version.
Edit:
The below illustrations can be summarized in a few keyboard shortcuts.
Open the repo Files view using the 'e' global shortcut
Use 't' to put focus on the path selection to quickly navigate to the file in question
point 2 and 3 are order agnostic in relation to one another
Use 'y' to change the Files view to be based on the latest commit instead of on the branch
Make selection
Copy link as shown in illustration below
Browse files on the commit
Make sure you're browsing the entire source for the commit. Selecting lines when viewing the commit itself (ie AzDOs fancy git show) is for adding comments to the commit, but it doesn't help produce a link to the line # that version, nor is there a way (at least not that I could find) to get a link to the comment made on the line. Getting a link to a comment on a line in a commit might have been helpful to provide additional direct context to what is linked and why, but that's also not what you asked for.
don't click on the commit itself
make sure you're browsing all files as of a commit (not a branch)
Make selection
You should be able to select a line in the file contents and get a link to that line(s) in that version.
note: the link produced here is even more lengthy than the one you provided in your question.
Joy
When you navigate to the copied link, you will be directed to the commit and file contents with the line highlighted.
Understand, this link is bound to the commit you used to create it not to the tip of the branch. I expect this was how links are surfaced to be more sure that the link wouldn't break or lose context as the commit at the tip of the branch changes over time.
Thank you #JoshGust. For anyone else who wants the abbreviated version:
Files -->
(your repo branch) -->
History -->
Click A Commit hash/number (Latest/Head usually) -->
Browse Files -->
Your file -->
Select text & get a link.
Sheesh... quite some hoops to jump through, but glad it's possible.
To create a web (repository) link to a specific line from within your IDE, there are extensions with options to link to files, selections, to a branch or to a specific commit.
I am using these ones:
Editor
Plugin
Visual Studio Code
Git Web Links for VS Code
Visual Studio 2022
Git Web Links

Eclipse / EGit to see previous version of a file (Git)

Is it possible in EGit to see the simple history of a file?
Team > Show in history shows all commits to all files. Not useful.
I am looking for the history of a file. There is a button in the History view that says Show changes to selected resource but no way to select a resource.
There also does not appear to be any way to compare with a specific version unless that version has a tag.
The pieces seem to be there, but are they put together properly?
(No complex branching or other cleverness. I normally use the command line for this type of work but should not have to.)
You can open a file (or select it from project explorer) and do:
Right Click -> Team -> Show in history. This will open the following view:
The filter circled in red is: "Show all changes of selected resource and its children" which basically will filter only the commits that relate in any way to the resource you've selected (you can chose the different filters to get a better understanding of how they differ from each other).
The problem was that the Team > Show in History needs to be run from the Project Explorer window. When I first found those scoping buttons I right clicked on the class file's edit window and did the Team > Show in History there. That appears to be broken and only shows all changes.
(Thank you for your replies. Knowing that it could be done and by those scope buttons let me look further. I rarely use the Project Explorer, preferring to just type the class/file name into the Navigate dialog.)
Some other answers suggest clicking on Team > Show in History. This menu item does not show up. Instead, Team > Show Local History shows up.
I have Git Staging tab open all the time. I saved a small change to the file I wanted to see the history of. This caused the file to show up in the Unstaged Changes in Git Staging. I then right-clicked on the file, clicked on Show In and then History. This showed me the history of the file according to Git.

Is it possible to see full ('remote') history when using MercurialEclipse plugin?

I'm using MercurialEclipse 2.1.0 (looks like latest) with Eclipse Indigo.
I can't seem to find a way to see the entire history of a file as available in remote 'central' repository (e.g. like it works with SVN) -- the history only seems to show up to the revision that I currently have in the workspace (in other words in e.g. Synchronize view (in workspace mode) I can see that there are 'incoming' changes in file but 'Show History' wouldn't show me anything about these changes).
Even if I 'Pull' (without 'Update') and check file history it still seems to stop at the current revision.
Anything I can do?
Is there any way
With MercurialEclipse the Synchronize view works best with the "Mercurial Changesets" model. Switching to that will show all of the incoming changesets (be sure the "All branches" button is pressed).
For the 2nd item, having pulled all the changesets, you can see all history if you press the up arrow button in the history view once. This will show all history for the folder that contains the file.

What is the proper way to do a Subversion merge in Eclipse?

I'm pretty used to how to do CVS merges in Eclipse, and I'm otherwise happy with the way that both Subclipse and Subversive work with the SVN repository, but I'm not quite sure how to do merges properly.
When I do a merge, it seems to want to stick the merged files in a seperate directory in my project rather than overwriting the old files that are to be replaced in the merge, as I am used to in CVS.
The question is not particular to either Subclipse or Subversive.
Thanks for the help!
Merging an entire branch into trunk
Inspect the Branch project history to determine the version from which the branch was taken
by default Eclipse Team "History" only shows the past 25 revisions so you will have to click the button in that view labeled "Show All"
when you say "Show All" it will take you back past the branch date and show you all the history for trunk as well so you'll have to search for your comment where you branched
NOTE: if you use Tortise SVN for this same task (navigate to the branch and select "Show Log") it will show you only the branch history so you can tell exactly where the branch began
So now I know that 82517 was the first version ID of the branch history. So all versions of the branch past 82517 have changes that I want to merge into trunk
Now go to the "trunk" project in your Eclipse workspace and select "right click - Team - Merge"
The default view is the 1 url merge
select the URL of the branch from which you are merging
under Revisions select "All"
press OK
This will take you to the "Team Synchronizing" perspective (if it doesn't you should go there yourself) in order to resolve conflicts (see below)
Re-Merging more branch changes into trunk
Insepct the trunk project history to determine the last time you merged into trunk (you should have commented this)
for the sake of argument let's say this version was 82517
So now I know that any version greater than 82517 in the branch needs to be merged into trunk
Now go to the "trunk" project in your Eclipse workspace and select "right click - Team - Merge"
The default view is the 1 url merge
select the URL of the branch from which you are merging
under Revisions select "Revisions" radio button and click "Browse"
this will open up a list of the latest 25 branch revisions
select all the revisions with a number greater than 82517
press OK (you should see the revision list in the input field beside the radio button)
press OK
This will take you to the "Team Synchronizing" perspective (if it doesn't you should go there yourself) in order to resolve conflicts (see below)
Resolving Conflicts
You should be at the "Team Synchronizing" perspective. This will look like any regular synchronization for commit purposes where you see files that are new and files that have conflicts.
For every file where you see a conflict choose "right click - Edit Conflicts" (do not double click the file, it will bring up the commit diff version tool, this is VERY different)
if you see stuff like "<<<<<<< .working" or ">>>>>>> .merge-right.r84513" then you are in the wrong editing mode
once you have resolved all the conflicts in that file, tell the file to "mark as merged"
once all the files are free of conflicts you can then synchronize your Eclipse project and commit the files to SVN
I typically check out both branches and then use the compare to each other option which does a synchronize-like compare of the two source trees. After integrating the changes into one branch, you can recommit back to the repository.
Use Eclipse integration, it works perfectly fine.
The main change from CVS, is that you only merge deltas from a branch, ie changes from one revision to another.
That is to say you have to track the correct start revision somehow (unless you have svn 1.5 merge history)
If you got that right, it's only up to you to get the changes right with the compare editor.
Firstly, if you are seeing ">>>>>" and such in your files when you view them in Eclipse, this probably means that you are not looking at the file with the proper compare editor. Try right-clicking on the file in the Project view or Synchronize view and selecting "Edit Conflicts" to bring up a compare editor that will show you the conflicting regions graphically rather than as text. Note that the compare editor that comes up for "Edit Conflicts" is different from the one that you get when you just doubleclick on a file in the Synchronize view -- the doublieclick compare editor shows the differences between your current file and the way it existed when you last checked it out or updated it, while the Edit Conflicts compare dialog shows the differences between two sources of changes (for instance, the changes you merged versus the changes that existed in your workspace before you merged).
Secondly, you may wish to be aware of a bug in some versions of the Eclipse subversive plugin which causes all files that accepted merge changes to be incorrectly marked as having conflicts. This bug has been fixed, but a lot of people don't seem to have updated to get the fix yet. Further details here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=312585
Remember that with svn reverting a modified tree to a clean state is fairly easy. Simply have a clean workspace on the merge destination branch and run the merge command to import the modifications from the merge source branch, then synchronize your workspace and you will get your usual eclipse comparison window showing all the merge modified files and the conflicts.
If for some reason you can't solve the conflicts you can svn revert on the project and go back to a clean state, otherwise you do the merge in place and once you are done you can commit. Note that you don't have to commit, once you are done handling the conflicts you can also return to the dev view, verify that the code compiles, run your unit tests, whatever and then synchronize again and commit (once the conflict are locally resolved they won't come back)
last time I looked, when you use subclipse merge command it will overwrite the merged file (using conflict markers to show conflicting areas) and put the original left and right side of the merge in the same place. it shouldn't put anything in different directories.
As a rule of thumb, it is best to commit all merge modifications in a single commit and to only have the merge modifications in the commit so that you can rollback the merge later if needed.
openCollabNet's merge tool for subclipse is pretty neat. There are many merging types available and the merging I just performed with it when seamlessly. I recommend it.
The one thing that syncrhonize view in eclipse lacks is check-in capability. In Team synchronization view I can view all my changes and resolve conflicts, so it would be rather intuitive to check-in right there instead of going back to java view and do check-in.
I would advise not trying to use Eclipse's plugins as your primary access to Subversion.
If you are developing on Windows, TortoiseSVN is the best program that I have seen for Subversion access. Explore to the directory of which you wish to merge, right click on it and use the Tortoise SVN merge option. Assuming a non-interactive merge, once you get conflicts, you'll have to go through each conflicted file and edit the conflicts before marking them as resolved. For this process I recommend a program called KDiff3, which shows your local repository copy (what was stored in the .svn before the merge), your local copy (including any changes), and the copy coming from the repository, and allows you to easily see (and even hand-modify if needed) the result of the merging. It also handles a bunch of minor conflicts automatically.
KDiff3 is portable, TortoiseSVN is a windows shell extension, so if you're using another environment, I would try to just use SVN to merge. But that would be much more of a pain :)
I landed here because I was looking for a way to merge in an external merge editor (KDIFF3) but start the merge from eclipse. I wasn't satisfied with the answers provided above. So here is ho to configure kdiff3 as merge and diff editor for SVN in eclipse:
go to Windows -> Preferences → Team -> SVN -> Diff Viewer
Add a new config (add button):
Extension or mimetype: * - if you wish you can specify different mimetypes for different editors, I didn't need that thus the alquantor.
Diff:
Program path C:\Program Files\KDiff3\kdiff3.exe (or wherever you have your merge editor - sry for the windows path, feel free to add a linux version in the comments or edit this answer.)
Arguments:
${base} ${mine} ${theirs}
Merge:
Program path C:\Program Files\KDiff3\kdiff3.exe
Arguments:
${base} ${mine} ${theirs} -o ${merged}
This will probably work as well for other merge editors, but with a different argument syntax (figure it out an let us know :) ).
The usage is as usual (team->edit conflicts) for merging and compare->foo for the diff view.
Cheers