Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1import re
2from thefuck.utils import get_all_matched_commands, replace_command
3from thefuck.specific.git import git_support
4
5
6@git_support
7def match(command):
8 return (" is not a git command. See 'git --help'." in command.stderr
9 and 'Did you mean' in command.stderr)
10
11
12@git_support
13def get_new_command(command):
14 broken_cmd = re.findall(r"git: '([^']*)' is not a git command",
15 command.stderr)[0]
16 matched = get_all_matched_commands(command.stderr)
17 return replace_command(command, broken_cmd, matched)
18

After

1import re
2from thefuck.utils import get_all_matched_commands, replace_command
3from thefuck.specific.git import git_support
4
5
6@git_support
7def match(command):
8 return (" is not a git command. See 'git --help'." in command.stderr
9 and 'The most similar command' in command.stderr)
10
11
12@git_support
13def get_new_command(command):
14 broken_cmd = re.findall(r"git: '([^']*)' is not a git command",
15 command.stderr)[0]
16 matched = get_all_matched_commands(command.stderr, 'The most similar command')
17 return replace_command(command, broken_cmd, matched)
18

Before

module
import_statement
import "import"
dotted_name
identifier "re"
import_from_statement
from "from"
dotted_name
identifier "thefuck"
. "."
identifier "utils"
import "import"
dotted_name
identifier "get_all_matched_commands"
, ","
dotted_name
identifier "replace_command"
import_from_statement
from "from"
dotted_name
identifier "thefuck"
. "."
identifier "specific"
. "."
identifier "git"
import "import"
dotted_name
identifier "git_support"
decorated_definition
decorator
@ "@"
identifier "git_support"
function_definition
def "def"
identifier "match"
parameters
( "("
identifier "command"
) ")"
: ":"
block
return_statement
return "return"
parenthesized_expression
( "("
boolean_operator
comparison_operator
string
string_start "\""
string_content " is not a git command. See 'git --help'."
string_end "\""
in "in"
attribute
identifier "command"
. "."
identifier "stderr"
and "and"
comparison_operator
string
string_start "'"
string_content "Did you mean"
string_end "'"
in "in"
attribute
identifier "command"
. "."
identifier "stderr"
) ")"
decorated_definition
decorator
@ "@"
identifier "git_support"
function_definition
def "def"
identifier "get_new_command"
parameters
( "("
identifier "command"
) ")"
: ":"
block
expression_statement (+25 nodes collapsed)
expression_statement
assignment
identifier "matched"
= "="
call
identifier "get_all_matched_commands"
argument_list
( "("
attribute
identifier "command"
. "."
identifier "stderr"
) ")"
return_statement
return "return"
call
identifier "replace_command"
argument_list
( "("
identifier "command"
, ","
identifier "broken_cmd"
, ","
identifier "matched"
) ")"

After

module
import_statement
import "import"
dotted_name
identifier "re"
import_from_statement
from "from"
dotted_name
identifier "thefuck"
. "."
identifier "utils"
import "import"
dotted_name
identifier "get_all_matched_commands"
, ","
dotted_name
identifier "replace_command"
import_from_statement
from "from"
dotted_name
identifier "thefuck"
. "."
identifier "specific"
. "."
identifier "git"
import "import"
dotted_name
identifier "git_support"
decorated_definition
decorator
@ "@"
identifier "git_support"
function_definition
def "def"
identifier "match"
parameters
( "("
identifier "command"
) ")"
: ":"
block
return_statement
return "return"
parenthesized_expression
( "("
boolean_operator
comparison_operator
string
string_start "\""
string_content " is not a git command. See 'git --help'."
string_end "\""
in "in"
attribute
identifier "command"
. "."
identifier "stderr"
and "and"
comparison_operator
string
string_start "'"
string_content "The most similar command"
string_end "'"
in "in"
attribute
identifier "command"
. "."
identifier "stderr"
) ")"
decorated_definition
decorator
@ "@"
identifier "git_support"
function_definition
def "def"
identifier "get_new_command"
parameters
( "("
identifier "command"
) ")"
: ":"
block
expression_statement (+25 nodes collapsed)
expression_statement
assignment
identifier "matched"
= "="
call
identifier "get_all_matched_commands"
argument_list
( "("
attribute
identifier "command"
. "."
identifier "stderr"
, ","
string
string_start "'"
string_content "The most similar command"
string_end "'"
) ")"
return_statement
return "return"
call
identifier "replace_command"
argument_list
( "("
identifier "command"
, ","
identifier "broken_cmd"
, ","
identifier "matched"
) ")"