News for hackers. Stuff that matters.
Re:The Rise of Microsoft Visual Studio Code by hprotagonist on Thursday December 06, 2018 @01:27PM (#18620661)
There are some warts, but it seems nice from afar. The biggest wart is/was the "FUCK FUCK FUCK" git clean vs git reset UX error: https://github.com/microsoft/vscode/issues/32405 . This is a fantastic demonstration of why i exclusively use git from a command prompt -- i know what will happen and nobody's going to reinvent terms to put on buttons that just confuse me.

In my life:

- I'm committed to emacs for org-mode and LaTeX editing and daily use.

- I paid for sublime so i will use it -- and multiple cursors everywhere is a boon for quick and dirty data munging.

- I write serious python code in pycharm.

- I write serious c# in full blown Visual Studio

Re:The Rise of Microsoft Visual Studio Code by kbd on Thursday December 06, 2018 @01:46PM (#18620833)
> This is a fantastic demonstration of why i exclusively use git from a command prompt...

Thanks for this. I've always felt the same way but haven't been able to put my finger on why. As more things get integrated into my editor (I use VSCode) I feel like I should use the shiny features, but for source control I think I'm going to only use the commandline forever. (Edit: though plugins such as GitLens that give you source control info inline are fantastic.)

Along with some nice features I've added, such as my 'git af' (add + fzf) shortcut[1][2], the commandline is very usable (don't have to 'git add' and type filenames manually).

[1] https://github.com/kbd/setup/blob/65b3d0abcb34540b43880792e8...

[2] https://github.com/kbd/setup/blob/65b3d0abcb34540b43880792e8...

Re:The Rise of Microsoft Visual Studio Code by pstadler on Thursday December 06, 2018 @02:43PM (#18621349)
Same here w/o fancy tooling around Git, but a couple of aliases.

I will refuse to use any Git tools or UIs, but the standard CLI, until the end of my career.

Besides that, my IDE/Editor is neither a build tool manager nor should it run my app from within an integrated console having specific settings. The projects people are going to inherit from me will always be editor-agnostic, the environment they run in will never depend on a certain setup that can‘t be documented clearly and they will always run within an isolated context, i.e. the project root.

Re:The Rise of Microsoft Visual Studio Code by ascagnel_ on Friday December 07, 2018 @08:26AM (#18627429)
I agree on part of that -- VSCode has a pretty good Node debugger, and you can run it with a listen hook (and therefore set it to run via a npm/yarn package.json script). Similarly, I feel like it's OK for an editor to run a script from the app in an integrated terminal, as long as that script is still accessible from a standard CLI.

Git is complex enough that I don't trust more complex operations (basically anything beyond push, pull, add, and checkout) to be handled by a GUI, but a GUI can make for a great code review tool.

Re:The Rise of Microsoft Visual Studio Code by idontpost on Thursday December 06, 2018 @04:29PM (#18622442)
God bless you.
Re:The Rise of Microsoft Visual Studio Code by sdegutis on Thursday December 06, 2018 @03:08PM (#18621634)
Yesterday I came across a screencast I made in 2009 back when Xcode had separate windows for the console and the editor[8], and Interface Builder was a completely separate program external to Xcode. One of the things that stuck out to me was the silly "SCM" option in the NSOutlineView on the left side[2], which I had absolutely never touched. And I remembered from my more recent experiences using Xcode that its git integration is not very useful and overly simplistic.

So I started wondering why Apple would even want to add such a useless feature into an otherwise really powerful and useful editor, even back then in Xcode 3. And I imagined this scenario where they were brainstorming and someone higher up in the Xcode team was like "ok guys, I got word from above that 'source code' is becoming a big thing now, and we need to add it somewhere" and someone was like "how about the project navigation list?" and someone else maybe piped up "but it doesn't really fit hierarchically in the metaphor" and someone else was like "dude it's 4:30pm some of us have families to get back to can we just forget about the metaphorical inconsistencies?" and they just added it as an expandable item.

I use Xcode and VS Code ever day, and I absolutely never use the Git functionality in either of them. I tried both for a few weeks each, but absolutely nothing compares to Magit[4]. Not even command line. For git, Magit is the same secret weapon that pg claimed Lisp was for programming.

[2] https://i.imgur.com/DYJN12N.png

[4] https://magit.vc

[8] https://i.imgur.com/lXcGpDh.jpg

Re:The Rise of Microsoft Visual Studio Code by Drdrdrq on Thursday December 06, 2018 @04:24PM (#18622390)
> don't have to 'git add' and type filenames manually

Another option is git add -p, which asks you about each change so you can review them once more and maybe leave some (parts of) them for future commits.

Re:The Rise of Microsoft Visual Studio Code by kbd on Thursday December 06, 2018 @04:40PM (#18622538)
Yep I have a 'git ap' alias set up for that :)
Re:The Rise of Microsoft Visual Studio Code by btashton on Thursday December 06, 2018 @04:20PM (#18622347)
I also very much related to this, the two exceptions I find awkward from the command line are: * Doing partial adds with `git add -p`. I see the hunk it presents see what I want from it, but then sometimes have to go through several iterations of splitting, skipping etc.. A visual tool (even like the tool in vim-fugitive) is a huge improvement. At the end of the day I'm still looking at the staged diff before committing * Looking at diff or blame logs. Once again these are super low risk for unexpected behavior, and for larger changes that span multiple files, I find the shiny editor features make it easy to see the context quickly.
Re:The Rise of Microsoft Visual Studio Code by akavel on Thursday December 06, 2018 @06:36PM (#18623621)
There's a somewhat hidden gem in vanilla git which can be sometimes useful:

    git gui
You can right-click on some line in the file and select "Stage Hunk for commit", etc. instead of `git add -p`. It can be also helpful for browsing history, esp. "blame digging".
Re:The Rise of Microsoft Visual Studio Code by btashton on Sunday December 09, 2018 @09:30PM (#18644765)
Interesting I did not know about that. Seems like it is part of the git suite, but usually packed separately (Fedora it is the git-gui package) and requires gitk.
Re:The Rise of Microsoft Visual Studio Code by lgunsch on Friday December 07, 2018 @12:03PM (#18629315)
I love git gui. I've used it for more than 5 years now. Has an ugly UI, but it's very functional and complete.
Re:The Rise of Microsoft Visual Studio Code by Shorel on Friday December 07, 2018 @04:46PM (#18632001)
Even if I use git exclusively in the command prompt, I usually have a working copy where I edit files, and another copy that's read only where I switch branches without care, do the binary search bisect thing and so on.

I don't remember what happened for me to start doing this, but it saves so many headaches that I don't care.

All the graphic Git clients cause me panic. I have Sublime-Merge has a read only thing, because it shows diffs in a nice format. But I am still not ready to commit something from it.

Re:The Rise of Microsoft Visual Studio Code by aaaaaaaaaab on Thursday December 06, 2018 @05:48PM (#18623223)
Hint:

    git add -i
Re:The Rise of Microsoft Visual Studio Code by allannienhuis on Friday December 07, 2018 @12:41AM (#18625406)
I use

    git commit -a
a lot - it's most often the exact thing I want to do, with the exception of adding new files.
Re:The Rise of Microsoft Visual Studio Code by kbd on Thursday December 06, 2018 @05:53PM (#18623261)
That is not close to the same thing.
Re:The Rise of Microsoft Visual Studio Code by ddavis on Thursday December 06, 2018 @02:57PM (#18621517)
Since you're an Emacs user... just wanted to plug magit - it might make you change your mind about command-prompt-only git usage
Re:The Rise of Microsoft Visual Studio Code by wry_discontent on Thursday December 06, 2018 @03:12PM (#18621677)
I use Emacs mostly for magit.
Re:The Rise of Microsoft Visual Studio Code by Zaheer on Thursday December 06, 2018 @04:14PM (#18622301)
Re:The Rise of Microsoft Visual Studio Code by markrages on Thursday December 06, 2018 @10:21PM (#18624889)
and emacs of course. https://youtu.be/jNa3axo40qM
Re:The Rise of Microsoft Visual Studio Code by matwood on Thursday December 06, 2018 @02:29PM (#18621235)
> This is a fantastic demonstration of why i exclusively use git from a command prompt -- i know what will happen and nobody's going to reinvent terms to put on buttons that just confuse me.

This many times. I'll open SourceTree to view a large set of diffs or changes, but still drop back to the CLI to push/pull/rebase/commit/stash/etc... I know what git will do in those cases, and am a little wary of git UIs.

Re:The Rise of Microsoft Visual Studio Code by bayindirh on Thursday December 06, 2018 @02:52PM (#18621459)
Actually Eclipse's git UI is very practical. I use it whenever I'm developing somehting in Eclipse, however I still command line as much for other reasons.

OTOH, I despise heavily modified bash/zsh/whatever profiles which makes the environment non-portable. Extreme eye-candy in the console makes stuff harder for devs/admins who logs in to thousands of servers.

Re:The Rise of Microsoft Visual Studio Code by anilakar on Friday December 07, 2018 @03:10AM (#18625923)
> I paid for sublime so i will use it

I purchased Sublime when it was the least bad editor out there, but finally realized that I was suffering from the sunk cost fallacy. I still consider it the worst software purchase I've ever made, and it's also why I'm reluctant to pay a single buck for software nowadays.

Re:The Rise of Microsoft Visual Studio Code by giancarlostoro on Friday December 07, 2018 @07:12AM (#18626994)
I mean I use VS Code a lot more often, and PyCharm / JetBrains IDES moreso than I do Sublime Text but I wouldn't say it's the worst purchase. I bought a text editor that's got out of the box syntax highlighting for most languages and decent enough linting plugins to catch some of the syntax errors I may be about to miss.

I only wish Sublime Text were able to (out of the box) mount / SSH into any server like emacs does (using TRAMP). I'm finding myself using VIM lately mostly because it's a step up from nano which uses tabs, not sure how to tell it how to space things, nano is perfect for Go I suppose. I have to figure out how to configure VIM for spacing things properly though, but I mostly install Sublime Text on VM's I write code in.

Re:The Rise of Microsoft Visual Studio Code by anilakar on Friday December 07, 2018 @08:42AM (#18627534)
I originally had two reasons why I bought Sublime. The primary one was that it felt like Vim with everything configured out of the box. Another reason was that ST2 had long outstanding bugs that were already fixed in the ST3 development version, which was made available to paying customers only, and it felt like a good idea to support the development.

Then came 2014 and it started to look like the Sublime developer had taken a hiatus. The timing was really bad as ST2 still had showstopper issues (for me) that were fixed in ST3, which in turn had another bunch of unfixed bugs. Meanwhile Atom was released and it got its bug fixes and new features regularly, even though it was and still is really slow. I had to choose between two borderline unusable and one functioning but heavy editor. With a heavy heart I had to abandon an editor that I had valued at 70 dollars, which at that time was also the largest sum I had ever paid for software.

As soon as VS Code started to gain traction, I made the switch. For some reason it felt and still feels much snappier, even though both Atom and it are built on Electron and have approximately the same features.

When not writing code or LaTeX documents, I'm editor and OS agnostic. Often you just have to make do with whatever an esoteric system offers.

Re:The Rise of Microsoft Visual Studio Code by giancarlostoro on Friday December 07, 2018 @08:45AM (#18627551)
> When not writing code or LaTeX documents, I'm editor and OS agnostic. Often you just have to make do with whatever an esoteric system offers.

If only more were sanely tech agnostic. I feel the same way, I try to use JetBrains tools if possible, if low on memory, then Sublime, VIM or Emacs (Somewhat Nano / ne) work for me.

Re:The Rise of Microsoft Visual Studio Code by thecopy on Friday December 07, 2018 @03:24AM (#18625961)
Why do you think Sublime Text is the worst software you have purchased? I use it every day as my main text editor and i am very satisfied.
Re:The Rise of Microsoft Visual Studio Code by anilakar on Friday December 07, 2018 @08:45AM (#18627547)
See the reply to the sibling post.

In any case, what works for you might not work for other people. We're also talking about four–five years old issues here.

Re:The Rise of Microsoft Visual Studio Code by 21 on Thursday December 06, 2018 @02:42PM (#18621329)
> I paid for sublime so i will use it -- and multiple cursors everywhere is a boon for quick and dirty data munging

These days pretty much every serious editor has multiple cursors, including Visual Studio Code.

Re:The Rise of Microsoft Visual Studio Code by zwieback on Thursday December 06, 2018 @02:46PM (#18621379)
had to look up "multiple cursors" and it looks like it's the same as "column mode" which has been around in MS editors forever?
Re:The Rise of Microsoft Visual Studio Code by negativegate on Thursday December 06, 2018 @03:04PM (#18621603)
It's not column mode in Visual Studio Code https://code.visualstudio.com/docs/editor/codebasics#_multip...
Re:The Rise of Microsoft Visual Studio Code by zwieback on Friday December 07, 2018 @09:27AM (#18627891)
Indeed, I've been missing out!
Re:The Rise of Microsoft Visual Studio Code by pmarreck on Thursday December 06, 2018 @05:09PM (#18622831)
dude. you have been missing out.
Re:The Rise of Microsoft Visual Studio Code by bassman9000 on Thursday December 06, 2018 @01:41PM (#18620787)
amen

people look at me like I'm an old crazy dude because I don't use a git UI or eclipse, or intellij, or from sublime. Git already has plenty of quirks, adding another layer of unknown on top of it is a no-go

Re:The Rise of Microsoft Visual Studio Code by emerongi on Thursday December 06, 2018 @03:02PM (#18621578)
I've started using VSCode for git push/pull/branch and staging. This is what I use git for 99% of the time anyways and since they are simple commands, triggering them from VSCode is faster than falling back to CLI.

Staging/diffing is especially convenient with VSCode. `git add -p` used to be my most-used command, but VSCode just makes the process easier.

Re:The Rise of Microsoft Visual Studio Code by gknoy on Thursday December 06, 2018 @05:41PM (#18623174)
If you stage things often enough, `git add -u` might be enough. It's pretty much what I use all the time, aside from the few times I do `git add -up`.
Re:The Rise of Microsoft Visual Studio Code by kstrauser on Thursday December 06, 2018 @03:35PM (#18621930)
My most famous quote in my work Slack is: "git already has a luxurious client! it’s called git and has lots of shinies."
Re:The Rise of Microsoft Visual Studio Code by CuriouslyC on Thursday December 06, 2018 @05:11PM (#18622842)
While I agree with this in most cases, visual merge is a huge deal.
Re:The Rise of Microsoft Visual Studio Code by freeone3000 on Friday December 07, 2018 @04:02AM (#18626100)
git mergetool will spawn the mergetool of your choice, anything from kdiff3 to vimdiff.
Re:The Rise of Microsoft Visual Studio Code by freehunter on Thursday December 06, 2018 @02:45PM (#18621370)
Which is weird because with all of its inconsistencies, git must have been designed with the idea that someone would build a sensible shell over top of it. I can't imagine Linus expected people to interact directly with git when he built it.
Re:The Rise of Microsoft Visual Studio Code by bassman9000 on Thursday December 06, 2018 @03:39PM (#18621962)
git has its problems, but it's a consistent, centralized (in the sense of origin/repo), well known set of problems.

I use multiple IDEs/editors, and they all handle git differently. It doesn't make sense to learn yet another N sets of quirks.

Re:The Rise of Microsoft Visual Studio Code by Drdrdrq on Thursday December 06, 2018 @04:39PM (#18622529)
> git has its problems, but it's a consistent, centralized (in the sense of origin/repo), well known set of problems.

Consistent? Ha! Change branch: git checkout my-branch. Reset file to committed version: git checkout -- my-file. Git is many things, but consistent it is not.

That said, I still use CLI precisely because I don't trust other software to make sensible abstractions on top of it, given that foundation is so inconsistent. Besides, those CI scripts only know git cli...

Re:The Rise of Microsoft Visual Studio Code by bassman9000 on Thursday December 06, 2018 @09:15PM (#18624565)
> Consistent? Ha! Change branch: git checkout my-branch. Reset file to committed version: git checkout -- my-file. Git is many things, but consistent it is not.

> well known set of problems

that's precisely the well know set of problems. You learn them once, apply on every console. If each UI decides to overcome them differently, you end up with N+1 different behaviors.

I'd rather have only one set if inconsistent commands, than 3.

edit:formatting

Re:The Rise of Microsoft Visual Studio Code by umanwizard on Thursday December 06, 2018 @05:06PM (#18622804)
Consistent in time. Those warts haven't changed much in the 7 or 8 years that I've been using git.
Re:The Rise of Microsoft Visual Studio Code by bgruber on Thursday December 06, 2018 @09:10PM (#18624531)
Re:The Rise of Microsoft Visual Studio Code by voltagex_ on Thursday December 06, 2018 @09:49PM (#18624721)
OT: that's a blast from the past - http://www.gelato.unsw.edu.au/
Re:The Rise of Microsoft Visual Studio Code by dagw on Friday December 07, 2018 @04:10AM (#18626147)
Heh. As an "old dude" I'd assume that anybody using git directly would be a "young dude" who's been using git all their programming life.
Re:The Rise of Microsoft Visual Studio Code by sireat on Friday December 07, 2018 @03:28AM (#18625977)
I managed to commit node_modules folder to github using VS Code git integration. Luckily it was on a smaller test project. My fault but there was a UI failure.

All I did was press Commit which apparently decided to stage and commit everything under the root folder.

It didn't do this in other projects so who knows what was different.

This is how credential files must get committed to github every day.

If VS Code is going to be smart about so many other things, then there should be some sort of warning for major code affecting changes.

You are about to push 5000 files to master repo inluding some that appear to be widely used libraries, are you sure that is what you want ?

Re:The Rise of Microsoft Visual Studio Code by GordonS on Friday December 07, 2018 @06:25PM (#18632613)
> All I did was press Commit which apparently decided to stage and commit everything under the root folder

If you don't have anything staged and hit Commit, it will show a prompt asking if you want to commit everything that's been changed. It sounds like you hit 'yes' on this prompt by mistake.

Re:The Rise of Microsoft Visual Studio Code by _coveredInBees on Thursday December 06, 2018 @09:28PM (#18624625)
To each their own. I've used CLI git only for a decent amount of time but VSCode's git diff view is fantastic and effortless to use. Their interface for staging files and making commits is excellent and combined with the ease of viewing local changes, it makes it very easy to ensure that commit messages are well documented and accurate. Same goes for handling merge conflicts.

I still use the CLI to push/pull/branch/merge, etc just to have total control, but staging files, viewing diffs and making commits are a lot more annoying in the CLI.

Re:The Rise of Microsoft Visual Studio Code by starik36 on Thursday December 06, 2018 @09:47PM (#18624710)
> fantastic demonstration of why i exclusively use git from a command prompt

What's described in that github issue happened to me as well the first time I used git via Visual Studio. I normally don't do that, but something told me to make a zip of everything before using git in VS. So that saved me big time.

Why in the world are the deletions not pointed to the Recycle Bin??? That's what it's there for.

Re:The Rise of Microsoft Visual Studio Code by Sacho on Friday December 07, 2018 @02:07AM (#18625694)
The deletions are made through git, and windows git does not use the recycle bin, presumably because it's a linux-first tool
Re:The Rise of Microsoft Visual Studio Code by jhasse on Friday December 07, 2018 @03:29AM (#18625986)
It doesn't use the recycle bin on Linux either.
Re:The Rise of Microsoft Visual Studio Code by smbullet on Friday December 07, 2018 @01:17AM (#18625547)
Agreed, it's sort of surreal that nobody in any of the issue threads admitted that was a good solution.
Re:The Rise of Microsoft Visual Studio Code by overgard on Friday December 07, 2018 @02:02AM (#18625680)
It’s not a good solution at all; it makes no sense in the context of source control because the repository IS the undo button, and copying discarded changes to the recycle bin would just add a lot of incoherent duplication into the recycle bin for no reason. Not to mention that’s not how git works, so it’d have to be added as a git extension, and you’d end up with people who actually know how their source control tools work feeling confused and annoyed that their editor is changing how their familiar tools work.

I mean, if you point software you don’t understand at work that’s not backed up you shouldn’t be shocked if it does something you don’t like

Re:The Rise of Microsoft Visual Studio Code by pmarreck on Thursday December 06, 2018 @05:09PM (#18622827)
> and multiple cursors everywhere is a boon for quick and dirty data munging.

VSCode has this. Hold down Command on Macs (probably Ctrl on Windows/Linux) and click. You can also select "next similar word" with command-D so you can quickly change all instances of a word to another word.

Re:The Rise of Microsoft Visual Studio Code by _coveredInBees on Thursday December 06, 2018 @09:24PM (#18624610)
Ctrl+Shift+L will select all instances of the highlighted term in one shot. Ctrl+D , as you mentioned, is useful for progressively selecting the highlighted phrase within the file.
Re:The Rise of Microsoft Visual Studio Code by pmarreck on Sunday December 09, 2018 @05:16PM (#18643650)
Awesome, TIL about Ctrl-Shift-L!
Re:The Rise of Microsoft Visual Studio Code by SomeHacker44 on Friday December 07, 2018 @08:19AM (#18627388)
I am much the same. I have stickers for IntelliJ (as a stand in for all JetBrains IDEs), Emacs and Vim on my laptop because each has a different use case and preferred language. I even have Atom, Sublime and others installed and use them on rare occasions when they have plugins that are useful for a task at hand.

I also exclusively use the command line for source control (of which I use at least four, but mostly git and hg). I just do not trust IDEs to do the right thing, although JetBrains does get close (but my colleague devs hate the properly pruned .idea in the repos).

Re:The Rise of Microsoft Visual Studio Code by rjbwork on Friday December 07, 2018 @03:53AM (#18626080)
I use TortoiseHg for Hg. Source Tree for git (though I honestly don't like it very much, and often use hg-git to just work with git from TortoiseHg). Sublime for text editing; and agreed on the multiple cursors and great regexing - fantastic for quick and dirty munging indeed. I use VS for writing C#, creating SQL databases, and a myriad of other functions that would take too long to get into. LinqPad for quick experiments or writing up some quick scripts I need to run rarely.
Re:The Rise of Microsoft Visual Studio Code by bdcravens on Thursday December 06, 2018 @01:45PM (#18620828)
I've had best results decoupling my tools, so I use a separate git client (in my case, Git Tower). You can also add things like database clients to VSC, but similarly I use Datagrip etc.
Re:The Rise of Microsoft Visual Studio Code by dlhavema on Thursday December 06, 2018 @10:02PM (#18624788)
I do command line git as well because I am bouncing between IDEs and dont want to learn the differences in little features of each IDEs source control ui.
Re:The Rise of Microsoft Visual Studio Code by omaranto on Friday December 07, 2018 @04:19AM (#18626186)
Since you mention both using git directly from the command line and Emacs, have you tried magit?
Re:The Rise of Microsoft Visual Studio Code by bishala on Sunday December 09, 2018 @02:34AM (#18639839)
multi cursor is pretty much a basic feature in all modern text editors these days.