Skip to content

Commit

Permalink
addons: git: pass --no-find-copies --no-find-copies-harder --find-ren…
Browse files Browse the repository at this point in the history
…ames to git log

I currently have a local git hack to allow configuring git to default to
--find-copies-harder because it's *extremely* useful when working on ebuild
repositories (prompted by a discussion with Eli Schwartz).

Unfortunately, this can confuse pkgcheck's git intergration because it'll
call `git log` like:
```
git log --name-status --diff-filter=ARMD -z --pretty=tformat:%n%h%n%ct cc5b3b9f134a070c548faa4e3de17d615497d0b3..origin/HEAD
```
and get nothing back because (I think) git is interpreting some changes as copies
rather than renames or new files.

Explicitly pass options to disable finding copies, even though normally this
isn't necessary, to keep things working.

Signed-off-by: Sam James <[email protected]>
  • Loading branch information
thesamesam committed Sep 7, 2023
1 parent a159aca commit 8d52d87
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/pkgcheck/addons/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def __init__(self, path, commit_range):
cmd = shlex.split(self._git_cmd)
cmd.append(f"--pretty=tformat:%n{'%n'.join(self._format)}")
cmd.append(commit_range)
cmd.extend(("--no-find-copies", "--no-find-copies-harder", "--find-renames"))

self.git_log = GitLog(cmd, self.path)
# discard the initial newline
Expand Down

0 comments on commit 8d52d87

Please sign in to comment.