Jeff Kreeftmeijer, a Ruby developer, writes about Git workflows, Vim settings, testing tools and Node.js.
HN commenters link his posts on git-flow and Vim hybrid line numbers, and one finds the hybrid mode useful for relative and absolute numbers.
50,000 ft overview:
Rspec: Behavior Driven Development Framework. It is essentially a different approach to testing than the test/unit (which Rails uses by default). In Rspec you are more interested in testing the side effects of your code, i.e. its behavior, you are less concerned with the internals. This doesn't mean you should write huge methods, and in the end your specs and tests will look pretty similar. My company uses Rspec on our main project.
http://gist.github.com/649417
People will argue the value of the different styles until they're blue in the face. I liked Rspec's syntax more so thats where I started, but in the end I know both and think they each have their own merits and its probably a total wash. Recently with things like shoulda and other tools both approaches are rapidly converging on the same feature set.
Cucumber: Integration framework. This tests your whole stack end-to-end. Depending on what you are building this may be the only way to test it, and for a lot of people they are just doing Unit + Integration tests and not writing any controller tests. You write in Gherkin (http://github.com/aslakhellesoy/cucumber/wiki/gherkin) which is a special subset of English. You can also use Steak (http://jeffkreeftmeijer.com/2010/steak-because-cucumber-is-for-vegetarians/) which lets you write your story in pure Ruby. Either way, this story is broken out in to steps and then some driver follows those steps, either driving or emulating a web browser. The…
No matter how often you want to review code, I think it could work for your team like this:
- dev works on a feature branch, making multiple commits and pushes
- once ready, squash all the commits and submit it to gerrit
[- perhaps have hudson/jenkins run the unit tests at this point automatically]
- have the code review in gerrit
- once the review is done, gerrit would merge it into the develop or master branch (depending on your git workflow)
That approach blends in nicely with git-flow (1). If you want to be sure that no single dev is pushing to the develop or master branches you'd need to setup per-branch permissions, which can be done with gitolite (2). Too bad github (even the self-hosted version) doesn't support per-branch permissions, which forces organizations that use it and only want gerrit to be able to push into the main branch to do excessive repo forking instead of using feature branches. Also I'd love to be able to do ad-hoc code reviews in github, as the interface is the most beautiful of all imo.
[1] http://nvie.com/posts/a-successful-git-branching-model/, https://github.com/nvie/gitflow, http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/
[2] https://github.com/sitaramc/gitolite
> vi in Unix highlights the amount of time you spend watching the screen as you cursor around with hjkl
vi is four decades old. It's not the pinnacle of keyboard-driven interface design, vast improvements have been made since then.
For example, I use vim-sneak, which lets you jump to anywhere on your screen in 3 keystrokes flat 99% of the time (and the 1% of the time where you miss, well, 99% of those times, just one more keystroke is all it takes to get to the right spot): https://github.com/justinmk/vim-sneak
I also use relative line numbers, so I can select or delete most blocks of text in 3 or 4 keystrokes, for example d4j deletes the current line and the next 4 lines (5 lines total), or d23k deletes the current line and the previous 23 lines (24 lines total): https://jeffkreeftmeijer.com/vim-number/
Obviously number of keystrokes isn't the only factor that determines operation speed. This is actually exemplified by my second example, commands like "d23k" actually work out-of-the-box even in original vi, the problem is that counting 23 lines by eye is way slower than selecting 24 lines with a mouse by eye, which is solved by relative line numbers.
> What's the best way to rapidly move around without having to count lines?
oooh. I have a treat for you! Check out "hybrid line numbers". I thought they would be weird when I heard about them, but they're awesome, and I never need "absolute line numbers". But the linked article shows you how to set up toggling if you need them.
Basically, they look like this:
3 Lorem ipsum dolor sit amet,
2 nunc in iaculis ipsum.
1 Suspendisse dapibus odio erat,
98 non varius nulla porttitor at. // <-- You are here
1 Nullam in convallis elit.
2 Sed nec venenatis ligula.
3 consectetur adipiscing elit.
4 Sed hendrerit ac ante sed viverra.
In this example, your cursor is at line 98 and so shows the absolute line number. The other lines are relative to your current line. If you want to go down to the line that starts consectetur, you see that it is below you 3 lines. You have to type 3j. If you need to find a specific line number, say 24, type :24
Here's an article on them: https://jeffkreeftmeijer.com/vim-number/
Hey David,
I really like what you have done, a nice twist on the ol' like button. And its a pretty cool looking site as well.
One thing does, well, concern me a bit, and its that you haven't given credit where credit is due (http://jeffkreeftmeijer.com/2010/experimenting-with-node-js/).
There is no doubt that this is very similar to Jeffs blog post, and although it takes the idea a step further, I do think you should at least add a link to any and all code which inspired you and which you took ideas from, if it be Jeffs previous post, or a Node Knockout project.
Best of luck with getting Valves attention, and you have my pointers vote :)
It's definitely my favorite git client! It looks great and provides a very nice macOS like experience and and gives access to all git features I need. Especially I like the interface for single-line-staging and managing submodules. I use it everyday.
It's not and IDE as you do not edit your code inside Tower but just use it for staging/committing/push/pull.
It also has support for git-flow [1] but I am not using that.
[1]: http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/