-
-
Save yaauie/5c06f73782832e530599 to your computer and use it in GitHub Desktop.
Lately I've been fat-fingering git commands, injecting a space between `gi` and `t` and failing to inject a space between that `t` and the command; this simple script fixes that.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# gi - a dynamic alias for poorly-typed git commands | |
# handle a command `gi tdiff --cached`, | |
# transparently as `git diff --cached`. | |
exit(127) if ARGV.empty? | |
exit(127) unless ARGV.first.start_with?('t') | |
argv = ARGV.dup | |
argv.unshift(argv.shift[1..-1]) | |
exec('git', *argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment