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

[PATCH] cg-seek should not complain if run twice

From
PRPavel Roskin <proski@gnu.org>
Date
Dec 20, 2005, 04:55 UTC
Message-ID
<1135054536.3815.14.camel@dv>
cg-seek complains if run without arguments in a non-seeked repository:

rm: cannot remove `.git/refs/heads/cg-seek-point': No such file or directory rm: cannot remove `.git/head-name': No such file or directory

In fact, it's OK for those files not to exist, so they should be removed silently.

Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/cg-seek b/cg-seek
index 942267f..8356593 100755
--- a/cg-seek
+++ b/cg-seek
@@ -60,7 +60,7 @@ if [ "$seek_mode" = "away" ]; then
 	git-symbolic-ref HEAD "refs/heads/cg-seek-point"
 else
 	git-symbolic-ref HEAD "refs/heads/$_git_head"
-	rm "$_git/refs/heads/cg-seek-point" "$_git/head-name"
+	rm -f "$_git/refs/heads/cg-seek-point" "$_git/head-name"
 	rm -f "$_git/blocked"
 fi
 
-- 
Regards,
Pavel Roskin
Next: Petr Baudis
Message 1 of 4 in “cg-seek should not complain if run twice”
  1. cg-seek should not complain if run twicePavel Roskin, Dec 20, 2005
  2. Petr BaudisJan 14, 2006
  3. Pavel RoskinJan 15, 2006
  4. Petr BaudisJan 15, 2006

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.