-
Notifications
You must be signed in to change notification settings - Fork 210
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
Refactor generic git functions into git module #5863
Refactor generic git functions into git module #5863
Conversation
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.
If this is a prerequisite step for using the functions in other places then this looks good. If it stays like this then I am against at as functions that are only used once should be as close as possible where needed. We already discussed the possibility to keep the state within the object so that not every command needs to re-initialize or something
3d0878e
to
817053d
Compare
817053d
to
9196b67
Compare
We discussed a few things. As another improvement I suggest another helper. Instead of sub get_current_branch ($self) {
my @git = $self->_prepare_git_command();
my $r = run_cmd_with_log_return_error([@git, 'branch', '--show-current']); we could do sub _run_cmd ($self, $args) {
my @git = $self->_prepare_git_command();
return run_cmd_with_log_return_error([@git, @$args]);
}
...
sub get_current_branch ($self) {
my $r = $self->_run_cmd(['branch', '--show-current']); |
But the point of the ticket is to move all git functions to OpenQA::Git. if you are against this, we should have discussed this in the estimation. |
00ba185
to
b7e98c8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5863 +/- ##
=======================================
Coverage 98.51% 98.51%
=======================================
Files 395 395
Lines 38782 38797 +15
=======================================
+ Hits 38205 38220 +15
Misses 577 577 ☔ View full report in Codecov by Sentry. |
b7e98c8
to
a8b5d1b
Compare
a8b5d1b
to
6b3aa8c
Compare
6b3aa8c
to
81841da
Compare
81841da
to
301acc6
Compare
31cdf62
to
da8b9d7
Compare
da8b9d7
to
7029a9f
Compare
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.
Somehow git thinks I have started and never finished a review, so it's pending.
So I just try to submit it although I don't know what is still pending.
7029a9f
to
4f0feeb
Compare
- Minor fixes
4f0feeb
to
e7eb938
Compare
Refactor generic git related functions from OpenQA::Task::Git::Clone into the OpenQA::Git module for easier re-usability.
Related Ticket: 164886