Skip to content

Conversation

keshav-space
Copy link
Member

- Untracked file enumeration is a very costly operation for large git repo

Signed-off-by: Keshav Priyadarshi <[email protected]>
Copy link
Member

@JonoYang JonoYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keshav-space lgtm, i just have a small question


repo.index.add(files_to_commit)
repo.index.commit(textwrap.dedent(commit_message))
repo.git.commit(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keshav-space just wondering what the difference between repo.index.commit and repo.git.commit

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JonoYang repo.index is python abstraction of git while repo.git runs the native command line git. We switched from repo.index to repo.git for committing our changes because repo.index by default allows empty commits and there is no way to change this behavior. So we ended up using the native repo.git to disallow empty commits.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that git is now a system requirement that needs to be installed too. Please double check the docs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pombredanne we already have git as system requirement

git \

Signed-off-by: Keshav Priyadarshi <[email protected]>
@AyanSinhaMahapatra AyanSinhaMahapatra merged commit 198f365 into main Sep 30, 2025
15 checks passed
@AyanSinhaMahapatra AyanSinhaMahapatra deleted the donot-commit-empty branch September 30, 2025 22:07
AyanSinhaMahapatra pushed a commit that referenced this pull request Sep 30, 2025
…1888)

* Do not enumerate untracked files to compute commit message

- Untracked file enumeration is a very costly operation for large git repo

Signed-off-by: Keshav Priyadarshi <[email protected]>

* Set allow_empty to false to avoid empty commits

Signed-off-by: Keshav Priyadarshi <[email protected]>

* Bump minecode_pipelines to 0.0.1b8

Signed-off-by: Keshav Priyadarshi <[email protected]>

---------

Signed-off-by: Keshav Priyadarshi <[email protected]>
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.

4 participants