Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils.git.Commit: leverage user's cache to get commit file paths #50

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

sebalix
Copy link
Collaborator

@sebalix sebalix commented Aug 19, 2024

And do not fetch file paths when initializing Commit objects, wait for the first access to Commit.files or Commit.paths attributes to avoid useless IO.

Requesting files modified by a commit is taking quite a lot of time by git, especially on big repositories (basically git show --stat).

Before this change, the following command is taking about ~2min to execute in OCA/wms repository (with others cache already built):

$ oca-port 14.0 16.0 stock_warehouse_flow --verbose

After, it takes ~2s.

oca_port/utils/cache.py Outdated Show resolved Hide resolved
And avoid useless IO:
    - do not fetch file paths when initializing Commit objects, wait for
      the first access to Commit.files or Commit.paths attributes
    - save cached data on disk at the end of the analyze
@sebalix sebalix force-pushed the imp-commits-data-cache branch 2 times, most recently from abdb7ee to 70c19b0 Compare August 20, 2024 13:07
@sebalix sebalix marked this pull request as ready for review August 20, 2024 13:13
@sebalix sebalix merged commit 25a21e5 into OCA:main Aug 20, 2024
5 checks passed
@sebalix sebalix deleted the imp-commits-data-cache branch August 20, 2024 15:12
@sebalix sebalix added this to the 0.16 milestone Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant