Utilizing Console Interfaces for Hg, SVN or git - version-control

I've been spending a lot of time utilizing Mercurial. On windows, I've been using TortoiseHg and on Linux and Mac OS X, I've been (forced) to use the console interface.
After spending time with the console utilities, I find (to my surprise) that I do like them.
But, most of my usage has been superficial. I've been doing basic clones, pulls and merges with the rare but occasional commit. I've not done any heavy lifting with it.
What I'm curious about is if regular users use the console interface of tools like Mercurial, SVN and/or git for real world, day-to-day development? Until now, I've never given the console program of SVN much thought -- I've always used TortoiseSVN.
I realize that there is no real answer to this question (Hence, it's community wiki) but I thought other real-world insight would be beneficial. If others have successfully used these console programs, perhaps it's worth using them more.
So, do you use the console programs on a regular day-to-day basis or do you only use them when you need to?
Note: I do realize that people use the console programs. It is ridiculous to think they are not used. This question is focused on day-to-day use for average developers for average development. Average being that you generally use GUI interfaces and/or you are developing GUI applications.

I develop primary on OS X, frequently on Linux, and occasionally on Windows. The only place I don't use the console utilities is in Windows, where I'm not as familiar (and thus not as productive) with the console. On OS X and Linux, I exclusively use the command-line utilities for Git, Mercurial, and Subversion. I find the command-line utilities to be more powerful (especially in the case of Git), and I feel more "at home" with them.
I do use gitk and GitX (a gitk-like program for OS X) to visualize Git histories, but that's the only GUI tool I use.

I use the svn binary regularly on Unix, doing "svn up", "svn diff", "svn commit", "svn ann", and "svn log" most of the time. I prefer the command line, because I have a shell window open in the source anyway (to run builds and tests), and along with file name completion, using the keyboard is faster than using the mouse for me.

I use Mac and I love git to be used in command line.
I use the following utilities & tools to make productive & intuitive.
Git aware prompt to show the currently checkout branch all the time
Iterm2 as a replacement for the default Mac terminal
Meld as git diff & mergetool
Both Iterm2 & Meld can be installed via homebrew (brew cask install meld)
My terminal screen looks like:
Source Tree is a must have GUI tool if you don't love CLI so much.

Related

Elpy to allow pyenv to work on a project basis

I've used Emacs for all my coding projects so far. Soon I will start some python projects for the first time and would love to stick to Emacs for these as well.
I was looking into elpy which seems to provide already alot of desired functionality. The part I was not able to figure out completely is the following. I like to define virtual environments and python version to be used on a project basis. Let's say I start a project A, then I would use pyenv-virtualenv or pyenv-virtualenvwrapper to set it up
pyenv virtualenv 3.4.2 my-virtual-env-3.4.2
by doing this I've linked the python version 3.4.2 to that specific virtualenv / project. I have two questions regarding this in combination with elpy.
Question: This is a rather basic one. All the above can be achieved via the terminal. What is the advantage to emacs to support this? The workflow for me would be: Create project with associated virtualenv and python version. Activate virtualenv and start coding in emacs. If I need to install a package I will run pip in the terminal to ensure virtualenv is captured properly. There must be a reason why it's beneficial to support this in emacs. With my lack of knowledge I just don't see it :)
As pointed out there is for sure a good reason why we want emacs / elpy to support this. My second question would then be
**Question: How can I achieve this in emacs? Lokks like this blog has a solution. I was wondeirng if someone already tried this setup if it is a neat solution with makes sense conceptually. **
Well I strongly guess the goal is to use more features than just syntax highlighting: flycheck/flake8/linting, refactoring, elpy's test runner to use the right python version, install a pip package directly from emacs, stuff like this. You can carry on doing this in the terminal, but once you want an emacs feature, you'll need to set it up.
I found two modes to do that (see wikemacs python page and doubled-checked on melpa): pyenv-mode (in melpa) and pyenv-mode-auto (change the version when there is a .python-version file).

GitHub for website development

OK< I know I can use Eclipse for Java programming and such but I work using WAMP for editing PHP, XHTML, JavaScript files... what IDE is best to edit the files and use GitHub? Because I don't know want to go to localhost and then copy my files to my local GitHub repo...
Cloud9 IDE might be what you are looking for! It's an online IDE with out-of-the-box intergration with GitHub, heroku etc. and gives you the ability to share workspaces as well.
Eclipse has the egit plugin that is really nice. You can use aptana which is based around eclipse but includes all the web views. It can basically edit everything you mentioned and really well, while providing a nice wrapper for your git repos
http://aptana.org/products/studio3
http://eclipse.org/egit/
well is not an IDE but vim with some git plugins is the best for me.
Eclipse should have some git plugins also, I think.
The best way to learn git is yo use it from command line!
Emacs + tramp + the command line ?
Update: magit is reported to support tramp
Update:
My experience: I have a distant linux server running a rails app. and private git repositories / apache (using several VirtualHosts with or without ssl). That server runs a ssh server. I use bare ssh session for command line usage (git, nominal admin.) and emacs + tramp to remotely edit the files presents on that server. I you are not rebuked by anti-eye candies tools (as for not-at-all drag'n'drop stuff), I would suggest you to give emacs a try (see EmacsW32 and nXhtml if you are under Windows). I assume you can install a ssh server on your WAMP machine… If this is the case, you could open your file from emacs just by using the following syntax (assuming you would edit the /home/renaud/.bashrc on the distant server):
/ssh:user#obf.uscatedmachine.org:/home/user/.bashrc
With putty on windows: see that and this posts.
It works the same for directories. You shall be prompted for your password once, and then edit the file/directory as if it is just on your machine. For the git part, I have verified myself since I do the git stuff directly from a ssh terminal, but latest magit
is reported to support tramp (i.e. remote git plumbering from my understanding).
If you have never used emacs before, it will not be easy. You will have to learn emacs basics first and customize it to fit you needs. My opinion is that's worth to give it a try. I could help you with basic configuration if needed.
(I use myself emacs almost for everything on my linux box from simple text editing to Java programming.)
Update:
After some testing, magit works very well remotely (tested on linux)! A new mode added to my configuration thanks to your question!

(g)Vim with version control like Eclipse

I was an Eclipse user, now I have to use Vim in my machine.
I used to "compare" a file I edited with a CVS repository to do merges an commit the files, using a context menu and my mouse.
Is this possible in Vim? Opening a vimdiff for a file before commiting, and commit it from vim itself?
And how is that supposed to work?
I'm supposing I would be editing a file. Then, I want to see the modifications. I run vimdiff in gvim, and a new window (or buffer) is opened. I run the modifications, save what is applicable (using vimdiff commands), and commit running another command.
Is this all transparent in vim? Do I have to keep getting out of vim to my terminal, or can all be done inside it?
Do I need to use some plugins, or just really simple functions inside my vimrc?
There is a couple plugins to integrate VCS to vim.
I personnally use vcscommand. It does at least the 2 things you're asking for: comparing from repository using vimdiff and commiting from within vim.
I personally just switch between vim and the terminal.
Usually I'd have several console tabs open at the same time (if you're on windows, Console can do that).
It depends on the VCS used, but you can linked that VCS with vimdiff (see git, for instance)
You could also try and integrate directly Vim into your Eclipse session with eclim.
(should you still be using eclipse. If not, I leave the following for others)
It does support the Eclipse local History.

Using emacs across many hosts

On a daily basis I:
use multiple workstations running either Linux, Windows, or MacOS X
edit files on additional Linux hosts that are not any of the workstations mentioned above
The only common element here is that the internet connects all of these hosts: workstations and servers. I can keep all of the config files in sync on my workstations too and can run an X server on all of them. What's the right way of running emacs? I don't want to sacrifice any features.
In my ideal world I can type 'emacs foo.txt' on a remote host and some magic happens via X forwarding to display the file in my workstation's existing emacs session.
Non-solutions
tramp: when I'm manipulating a remote host an editor is just part of my workflow. I need a terminal open so I can run other commands quickly. tramp is all wrong for this.
ncurses emacs: sucks, I want the graphical kind
If you don't have a positive answer to my question, please don't just guess. Thanks.
Have you tried tramp with eshell? You can "cd /remote.host:/some/path" and edit files from there, and if you type a non-built-in, it fires up a ssh pipe to run it. Quite slick.
I fail to see why tramp is not a solution. You can edit using tramp, and do whatever you need in a terminal using xterm+ssh.
Well, if you can setup X clients on your Windows and OSX boxes, you should be able to run an X version of emacs on any of those platforms and set the display back to your workstation. That would give you your nice WIMP interface.
However there are a couple of solutions to keeping a terminal open to the same box. One is to just telnet into it twice. Once for your emacs session, and once for a shell.
The other option of course is to use meta-x shell to bring up a shell buffer inside of emacs. A true emacs guru prefers to run their OS inside of emacs, rather than the other way around. :-)
The approach I use is based on source controlling the Emacs scripts and important common files (using Git). This gives me a consistent code base so I don't have to remember which host has which script or file (or version of what I'm looking for). Git is particularly well suited to supporting this mechanism and I've pretty much got in the habit of updating the master origin repo daily. Within the scripts (both Emacs and bash shell scripts) I use machine tailored code to handle local requirements. This system has been in place now for well over a year and I find it to be quite effective. This is a technique I've seen recommended for some number of years. I found it clunky with CVS and Subversion but git feels tailored for the job. That said, I like the solution you selected as a complimentary tool and look forward to adding that to the mix.

