X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Fgit-sh-setup.txt;h=5e5f1c89646cf4389bfd30ba8e90eb0552e80aab;hb=38ca63f3c0ef70ba4e41d3b5e347e2c7e7d67fe5;hp=3da241304b0d2fdaa376bca740beb024a36b2cb6;hpb=03f94ae9f909952ed5a78917ab319a312889354b;p=git.git diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt index 3da241304..5e5f1c896 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,23 +59,29 @@ 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 []:: + 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 + : . `, 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, GIT_AUTHOR_EMAIL and GIT_AUTHOR_DATE variables for a given commit. - -Author ------- -Written by Linus Torvalds - -Documentation --------------- -Documentation by Junio C Hamano and the git-list . - GIT --- Part of the linkgit:git[1] suite