Skip to content

Commit

Permalink
Use [noname] <nomail> as fallback for missing git author info
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Jan 29, 2025
1 parent fe6611d commit c8af1f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fluent/migrate/repo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ def blame(self, file: str) -> list[Tuple[str, int]]:
stdout = git(self.root, "blame", "--porcelain", file)
for line in stdout.splitlines():
if line.startswith("author "):
user = line[7:]
user = line[7:] or "[noname]"
elif line.startswith("author-mail "):
user += line[11:] # includes leading space
email = line[11:] # includes leading space
user += email if email != ' <>' else ' <nomail>'
elif line.startswith("author-time "):
time = int(line[12:])
elif line.startswith("\t"):
Expand Down

0 comments on commit c8af1f1

Please sign in to comment.