From 65c624ad52ff577cd0b78b34b64130c91c39589f Mon Sep 17 00:00:00 2001 From: mcarton Date: Wed, 13 May 2015 09:47:31 +0200 Subject: [PATCH 1/2] Improve the git_stash rule --- thefuck/rules/git_stash.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/thefuck/rules/git_stash.py b/thefuck/rules/git_stash.py index a95d8f4..58bfbb3 100644 --- a/thefuck/rules/git_stash.py +++ b/thefuck/rules/git_stash.py @@ -1,6 +1,7 @@ def match(command, settings): - return ('git' in command.script - and 'Please commit or stash them.' in command.stderr) + # catches "Please commit or stash them" and "Please, commit your changes or + # stash them before you can switch branches." + return 'git' in command.script and 'or stash them' in command.stderr def get_new_command(command, settings): From 14d14c5ac6543370e7ce1bd6d51316a4b150ad02 Mon Sep 17 00:00:00 2001 From: mcarton Date: Wed, 13 May 2015 09:49:45 +0200 Subject: [PATCH 2/2] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef74cc7..6309226 100644 --- a/README.md +++ b/README.md @@ -151,7 +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; +* `git_stash` – stashes you local modifications before rebasing or switching branch; * `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;