summaryrefslogtreecommitdiff
path: root/Documentation/git-sh-setup.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/git-sh-setup.txt')
-rw-r--r--Documentation/git-sh-setup.txt22
1 files changed, 19 insertions, 3 deletions
diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt
index 053df50..5e5f1c8 100644
--- a/Documentation/git-sh-setup.txt
+++ b/Documentation/git-sh-setup.txt
@@ -7,6 +7,7 @@ git-sh-setup - Common git shell script setup code
SYNOPSIS
--------
+[verse]
'. "$(git --exec-path)/git-sh-setup"'
DESCRIPTION
@@ -58,9 +59,24 @@ cd_to_toplevel::
runs chdir to the toplevel of the working tree.
require_work_tree::
- checks if the repository is a bare repository, and dies
- if so. Used by scripts that require working tree
- (e.g. `checkout`).
+ checks if the current directory is within the working tree
+ of the repository, and otherwise dies.
+
+require_work_tree_exists::
+ checks if the working tree associated with the repository
+ exists, and otherwise dies. Often done before calling
+ cd_to_toplevel, which is impossible to do if there is no
+ working tree.
+
+require_clean_work_tree <action> [<hint>]::
+ checks that the working tree and index associated with the
+ repository have no uncommitted changes to tracked files.
+ Otherwise it emits an error message of the form `Cannot
+ <action>: <reason>. <hint>`, and dies. Example:
++
+----------------
+require_clean_work_tree rebase "Please commit or stash them."
+----------------
get_author_ident_from_commit::
outputs code for use with eval to set the GIT_AUTHOR_NAME,