1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-06 02:41:10 +01:00

Add a git_stash rule

This commit is contained in:
mcarton 2015-05-12 19:41:00 +02:00
parent 779e29906e
commit 8ac4dafe6d
2 changed files with 8 additions and 0 deletions

View File

@ -151,6 +151,7 @@ using the matched rule and runs it. Rules enabled by default are as follows:
* `git_checkout` – creates the branch before checking-out;
* `git_no_command` – fixes wrong git commands like `git brnch`;
* `git_push` – adds `--set-upstream origin $branch` to previous failed `git push`;
* `git_stash` – stashes you local modifications before rebase;
* `has_exists_script` – prepends `./` when script/binary exists;
* `lein_not_task` – fixes wrong `lein` tasks like `lein rpl`;
* `mkdir_p` – adds `-p` when you trying to create directory without parent;

View File

@ -0,0 +1,7 @@
def match(command, settings):
return ('git' in command.script
and 'Please commit or stash them.' in command.stderr)
def get_new_command(command, settings):
return 'git stash && ' + command.script