From: Junio C Hamano Date: Tue, 20 Dec 2011 19:25:01 GMT Subject: Re: [PATCH 1/2] git-sh-setup: make require_clean_work_tree part of the interface Message-ID: <7vwr9rjbaq.fsf@alter.siamese.dyndns.org> In-Reply-To: Thomas Rast writes: > 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. Can we avoid explaining "clean" with the same word "clean", which adds no new information? IOW, what does "clean" mean in the context of this helper shell function? No untracked cruft? No un-added changes? What are the kind of dirtiness being checked? > +require_clean_work_tree []:: > + checks if the working tree associated with the repository is > + clean. 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.