mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 04:14:59 +00:00
refactor: Enhance git blame detection with specific similarity thresholds
This commit is contained in:
parent
0eb26fffe1
commit
9bf70d8641
1 changed files with 16 additions and 4 deletions
|
@ -224,9 +224,10 @@ def get_counts_for_file(start_tag, end_tag, authors, fname):
|
|||
[
|
||||
"git",
|
||||
"blame",
|
||||
"-M",
|
||||
"-C",
|
||||
"-C",
|
||||
"-M100", # Detect moved lines within a file with 100% similarity
|
||||
"-C100", # Detect moves across files with 100% similarity
|
||||
"-C", # Increase detection effort
|
||||
"-C", # Increase detection effort even more
|
||||
"--abbrev=9",
|
||||
f"{start_tag}..{end_tag}",
|
||||
"--",
|
||||
|
@ -235,7 +236,18 @@ def get_counts_for_file(start_tag, end_tag, authors, fname):
|
|||
)
|
||||
else:
|
||||
text = run(
|
||||
["git", "blame", "-M", "-C", "-C", "--abbrev=9", f"{start_tag}..HEAD", "--", fname]
|
||||
[
|
||||
"git",
|
||||
"blame",
|
||||
"-M100", # Detect moved lines within a file with 100% similarity
|
||||
"-C100", # Detect moves across files with 100% similarity
|
||||
"-C", # Increase detection effort
|
||||
"-C", # Increase detection effort even more
|
||||
"--abbrev=9",
|
||||
f"{start_tag}..HEAD",
|
||||
"--",
|
||||
fname
|
||||
]
|
||||
)
|
||||
if not text:
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue