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
cli: new --base
option for git-*
commands
#419
cli: new --base
option for git-*
commands
#419
Conversation
6f25cb7
to
b4ddc50
Compare
reana/reana_dev/git.py
Outdated
default="master", | ||
help="Against which git base branch are we working? [master]", | ||
) | ||
def git_create_release_commit(component, base, next_version=None): |
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.
Is there a reason to add a click decorator to a normal function? I expected the following without decorator:
def git_create_release_commit(component, base, next_version=None): | |
def git_create_release_commit(component, base="master", next_version=None): |
reana/reana_dev/git.py
Outdated
@@ -569,12 +638,17 @@ def git_checkout(branch, fetch): # noqa: D301 | |||
@click.option( | |||
"--branch", "-b", nargs=2, multiple=True, help="Which PR? [component PR#]" | |||
) | |||
@click.option( |
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.
What do you think about centralising this option like add_workflow_option
in REANA-Client?
Do you think it would make sense to add the default branch value to config? I don't see why we would change it ever.. but at least it would be centralised.
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.
All updated. I have also improved reporting in case base branch does not exist in origin/upstream. Example:
$ reana-dev git-status -c r-a-vomsproxy -s --base maint-0.7
ERROR: Branch upstream/maint-0.7 does not exist.
reana-auth-vomsproxy @ master @ a315022 release: v1.0.0
b4ddc50
to
45ff4e3
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.
LGTM, not tested locally yet.
reana/reana_dev/utils.py
Outdated
def is_feature_branch(component): | ||
"""Check whether component current branch is different from master.""" | ||
return get_current_branch(get_srcdir(component)) != "master" | ||
def is_feature_branch(component, base="master"): |
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.
def is_feature_branch(component, base="master"): | |
def is_feature_branch(component, base=GIT_DEFAULT_BASE_BRANCH): |
ad4ebbd
to
1c22b37
Compare
Adds new `--base` option to all `git-*` commands to facilitate working against different git base branch, such as `maint-0.7`. Adds new command `git-checkout` that allows to switch branches in many components at one ago. Renames old `git-checkout` to `git-checkout-pr` accordingly. Fixes some parallel flake8-discovered warnings. Closes reanahub#413. Signed-off-by: Tibor Šimko <tibor.simko@cern.ch>
1c22b37
to
cda0a84
Compare
Adds new
--base
option to allgit-*
commands to facilitate workingagainst different git base branch, such as
maint-0.7
.Adds new command
git-checkout
that allows to switch branches in manycomponents at one ago.
Renames old
git-checkout
togit-checkout-pr
accordingly.Fixes some parallel flake8-discovered warnings.
Closes #413.
Signed-off-by: Tibor Šimko tibor.simko@cern.ch