This message was deleted.
# community-support
s
This message was deleted.
c
depends on your git needs, may not need to execute git - something like eGit could suffice.
m
I use the output of
git diff HEAD...master
and thus need to have this information tracked by git - It looks like that tool is just built on top of git?
c
if you need that specific output it’s likely cleanest (most predictable) to use git directly. eGit is an API for git that would allow you to do git operations directly from code - while it would be possible to do the diff, you’d have to invest in formatting it etc.
👍 1
m
Word, yeah it's good to know I'm on the right path. Inside of a Gradle Runner test, though, what's the preferred way to use third-party tools? Through an
Exec
task?
c
If it’s the test - and not your Gradle script that you are testing - you can use standard java/groovy/kotlin APIs to exec that command, or any other convenience-library that will eventually execute that command.
If your Gradle script under test is intending to execute the command then you could use an Exec task which would drop the output in the logs for your test to then parse out (that latter part is fugly, dislike how TestKit makes you parse the log output)
e
programatically executing Git porcelain (like
git diff
) isn't a great idea if you're expecting the same output, since it can be hugely influenced by local `~/.gitconfig`/`/etc/gitconfig` Gcalling
m
This command will run on a pre-configured container whose environment we control
e
even the output and behavior or Git plumbing can vary based on config too, but usually not by as much
👍 1