Skip to content

Commit a49a53a

Browse files
mdietz94fcollonval
andauthored
Add git_command_timeout_s for allowing >20 seconds for git operations (#1250)
* Add a new config value for git operation timeouts * Apply suggestions from code review Co-authored-by: Frédéric Collonval <[email protected]> --------- Co-authored-by: Frédéric Collonval <[email protected]>
1 parent f12b82c commit a49a53a

20 files changed

+829
-143
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Once installed, extension behavior can be modified via the following settings wh
114114
- `JupyterLabGit.credential_helper`: Git credential helper to set to cache the credentials.
115115
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`.
116116
- `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.
117-
117+
- `JupyterLabGit.git_command_timeout_s`: Set the timeout for git operations. Defaults to 20 seconds.
118118
<details>
119119
<summary><b>How to set server settings?</b></summary>
120120

jupyterlab_git/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Initialize the backend server extension
22
"""
3-
from traitlets import List, Dict, Unicode, default
3+
from traitlets import CFloat, List, Dict, Unicode, default
44
from traitlets.config import Configurable
55

66
try:
@@ -46,10 +46,19 @@ class JupyterLabGit(Configurable):
4646
config=True,
4747
)
4848

49+
git_command_timeout = CFloat(
50+
help="The timeout for executing git operations. By default it is set to 20 seconds.",
51+
config=True,
52+
)
53+
4954
@default("credential_helper")
5055
def _credential_helper_default(self):
5156
return "cache --timeout=3600"
5257

58+
@default("git_command_timeout")
59+
def _git_command_timeout_default(self):
60+
return 20.0
61+
5362

5463
def _jupyter_server_extension_points():
5564
return [{"module": "jupyterlab_git"}]

0 commit comments

Comments
 (0)