Skip to content
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

fetchers: disable prompt usage by git #84

Merged
merged 1 commit into from
Oct 31, 2023
Merged

Conversation

rshym
Copy link
Contributor

@rshym rshym commented Oct 25, 2023

This commit addresses issue with git interacting with the user through the console. For example, HTTPS access to the private repo.
We use git inside the console, that is hidden from the user, so user see only hanging fetch.

So, we instruct the git to not interact with the user by the command GIT_TERMINAL_PROMPT=0. As result, git fails cloning and inform user that asking name/password is not possible.
This should push the user to use script-friendly authorization, like ssh.

Suggested-by: Artem Mygaiev [email protected]

@rshym
Copy link
Contributor Author

rshym commented Oct 25, 2023

Tested with https access to the private repo.

FAILED: yocto/test 
GIT_SSH_COMMAND='ssh -o BatchMode=yes' GIT_TERMINAL_PROMPT=0 git clone -q https://github.com/rshym/test.git yocto/test && touch yocto/test
fatal: could not read Username for 'https://github.com': terminal prompts disabled
ninja: build stopped: subcommand failed.

@rshym rshym force-pushed the mr_prompt branch 2 times, most recently from 4ca8759 to 1ffa33f Compare October 31, 2023 06:10
@rshym
Copy link
Contributor Author

rshym commented Oct 31, 2023

Rebased on the latest changes.

@lorc
Copy link
Collaborator

lorc commented Oct 31, 2023

Thanks
Reviewed-by: Volodymyr Babchuk <[email protected]>

This commit addresses issue with git interacting with
the user through the console. For example, HTTPS access
to the private repo.
We use git inside the hidden console, so user sees only
hanging fetch.

So, we instruct the git to not interact with the user by the command
`GIT_TERMINAL_PROMPT=0`. As result, git fails cloning and inform
user that asking name/password is not possible.
This should push the user to use script-friendly authorization,
like ssh.

Suggested-by: Artem Mygaiev <[email protected]>
Signed-off-by: Ruslan Shymkevych <[email protected]>
Reviewed-by: Volodymyr Babchuk <[email protected]>
@rshym
Copy link
Contributor Author

rshym commented Oct 31, 2023

Ack is added.
Tested.
Ready to merge.

@lorc lorc merged commit fb89274 into xen-troops:main Oct 31, 2023
1 check passed
@rshym rshym deleted the mr_prompt branch October 31, 2023 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants