commit: e688357bdc5773009bb2e106075d9852f2513f89 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Thu Sep 7 22:54:44 2023 +0000 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> CommitDate: Fri Sep 8 12:20:25 2023 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=e688357b
addons: git: pass --no-find-copies --no-find-copies-harder --find-renames 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 <sam <AT> gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/618 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> src/pkgcheck/addons/git.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pkgcheck/addons/git.py b/src/pkgcheck/addons/git.py index 669ac262..5d41ba3b 100644 --- a/src/pkgcheck/addons/git.py +++ b/src/pkgcheck/addons/git.py @@ -155,6 +155,7 @@ class _ParseGitRepo: 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
