From 7d0ceb315ee2be4469fc21bc9a5a2a9d3f82e449 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jul 2023 15:10:02 +0900 Subject: [PATCH 01/12] feat : replace origin/main to 'origin main' in 'git push origin/main' --- thefuck/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thefuck/const.py b/thefuck/const.py index 8d339264d..237b3239e 100644 --- a/thefuck/const.py +++ b/thefuck/const.py @@ -33,7 +33,7 @@ def __repr__(self): 'wait_command': 3, 'require_confirmation': True, 'no_colors': False, - 'debug': False, + 'debug': True, 'priority': {}, 'history_limit': None, 'alter_history': True, From f4395a797996df60db3b7a9c38cba239b2c0ed3e Mon Sep 17 00:00:00 2001 From: choiinju Date: Fri, 7 Jul 2023 15:12:37 +0900 Subject: [PATCH 02/12] feat add git merge space to slash --- thefuck/rules/git_merge_mistake.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 thefuck/rules/git_merge_mistake.py diff --git a/thefuck/rules/git_merge_mistake.py b/thefuck/rules/git_merge_mistake.py new file mode 100644 index 000000000..2f9a7dccb --- /dev/null +++ b/thefuck/rules/git_merge_mistake.py @@ -0,0 +1,9 @@ + +def match(command): + return ( + command.script == 'git merge originmain' + ) + + +def get_new_command(command): + return command.script.replace('originmain', 'origin/main', 1) From a6189b630e0d5e24d9ce8788f0b17f54977a0950 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jul 2023 15:14:26 +0900 Subject: [PATCH 03/12] feat : replace origin/main to 'origin main' in 'git push origin/main'new --- thefuck/rules/git_push_mistake.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 thefuck/rules/git_push_mistake.py diff --git a/thefuck/rules/git_push_mistake.py b/thefuck/rules/git_push_mistake.py new file mode 100644 index 000000000..ce625c305 --- /dev/null +++ b/thefuck/rules/git_push_mistake.py @@ -0,0 +1,13 @@ +from thefuck.logs import debug +### +def match(command): + debug('{}'.format(command.script)) + return ( + command.script == "git push origin/main" + ) + + + + +def get_new_command(command): + return (command.script.replace("origin/main","origin main",1)) \ No newline at end of file From 76981433f2fb8edaba589f04203493cdb96d1063 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jul 2023 15:21:06 +0900 Subject: [PATCH 04/12] fix : remove codes related to logging --- thefuck/const.py | 2 +- thefuck/rules/git_push_mistake.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/thefuck/const.py b/thefuck/const.py index 237b3239e..8d339264d 100644 --- a/thefuck/const.py +++ b/thefuck/const.py @@ -33,7 +33,7 @@ def __repr__(self): 'wait_command': 3, 'require_confirmation': True, 'no_colors': False, - 'debug': True, + 'debug': False, 'priority': {}, 'history_limit': None, 'alter_history': True, diff --git a/thefuck/rules/git_push_mistake.py b/thefuck/rules/git_push_mistake.py index ce625c305..439b1012d 100644 --- a/thefuck/rules/git_push_mistake.py +++ b/thefuck/rules/git_push_mistake.py @@ -1,7 +1,7 @@ -from thefuck.logs import debug -### + + def match(command): - debug('{}'.format(command.script)) + return ( command.script == "git push origin/main" ) From cc2237467a85a7c6dacba4b3c2ef606b8b6da73c Mon Sep 17 00:00:00 2001 From: jaehyeonpy Date: Fri, 7 Jul 2023 17:43:05 +0900 Subject: [PATCH 05/12] chore: improve readability --- .gitignore | 1 + ..._merge_mistake.py => git_merge_originmain_mistake.py} | 1 - ..._mistake.py => git_push_origin_slash_main_mistake.py} | 9 ++------- 3 files changed, 3 insertions(+), 8 deletions(-) rename thefuck/rules/{git_merge_mistake.py => git_merge_originmain_mistake.py} (99%) rename thefuck/rules/{git_push_mistake.py => git_push_origin_slash_main_mistake.py} (51%) diff --git a/.gitignore b/.gitignore index b5b7ac739..c865b29fd 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ var/ *.egg-info/ .installed.cfg *.egg +venv/ # PyInstaller # Usually these files are written by a python script from a template diff --git a/thefuck/rules/git_merge_mistake.py b/thefuck/rules/git_merge_originmain_mistake.py similarity index 99% rename from thefuck/rules/git_merge_mistake.py rename to thefuck/rules/git_merge_originmain_mistake.py index 2f9a7dccb..8cf43a87f 100644 --- a/thefuck/rules/git_merge_mistake.py +++ b/thefuck/rules/git_merge_originmain_mistake.py @@ -1,4 +1,3 @@ - def match(command): return ( command.script == 'git merge originmain' diff --git a/thefuck/rules/git_push_mistake.py b/thefuck/rules/git_push_origin_slash_main_mistake.py similarity index 51% rename from thefuck/rules/git_push_mistake.py rename to thefuck/rules/git_push_origin_slash_main_mistake.py index 439b1012d..5ae71cb0f 100644 --- a/thefuck/rules/git_push_mistake.py +++ b/thefuck/rules/git_push_origin_slash_main_mistake.py @@ -1,13 +1,8 @@ - - -def match(command): - +def match(command): return ( command.script == "git push origin/main" ) - - def get_new_command(command): - return (command.script.replace("origin/main","origin main",1)) \ No newline at end of file + return command.script.replace("origin/main", "origin main", 1) \ No newline at end of file From f1a12f730c620400baa2b3a212d9ed33aba7f756 Mon Sep 17 00:00:00 2001 From: choiinju Date: Sun, 9 Jul 2023 15:45:02 +0900 Subject: [PATCH 06/12] chore : add read me file --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3ea406fcf..ebbcce3d5 100644 --- a/README.md +++ b/README.md @@ -348,6 +348,7 @@ following rules are enabled by default: * `yarn_command_not_found` – fixes misspelled `yarn` commands; * `yarn_command_replaced` – fixes replaced `yarn` commands; * `yarn_help` – makes it easier to open `yarn` documentation; +* `git_merge_mistake` – fixes slash mistake in git merge; ##### [Back to Contents](#contents) From 630eb4e213dd9f4add66b7312c094823816e1411 Mon Sep 17 00:00:00 2001 From: choiinju Date: Sun, 9 Jul 2023 19:12:13 +0900 Subject: [PATCH 07/12] feat : command add -> git add -A --- thefuck/rules/git_add_forgot_git.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 thefuck/rules/git_add_forgot_git.py diff --git a/thefuck/rules/git_add_forgot_git.py b/thefuck/rules/git_add_forgot_git.py new file mode 100644 index 000000000..76d23f9d2 --- /dev/null +++ b/thefuck/rules/git_add_forgot_git.py @@ -0,0 +1,6 @@ +def match(command): + return command.script == 'add' + + +def get_new_command(command): + return 'git add -A' From a973fba68f94d8af10b4a31cf04b572909fc00aa Mon Sep 17 00:00:00 2001 From: choiinju Date: Sun, 9 Jul 2023 21:24:42 +0900 Subject: [PATCH 08/12] feat : fucntion git add -a -> -A --- thefuck/rules/git_add_-a_-A.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 thefuck/rules/git_add_-a_-A.py diff --git a/thefuck/rules/git_add_-a_-A.py b/thefuck/rules/git_add_-a_-A.py new file mode 100644 index 000000000..2df3f236a --- /dev/null +++ b/thefuck/rules/git_add_-a_-A.py @@ -0,0 +1,6 @@ +def match(command): + return command.script == 'git add -a' + + +def get_new_command(command): + return 'git add -A' From a8cf96616cb646e544beb0aadda80214e5b4abee Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Jul 2023 14:31:10 +0900 Subject: [PATCH 09/12] feat : Replace 'init' with 'git init',which is a common mistake beginners makes --- thefuck/rules/git_init_no_git.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 thefuck/rules/git_init_no_git.py diff --git a/thefuck/rules/git_init_no_git.py b/thefuck/rules/git_init_no_git.py new file mode 100644 index 000000000..f47865472 --- /dev/null +++ b/thefuck/rules/git_init_no_git.py @@ -0,0 +1,11 @@ +def match(command): + + return ( + command.script == "init" + ) + + + + +def get_new_command(command): + return (command.script.replace("init","git init",1)) From 44d53d444f46fb255533ee924c52eed5ada71a57 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Jul 2023 20:44:13 +0900 Subject: [PATCH 10/12] feat : Replace 'commit' with 'git commit',which is a common mistake beginners makes --- thefuck/rules/git-commit-no-git.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 thefuck/rules/git-commit-no-git.py diff --git a/thefuck/rules/git-commit-no-git.py b/thefuck/rules/git-commit-no-git.py new file mode 100644 index 000000000..e69de29bb From aca3fe1b2f1171c3e6f43574215e16552eb58fa4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Jul 2023 20:50:01 +0900 Subject: [PATCH 11/12] feat : Replace 'status' with 'git status',which is a common mistake beginners makes --- thefuck/rules/git-status-no-git.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 thefuck/rules/git-status-no-git.py diff --git a/thefuck/rules/git-status-no-git.py b/thefuck/rules/git-status-no-git.py new file mode 100644 index 000000000..54bbd3e8d --- /dev/null +++ b/thefuck/rules/git-status-no-git.py @@ -0,0 +1,11 @@ +def match(command): + + return ( + command.script == "status" + ) + + + + +def get_new_command(command): + return (command.script.replace("status","git status",1)) \ No newline at end of file From 31056fc27d6b836ba69c98ad9b478fc05a4492ba Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Jul 2023 20:55:13 +0900 Subject: [PATCH 12/12] feat : Replace 'checkout master' with 'git checkout master',which is a common mistake beginners makes --- thefuck/rules/git-checkout-master-no-git | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 thefuck/rules/git-checkout-master-no-git diff --git a/thefuck/rules/git-checkout-master-no-git b/thefuck/rules/git-checkout-master-no-git new file mode 100644 index 000000000..394f98e3a --- /dev/null +++ b/thefuck/rules/git-checkout-master-no-git @@ -0,0 +1,11 @@ +def match(command): + + return ( + command.script == "checkout master" + ) + + + + +def get_new_command(command): + return (command.script.replace("checkout master","git checkout master",1))