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

Add git_command_timeout_s for allowing >20 seconds for git operations #1250

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Once installed, extension behavior can be modified via the following settings wh
- `JupyterLabGit.credential_helper`: Git credential helper to set to cache the credentials.
The default value is `cache --timeout=3600` to cache the credentials for an hour. If you want to cache them for 10 hours, set `cache --timeout=36000`.
- `JupyterLabGit.excluded_paths`: Set path patterns to exclude from this extension. You can use wildcard and interrogation mark for respectively everything or any single character in the pattern.

- `JupyterLabGit.git_command_timeout_s`: Set the timeout for git operations. Defaults to 20 seconds.
<details>
<summary><b>How to set server settings?</b></summary>

Expand Down
11 changes: 10 additions & 1 deletion jupyterlab_git/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Initialize the backend server extension
"""
from traitlets import List, Dict, Unicode, default
from traitlets import CFloat, List, Dict, Unicode, default
from traitlets.config import Configurable

try:
Expand Down Expand Up @@ -46,10 +46,19 @@ class JupyterLabGit(Configurable):
config=True,
)

git_command_timeout = CFloat(
help="The timeout for executing git operations. By default it is set to 20 seconds.",
config=True,
)

@default("credential_helper")
def _credential_helper_default(self):
return "cache --timeout=3600"

@default("git_command_timeout")
def _git_command_timeout_default(self):
return 20.0


def _jupyter_server_extension_points():
return [{"module": "jupyterlab_git"}]
Expand Down
Loading