From: Junio C Hamano Date: Thu, 22 Dec 2011 23:30:29 +0000 (-0800) Subject: Merge branch 'tr/doc-sh-setup' X-Git-Tag: v1.7.9-rc0~14 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f0ede8435ab161b3aba3e5e306239d6bd74dd9b8;p=git.git Merge branch 'tr/doc-sh-setup' * tr/doc-sh-setup: git-sh-setup: make require_clean_work_tree part of the interface --- f0ede8435ab161b3aba3e5e306239d6bd74dd9b8 diff --cc Documentation/git-sh-setup.txt index a2f346ca7,76856633a..5e5f1c896 --- a/Documentation/git-sh-setup.txt +++ b/Documentation/git-sh-setup.txt @@@ -59,15 -58,20 +59,25 @@@ 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.