Discussed in #5074
Originally posted by shamsalmon September 18, 2025
Git is extremely slow pulling from monorepos with large commit histories. I have determined the primary reason for this not directly repo size, but rather how many git log operations are being run and the history of the repo itself.
The main issue is with the logic defined here:
https://github.com/akuity/kargo/blob/main/internal/controller/git/work_tree.go#L395
There is no way to set filters within this work tree function. My proposal is to add several options here:
- Set the git log path to only look at folders within the IncludePath to reduce history
- Ability to set a --since argument ("1 year ago" for ex) to reduce history
There are more potential improvements here, such as also making ExcludePaths transition into the pathspec format for git log.
More context. We've nailed down the root cause and it's this:
#5074 (comment)
This is the tentative solution:
Your --since idea might be the most viable thing here, as when you are creating a subscription involving new apps or environments in your monorepo, it should probably be relatively easily to say, "hey, this stuff didn't exist before this date, so if you go back that far and haven't hit the discovery limit, you're done."
I'd like @hiddeco and myself to discuss that further before we commit to that approach, but I'm tentatively including this in v1.9.0 because the ratio of pain relief to effort is very high, so I'd like to see us address it soon-ish.
Discussed in #5074
Originally posted by shamsalmon September 18, 2025
Git is extremely slow pulling from monorepos with large commit histories. I have determined the primary reason for this not directly repo size, but rather how many git log operations are being run and the history of the repo itself.
The main issue is with the logic defined here:
https://github.com/akuity/kargo/blob/main/internal/controller/git/work_tree.go#L395
There is no way to set filters within this work tree function. My proposal is to add several options here:
There are more potential improvements here, such as also making ExcludePaths transition into the pathspec format for git log.
More context. We've nailed down the root cause and it's this:
#5074 (comment)
This is the tentative solution:
I'd like @hiddeco and myself to discuss that further before we commit to that approach, but I'm tentatively including this in v1.9.0 because the ratio of pain relief to effort is very high, so I'd like to see us address it soon-ish.