How do I disable the push command for only some repositories? #5538
Unanswered
jamesharris-garmin
asked this question in
Q&A
Replies: 1 comment 4 replies
-
|
Are you adding/deleting the gerrit remote dynamically, or is it just that some of your repos have one and others don't? If it's the latter, you can define a custom command specific to a given repo by putting it into a |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am a gerrit user/administrator and directly pushing to the branch I am working on is a bad idea, but I some times need to be able to do this so I can push history when mirroring repositories.
Is there a way to write a custom command that changes its behavior depending on the current state of the repository.
I would like a command that does the following:
if there is a remote named
gerritin the repository, push to the gerrit review as described in the custom commands section. Otherwise push directly.I assume this is possible with go templating but if someone has an example that would be fantastic.
One other use case for conditional language in custom command templates is this:
Say I use the tool git-review to publish a commit to gerrit. This tool automatically rebases your patches before pushing to gerrit. The automatic rebase behavior breaks if you are trying to push a merge commit (rebasing a merge makes no sense). So in those cases I have to pass the
-Rflag to push without a rebase.So I only want to push
-Rif I am not in a rebase.Part of this is I suck at ergonomic keyboard design in TUI or I would bind everything to a separate function or menu.
Beta Was this translation helpful? Give feedback.
All reactions