git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] git-sh-setup: make require_clean_work_tree part of the interface
@ 2011-12-20 11:09 Thomas Rast
  2011-12-20 11:09 ` [PATCH 2/2] Documentation: make git-sh-setup docs less scary Thomas Rast
  2011-12-20 19:25 ` [PATCH 1/2] git-sh-setup: make require_clean_work_tree part of the interface Junio C Hamano
  0 siblings, 2 replies; 10+ messages in thread
From: Thomas Rast @ 2011-12-20 11:09 UTC (permalink / raw)
  To: git

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>
---

Noticed while helping ribasushi on IRC.

 Documentation/git-sh-setup.txt |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt
index a2f346c..bbfefca 100644
--- a/Documentation/git-sh-setup.txt
+++ b/Documentation/git-sh-setup.txt
@@ -68,6 +68,15 @@ require_work_tree_exists::
 	cd_to_toplevel, which is impossible to do if there is no
 	working tree.
 
+require_clean_work_tree <action> [<hint>]::
+	checks if the working tree associated with the repository is
+	clean.  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.
-- 
1.7.8.484.gdad4270

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-12-20 22:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-20 11:09 [PATCH 1/2] git-sh-setup: make require_clean_work_tree part of the interface Thomas Rast
2011-12-20 11:09 ` [PATCH 2/2] Documentation: make git-sh-setup docs less scary Thomas Rast
2011-12-20 19:20   ` Junio C Hamano
2011-12-20 19:45   ` Ævar Arnfjörð Bjarmason
2011-12-20 20:27     ` Thomas Rast
2011-12-20 19:25 ` [PATCH 1/2] git-sh-setup: make require_clean_work_tree part of the interface Junio C Hamano
2011-12-20 20:29   ` [PATCH v2] " Thomas Rast
2011-12-20 20:52     ` Junio C Hamano
2011-12-20 21:42       ` [PATCH v3] " Thomas Rast
2011-12-20 22:05         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).