What's a good development environment for Perl? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 months ago.
Improve this question
I develop applications using PHP or Java and will study Perl for the first time.
For PHP and Java, there are integrated development environments such as Eclipse, and debugging environment was regulated well, but, in the case of Perl, what kind of development environment do people use?
Is there a recommended IDE?
I would prefer a free debugging environment.
As Sinan stated, there are some IDEs for Perl. Padre is worth a mention. It is being actively developed by the Perl community.
From perlfaq3: Is there an IDE or Windows Perl Editor?, where it looks much nicer.
If the Padre people want their stuff in here, just add the right bits. The source lives in my perlfaq github repo. You can fork it, edit the file right in GitHub, and send me a pull request.
Is there an IDE or Windows Perl Editor?
Perl programs are just plain text, so any editor will do.
If you're on Unix, you already have an IDE--Unix itself. The Unix
philosophy is the philosophy of several small tools that each do one
thing and do it well. It's like a carpenter's toolbox.
If you want an IDE, check the following (in alphabetical order, not
order of preference):
Eclipse
The Eclipse Perl Integration Project integrates Perl
editing/debugging with Eclipse.
Enginsite
Perl Editor by EngInSite is a complete integrated development
environment (IDE) for creating, testing, and debugging Perl
scripts; the tool runs on Windows 9x/NT/2000/XP or later.
Komodo
ActiveState's cross-platform (as of October 2004, that's Windows,
Linux, and Solaris), multi-language IDE has Perl support, including
a regular expression debugger and remote debugging.
Open Perl IDE
Open Perl IDE is an integrated development environment for writing
and debugging Perl scripts with ActiveState's ActivePerl
distribution under Windows 95/98/NT/2000.
OptiPerl
OptiPerl is a Windows IDE with simulated CGI environment, including
debugger and syntax highlighting editor.
PerlBuilder
PerlBuidler is an integrated development environment for Windows
that supports Perl development.
visiPerl+
From Help Consulting, for Windows.
Visual Perl
Visual Perl is a Visual Studio.NET plug-in from ActiveState.
Zeus
Zeus for Window is another Win32 multi-language editor/IDE that
comes with support for Perl
For editors: if you're on Unix you probably have vi or a vi clone
already, and possibly an Emacs too, so you may not need to download
anything. In any Emacs, the cperl-mode (M-x cperl-mode) gives you
perhaps the best available Perl editing mode in any editor.
If you are using Windows, you can use any editor that lets you work
with plain text, such as NotePad or WordPad. Word processors, such as
Microsoft Word or WordPerfect, typically do not work since they insert
all sorts of behind-the-scenes information, although some allow you to
save files as "Text Only". You can also download text editors designed
specifically for programming, such as Textpad
and UltraEdit, among others.
If you are using Mac OS, the same concerns apply. MacPerl (for Classic
environments) comes with a simple editor. Popular external editors are
BBEdit or Alpha. Mac OS X users can use Unix editors as well.
GNU Emacs
MicroEMACS
XEmacs
Jed
or a vi clone such as
Elvis FTP, WWW
Vile
Vim
For vi lovers in general, Windows or elsewhere: vi
nvi (available from CPAN in src/misc/) is
yet another vi clone, unfortunately not available for Windows, but in
Unix platforms you might be interested in trying it out, firstly
because strictly speaking it is not a vi clone, it is the real vi, or
the new incarnation of it, and secondly because you can embed Perl
inside it to use Perl as the scripting language. nvi is not alone in
this, though: at least also vim and vile offer an embedded Perl.
The following are Win32 multilanguage editor/IDESs that support Perl:
Codewright
MultiEdit
SlickEdit
There is also a toyedit Text widget based editor written in Perl that
is distributed with the Tk module on CPAN. The ptkdb is a Perl/tk based debugger that acts
as a development environment of sorts. Perl Composer is an IDE for Perl/Tk GUI
creation.
In addition to an editor/IDE you might be interested in a more powerful
shell environment for Win32. Your options include
Bash from the Cygwin package
Ksh from the MKS Toolkit, or the Bourne shell
of the U/WIN environment
Tcsh, see also Using csh & tcsh
Zsh
MKS and U/WIN are commercial (U/WIN is free for educational and
research purposes), Cygwin is covered by the GNU Public License (but
that shouldn't matter for Perl use). The Cygwin, MKS, and U/WIN all
contain (in addition to the shells) a comprehensive set of standard
UNIX toolkit utilities.
If you're transferring text files between Unix and Windows using FTP be
sure to transfer them in ASCII mode so the ends of lines are
appropriately converted.
On Mac OS the MacPerl Application comes with a simple 32k text editor
that behaves like a rudimentary IDE. In contrast to the MacPerl
Application the MPW Perl tool can make use o Shell f the MPW itself as
an editor (with no 32k limit).
Affrus is a full Perl development environment with full debugger support.
Alpha is an editor, written and extensible in Tcl, that nonetheless has built in support for several popular markup and programming
languages including Perl and HTML.
BBEdit and BBEdit Lite are text editors for Mac OS that have a Perl sensitivity mode.
Pepper and Pe are programming language sensitive text editors for Mac
OS X and BeOS respectively.
Perl has very good debugging support. Read perldoc perldebug for details.
There are a bunch of IDEs such as ActiveState's Komodo, EPIC etc but I prefer to combine GVim (see also .vimrc for Perl programmers) with the command line. Others prefer Emacs.
Padre is getting better, but it's currently not quite up there with Komodo or EPIC.
That said, it is comparable with Ultraedit or Notepad++ at this point, less than a year after the first line of code was written.
With about 30 people actively committing, 35-40 plugins either released or in development, and translations in 20 languages, it is also moving ahead incredibly quickly.
So right now, I agree that EPIC is probably the way to go, since you've used Eclipse already.
But by this time next year it's probably going to be a different story.
If you're already familiar with debugging in Eclipse, then the EPIC plugin is exactly what you're looking for.
It's got stepped debugging within the Debug perspective, like with other languages in Eclipse. It's not as strong as the Java support, but it's got an easier learning curve than e.g. "perl -d" (the 'standard' way to debug Perl), or even learning a new editor like Emacs, with its Perl debugging integration.
What I use -- and what I've gotten the impression that most other serious Perl developers use -- is a good text editor. The only "integration" I have is via user-defined tools. For Perl, that's these:
perl -Mstrict -cw <file> # Perl "lint"
perl <file> # run file
perl -d <file> # run file in debugger
I have others for checking files in/out of version control, browsing history, etc. A good configurable editor (I'm partial to UltraEdit) will allow you to build your own environment using the tools you want instead of foisting an all-encompassing solution on you.
Komodo Edit is a free editor from Active State, probably not as feature rich as the full IDE but I find it very useful for Perl development, and it supports multiple languages.
You didn't specify which platform you're on, but on the Macintosh, TextMate is a very popular choice for Perl development. It's completely replaced Vim for me, and while it's not a full IDE, it's got alot of neat integrations in bundles specially targeted towards Perl development.