thinking about creating a new plugin that requires...
# plugins
r
thinking about creating a new plugin that requires to know source files git information. For example, we would need to know if a source file has been added, removed, modified. Is there a way to get this info in pants now? I guess another option is to create a custom rule to run gitpython. Maybe something like this?
Copy code
source_files_git_info = await Get(
    SourceFilesGitInfo,
    SourceFilesGitInfoRequest(source_files),
)
as long as we have access to the git repo I assume this would be possible
👍 1
w
it would be possible, yea… most likely the rule would need to be marked
@_uncacheable
(since it would definitely be poking at files that we cannot track).
but note that Pants already internally interacts with Git, and so it might amount to refactoring existing APIs to expose them from
@rules
1
but yea, exposing source control is definitely something that some built in
@rules
should do: would be happy to help with some more pointers if you are interested.
2
h
Agreed, that would be awesome to have for plugin authors. Happy to help too
r
yeah I agree that would be a great feature to have for writing plugins. I have limited bandwidth at the moment but I would be interested to learn how we can achieve this