Geordi reads from a
.geordi.yml file inside your repo and connects to Pivotal Tracker to list started and finished stories with their title. Choosing one of them generates a commit message including id and title from pivotal tracker. For example:
[#1234567] CRUD Users
If you encounter a bug like `40...
We currently test most of our gems on Travis CI, but want to migrate those tests to Github Actions. This is a step-by-step guide on how to do this.
Note that this guide requires the gem to use gemika.
git checkout -b ci
mkdir -p .github/workflows; bundle exec rake gemika:generate_github_actions_workflow > .github/workflows/test.yml
On some of our older projects, we use the mysql2 gem. Unfortunately, versions 0.2.x (required for Rails 2.3) and versions 0.3.x (required for Rails 3.2) can no longer be installed on Ubuntu 20.04. Trying this either leads to errors when compiling the native extension, or a segfaults when using it.
For Rails 4.2, mysql2 version 0.4.10 seems to work okay.
To install it, you have to switch the mysql2 gem to our fork. In your Gemfile, change mysql2 to either
gem 'mysql2', :git =>'https://github.com/ma...
Installing old Rubies (<= 2.3) with a standard rbenv + ruby-build is no longer possible on Ubuntu 20.04. This is because those Rubies depend on OpenSSL 1.0 which is no longer shipped with current Ubuntus.
We have forked ruby-build with a workaround that makes it compile and statically link the latest OpenSSL 1.0 version. This works on Ubuntu 20.04, as well as on Ubuntu 18.04.
To switch to our fork of ruby-build, update ruby-build like this
git -C ~/.rbenv/plugins/ruby-build remote add makandra...
RSpec allows you to mark a single Example/ExampleGroup so that only this will be run. This is very useful when using a test runner like guard.
Add the following config to
RSpec.configure do |config| # These two settings work together to allow you to limit a spec run # to individual examples or groups you care about by tagging them with # `:focus` metadata. When nothing is tagged with `:focus`, all examples # get run. config.filter_run_including :focus => true config.run_all_when_everything_filtere...
When importing a dump created on a server that has a more recent
pg_dump version you might get an error like
$ geordi dump staging -l # Sourcing dump into the project_development db pg_restore: [archiver] unsupported version (1.14) in file header x An error occured loading staging.dump
On my machine I had
10.14 which was the most recent package from the standard repository. The server, however, had
The issue could be fixed by [installing postgres 12 from the PostgreSQL APT-Repositories]...
It sometimes happen that a database dump, that would want to insert into your development database, does not match the current schema of the database. This often happens when you have an old dump, but your current setup is up to date with the the master.
Hint: In most cases it is sufficient to delete and recreate the local database in order to import the dump. If any problems occur, proceed as follows:
psql some.dump > some.dump.plain
To find a version containing the regular expression
foo in the history of any branch:
git grep foo $(git rev-list --all)
You may also limit the search to a file extension, e.g. Ruby files (
.rb) like this:
git grep foo $(git rev-list --all) -- *.rb
Git commits should be very deliberate, and only contain changes that you really want to be in there. In order to reduce the chance to accidentally commit something you didn't intend, review your changes before committing.
git add -N . # Add all paths, but not their contents git add -p
Git will now show you all your changes in small chunks and ask you in an interactive mode whether you really want to add them.
The most helpful commands are
When working with custom transactions and use
ActiveRecord::Rollback you may encounter unexpected behaviour if you try to roll back your changes.
Not all databases support nested transactions. Therefore, Rails will sometimes silently ignore a nested transaction and simply reuse the other transaction. However, a
ActiveRecord::Rollback within the nested transaction will be caught by the block of the nested transaction. Therefore it will be ignored by the outer transaction, and not cause a roll back!
To avoid this unexpected ...
We often have a separate production branch that lags a bit behind the more cutting edge master branch. Sometimes you want to move some, but not all commits from master to production. This can be done with a
However, this may lead to considerable pain later, since git does not understand the commits are actually "the same". Hazards are unnecessary and hard to resolve conflicts as well as incorrect auto-merges.
In order to avoid this, always merge the production branch back to the master after the cherry-pick. ...
If you use
transactional_fixtures or the database_cleaner gem with strategy
after_commit callbacks will not be fired in your tests.
Rails 5 has a fix for this issue and no further action is needed.
Add the gem test_after_commit to your
test group in the Gemfile and you are done. You don't need to change the database strategy to
deletion (which might...
In interactive commands, Git allows the user to provide one-letter input with a single key without hitting enter (docs).
# Enabled this feature globally git config --global interactive.singlekey true # Or enable this feature locally for a single repository git config interactive.singlekey true
This allows you to hit "
y" instead of "
y + ENTER" to move to the next hunk.
Stage this hunk [y,n,q,a,d,s,e,?]?
Ag (aka "the silver searcher") is a very fast replacement for
It will parse your
.gitignore for additional speedup. To ignore even more files (
*.min.js etc), add an
.ignore with syntax identical to
See Faster Grepping in Vim for hints about vim integration.
This is called "cherry-picking".
git cherry-pick commit-sha1
Note that since branches are nothing but commit pointers, cherry-picking the latest commit of a branch is as simple as
git cherry-pick my-feature-branch
Be aware that cherry-picking will make a copy of the picked commit, with its own hash. If you merge the branch later, the commit will appear in a history a second time (probably without a diff since there was nothing left to do).
Also see our advice for [cherry picking to production branches](https://makandraca...
Open-source software (OSS) is great. Anyone can use virtually any open-source code in their projects.
Well, it depends. Licenses can make things difficult, especially when you are developing closed-source software. Since some OSS licenses even require the employing application to be open-sourced as well (looking at you, GPL), you cannot use such software in a closed-source project.
To be sure on this, we have developed a project-level integration of Pivotal's excellent [license_finder](https://g...
The linked github page is a collection of common markdown XSS payloads which is handy for writing tests.
Using git fixup helps you to speed up appending changes further back in the git history of your feature branch.
git commit --fixup aabbcc # Create a commit with the message "fixup! Commit message of aabbcc" git rebase -i --autosquash master
It would be nice if you could use this feature without the
-i flag, but until now it seems not to be possible. Read more about our recommended git workflow for feature branches.