-
-
Notifications
You must be signed in to change notification settings - Fork 116
Avoid creating empty commits when pushing changes to FederatedCode #1888
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
Conversation
- Untracked file enumeration is a very costly operation for large git repo Signed-off-by: Keshav Priyadarshi <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>
There was a problem hiding this 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( |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Line 66 in 5e4aff9
git \ |
5935d48
to
781420b
Compare
Signed-off-by: Keshav Priyadarshi <[email protected]>
781420b
to
14e2c9f
Compare
…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]>
Related: aboutcode-org/purldb#667 and aboutcode-org/purldb#721