git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] cg-update - refuse to update dirty tree

From
MLMartin Langhoff <martin@catalyst.net.nz>
Date
Aug 30, 2005, 09:37 UTC
Message-ID
<11253946482734-git-send-email-martin@catalyst.net.nz>

cg-merge currently clobbers local changes while runnign cg-update. Do the safe thing and refuse to update on a dirty tree.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
---
 cg-update |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
7a961c02ee6228c2a80869b4b3f179a7e279df8e
diff --git a/cg-update b/cg-update
--- a/cg-update
+++ b/cg-update
@@ -27,6 +27,10 @@ while optparse; do
 	fi
 done
 
+# Better safe than sorry
+(git-update-cache --refresh >> /dev/null) ||
+        die "Your working tree is dirty - will not update."
+
 name=${ARGS[0]}
 [ "$name" ] || { [ -s $_git/refs/heads/origin ] && name=origin; }
 [ "$name" ] || die "where to update from?"
Message 1 of 1 in “cg-update - refuse to update dirty tree”
  1. cg-update - refuse to update dirty treeMartin Langhoff, Aug 30, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.