Skip to content

Commit

Permalink
git-sh-setup: make require_clean_work_tree part of the interface
Browse files Browse the repository at this point in the history
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 <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Thomas Rast authored and Junio C Hamano committed Dec 20, 2011
1 parent 92c62a3 commit d577cd2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Documentation/git-sh-setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ require_work_tree::
if so. Used by scripts that require working tree
(e.g. `checkout`).

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,
GIT_AUTHOR_EMAIL and GIT_AUTHOR_DATE variables for a given commit.
Expand Down

0 comments on commit d577cd2

Please sign in to comment.