mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +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",
|
"git",
|
||||||
"blame",
|
"blame",
|
||||||
"-M",
|
"-M100", # Detect moved lines within a file with 100% similarity
|
||||||
"-C",
|
"-C100", # Detect moves across files with 100% similarity
|
||||||
"-C",
|
"-C", # Increase detection effort
|
||||||
|
"-C", # Increase detection effort even more
|
||||||
"--abbrev=9",
|
"--abbrev=9",
|
||||||
f"{start_tag}..{end_tag}",
|
f"{start_tag}..{end_tag}",
|
||||||
"--",
|
"--",
|
||||||
|
@ -235,7 +236,18 @@ def get_counts_for_file(start_tag, end_tag, authors, fname):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
text = run(
|
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:
|
if not text:
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue