Skip to content

Formatting when author name contains brackets #72

@preiter93

Description

@preiter93
  • Sublime Text version:

    • 4123
  • How did you install this package?:

    • Manually downloaded
  • Operating System and version:

    • macOS 12.6
  • How did you install git itself?

    • already came with my OS

Hi,

if the author name contains brackets, the regex matching fails. Say, the authorname is Lastname, Firstname (External) parsing the git blame output

# With bracket
line = "SHA Filename (Lastname, Firstname (External) 2022-10-13 16:30:25 +0200 16)\n"
m = parse_line(line)
d = postprocess_parse_result(m)
for x in d:
    print("{:14s} : {:4s}".format(x, d[x]))

gives

sha            : SHA
file           : Filename (Lastname, Firstname
author         : External)
date           : 2022-10-13
time           : 16:30:25
timezone       : +0200
line_number    : 16  
sha_normalised : SHA

I get correct results if I replace \s+ (?P<file>[\S ]+) with \s+ (?P<file>[\S]+) (remove the whitespace behind \S) in the parse_line function, but not sure if this will break for different examples.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions