def find_git_mtimes(self, context, silent_build):
        if not context.use_git_timestamps:
            return {}

        parent_dir = context.parent_dir
        root_folder = context.git_root

        # Can't use git timestamps if it's just a shallow clone
        # Otherwise all the files get the timestamp of the latest commit
        if context.use_git_timestamps and os.path.exists(os.path.join(root_folder, ".git", "shallow")):
            raise HarpoonError("Can't get git timestamps from a shallow clone", directory=parent_dir)

        git = Repo(root_folder)
        mtimes = {}
        all_files = set(git.open_index())

        use_files = set()
        use_files_relpaths = set()
        for filename in all_files:
            relpath = os.path.relpath(os.path.join(root_folder, filename.decode('utf-8')), context.parent_dir)

            # Only include files under the parent_dir
            if relpath.startswith("../"):
                continue

            # Ignore files that we don't want git_timestamps from
            if context.use_git_timestamps and type(context.use_git_timestamps) is not bool:
                match = False
                for line in context.use_git_timestamps:
                    if fnmatch.fnmatch(relpath, line):
                        match = True
                        break
                if not match:
                    continue

            # Matched is true by default if
            # * Have context.exclude
            # * No context.exclude and no context.include
            matched = context.exclude or not any([context.exclude, context.include])

            # Anything not matching exclude gets included
            if context.exclude:
                for line in context.exclude:
                    if fnmatch.fnmatch(relpath, line):
                        matched = False

            # Anything matching include gets included
            if context.include:
                for line in context.include:
                    if fnmatch.fnmatch(relpath, line):
                        matched = True
                        break

            # Either didn't match any exclude or matched an include
            if matched:
                use_files.add(filename)
                use_files_relpaths.add(relpath)

        if not silent_build: log.info("Finding modified times for %s/%s git controlled files in %s", len(use_files), len(all_files), root_folder)

        first_commit = None
        cached_commit, cached_mtimes = self.get_cached_mtimes(root_folder, use_files_relpaths)
        for entry in git.get_walker():
            if first_commit is None:
                first_commit = entry.commit.id.decode('utf-8')

            if cached_commit and entry.commit.id.decode('utf-8') == cached_commit:
                new_mtimes = cached_mtimes
                new_mtimes.update(mtimes)
                mtimes = new_mtimes
                break

            date = entry.commit.author_time
            added = False
            for changes in entry.changes():
                if type(changes) is not list:
                    changes = [changes]
                for change in changes:
                    path = change.new.path
                    if root_folder and change.new.path and context.parent_dir:
                        if path in use_files:
                            new_relpath = os.path.relpath(os.path.join(root_folder, change.new.path.decode('utf-8')), context.parent_dir).encode('utf-8')
                            if not new_relpath.decode('utf-8').startswith("../"):
                                if mtimes.get(new_relpath, 0) < date:
                                    mtimes[new_relpath] = date
                                    added = True

            if added:
                if len(use_files - set(mtimes)) == 0:
                    break

        mtimes = dict((fn.decode('utf-8') if hasattr(fn, "decode") else fn, mtime) for fn, mtime in mtimes.items())
        if first_commit != cached_commit:
            self.set_cached_mtimes(root_folder, first_commit, mtimes, use_files_relpaths)
        return mtimes
Do something you don't want in !help all the time
dataset/ETHPy150Open realestate-com-au/harpoon/harpoon/ship/context.py/ContextBuilder.find_git_mtimes--crossover with--dataset/ETHPy150Open gawel/irc3/examples/mycommands.py/my_secret_operation