From: Thomas Rast Date: Tue, 20 Dec 2011 21:42:39 +0000 (+0100) Subject: git-sh-setup: make require_clean_work_tree part of the interface X-Git-Tag: v1.7.8.2~4^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d577cd216e0adb9cbc726dddd1a0858b4ab4e6e3;p=git.git git-sh-setup: make require_clean_work_tree part of the interface 92c62a3 (Porcelain scripts: Rewrite cryptic "needs update" error message, 2010-10-19) refactored git's own checking to a function in git-sh-setup. This is a very useful thing for script writers, so document it. Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt index 3da241304..76856633a 100644 --- a/Documentation/git-sh-setup.txt +++ b/Documentation/git-sh-setup.txt @@ -62,6 +62,16 @@ require_work_tree:: if so. Used by scripts that require working tree (e.g. `checkout`). +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.