diff options
author | Mike Frysinger <vapier@google.com> | 2018-04-26 07:57:46 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-04-26 07:57:46 +0000 |
commit | 8d4b106642d0725f7f649ca5f407b2f8791483ef (patch) | |
tree | 2ff4d47bce7cd9b15f74a5987387194953f80893 /docs | |
parent | 0f2e45a3a69e9a99d91ed26768b82e3454aa8630 (diff) | |
parent | ed429c9f6f49fbb52d74daaccf8ed9859efefa28 (diff) | |
download | git-repo-8d4b106642d0725f7f649ca5f407b2f8791483ef.tar.gz |
Merge "docs: repo-hooks: fix cwd details"
Diffstat (limited to 'docs')
-rw-r--r-- | docs/repo-hooks.md | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/docs/repo-hooks.md b/docs/repo-hooks.md index c8eb945f..76113cc9 100644 --- a/docs/repo-hooks.md +++ b/docs/repo-hooks.md | |||
@@ -61,9 +61,14 @@ not be too verbose. A short summary is nice, and some status information when | |||
61 | long running operations occur, but long/verbose output should be used only if | 61 | long running operations occur, but long/verbose output should be used only if |
62 | the hook ultimately fails. | 62 | the hook ultimately fails. |
63 | 63 | ||
64 | The hook runs from the top level of the git repo where the operation is started. | 64 | The hook runs from the top level of the repo client where the operation is |
65 | e.g. If you're in the git repo `src/foo/`, that is where the hook runs, even if | 65 | started. |
66 | the `repo` command was started from a subdir like `src/foo/bar/`. | 66 | For example, if the repo client is under `~/tree/`, then that is where the hook |
67 | runs, even if you ran repo in a git repository at `~/tree/src/foo/`, or in a | ||
68 | subdirectory of that git repository in `~/tree/src/foo/bar/`. | ||
69 | Hooks frequently start off by doing a `os.chdir` to the specific project they're | ||
70 | called on (see below) and then changing back to the original dir when they're | ||
71 | finished. | ||
67 | 72 | ||
68 | Python's `sys.path` is modified so that the top of repohooks directory comes | 73 | Python's `sys.path` is modified so that the top of repohooks directory comes |
69 | first. This should help simplify the hook logic to easily allow importing of | 74 | first. This should help simplify the hook logic to easily allow importing of |