-
Notifications
You must be signed in to change notification settings - Fork 328
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
Push Remote Branch Based on Git Config #412
Conversation
@jhamet93 thx for working on this. Could you please add unit tests for this? |
Check config options for remote branch Only fetch top level path if upstream not set
9fe18af
to
cce0506
Compare
I rebooted this PR with the following behavior: If the branch has no upstream:
Some side actions:
|
Returns: | ||
List[str]: Known remotes | ||
""" | ||
command = ["git", "remote", "show"] |
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.
Does it make sense to instead use git remote -v show
here? As some future proofing of this function in case it is ever used to determine URLs or do something with determining fetch vs push urls?
For me git remote show
:
origin
upstream
vs git remote -v show
:
origin [email protected]:ianhi/jupyterlab-git.git (fetch)
origin [email protected]:ianhi/jupyterlab-git.git (push)
upstream [email protected]:jupyterlab/jupyterlab-git.git (fetch)
upstream [email protected]:jupyterlab/jupyterlab-git.git (push)
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.
For now I'll stick to current behavior as there is no feature requiring more information.
Thanks @ianhi for looking into this |
@fcollonval if I were to more fully review this could that qualify as adequate for merging? This is a great change that I would love to see in the extension. FWIW I currently seem to have achieved stronger permissions by being added to jupyterlab-triage: |
Hey @ianhi thank you for your time. Yes definitely if you could review this, that will be great. |
Are there any guidelines for what is involved in doing that? I certainly should check to make sure it does not break anything or doing anything terribly misguided - but beyond that anything specific? |
I usually do the following:
|
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.
@fcollonval I think that there are non-trivial conflicts following the merge of #691 which also affected the usage of the remote determining commands. Are you able to fix them? If not I can as I definitely feel a little guilty for having caused of these conflicts...
# TODO: once https://github.com/jupyterlab/jupyterlab-git/pull/630 is merged | ||
# because this has implication on credentials request in the frontend | ||
# if response["code"] != 0: | ||
# self.set_status(500) |
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.
Bump of this now that #630 was merged
Would love this to be approved and merged 👍 |
* Fresh rebase of #412 * Add Python logger * Correct api response handling for push/pull/tag * Reverse tag order to put newer on top * Fix Python 3.5 error
Superseeded by #721 |
Currently, a user needs to set the upstream tracking branch explicitly before being allowed to push. However, there exist configuration options that can be set in the git configuration that automatically infers the remote branch to push to.
This change takes those options into account to not fail
git push
if the configuration options are present. This helps open up the workflow for less experienced git users to be able to perform the actions in their workflow strictly via the extension with no intervention needed in the CLI.