{"thread":{"id":"2883","subject":"[PATCH] cg-seek should not complain if run twice","startedAt":"2005-12-20T04:55:36Z","lastAt":"2006-01-15T23:59:19Z","messageCount":4,"participants":["Pavel Roskin","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"13834","messageId":"1135054536.3815.14.camel@dv","threadId":"2883","inReplyTo":null,"subject":"[PATCH] cg-seek should not complain if run twice","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-12-20T04:55:36Z","receivedAt":"2005-12-20T04:55:36Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"cg-seek complains if run without arguments in a non-seeked repository:\n\nrm: cannot remove `.git/refs/heads/cg-seek-point': No such file or directory\nrm: cannot remove `.git/head-name': No such file or directory\n\nIn fact, it's OK for those files not to exist, so they should be removed\nsilently.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\ndiff --git a/cg-seek b/cg-seek\nindex 942267f..8356593 100755\n--- a/cg-seek\n+++ b/cg-seek\n@@ -60,7 +60,7 @@ if [ \"$seek_mode\" = \"away\" ]; then\n \tgit-symbolic-ref HEAD \"refs/heads/cg-seek-point\"\n else\n \tgit-symbolic-ref HEAD \"refs/heads/$_git_head\"\n-\trm \"$_git/refs/heads/cg-seek-point\" \"$_git/head-name\"\n+\trm -f \"$_git/refs/heads/cg-seek-point\" \"$_git/head-name\"\n \trm -f \"$_git/blocked\"\n fi\n \n\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"14674","messageId":"20060114233037.GA28365@pasky.or.cz","threadId":"2883","inReplyTo":"1135054536.3815.14.camel@dv","subject":"Re: [PATCH] cg-seek should not complain if run twice","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-01-14T23:30:38Z","receivedAt":"2006-01-14T23:30:38Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Tue, Dec 20, 2005 at 05:55:36AM CET, I got a letter\nwhere Pavel Roskin <proski@gnu.org> said that...\n> cg-seek complains if run without arguments in a non-seeked repository:\n> \n> rm: cannot remove `.git/refs/heads/cg-seek-point': No such file or directory\n> rm: cannot remove `.git/head-name': No such file or directory\n> \n> In fact, it's OK for those files not to exist, so they should be removed\n> silently.\n> \n> Signed-off-by: Pavel Roskin <proski@gnu.org>\n\nIt seems cleaner to just make cg-seek fail with a sensible error message\nif it's already unseeked.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nOf the 3 great composers Mozart tells us what it's like to be human,\nBeethoven tells us what it's like to be Beethoven and Bach tells us\nwhat it's like to be the universe.  -- Douglas Adams\n"},{"id":"14680","messageId":"20060115010335.dj4swocs000k008o@webmail.spamcop.net","threadId":"2883","inReplyTo":"20060114233037.GA28365@pasky.or.cz","subject":"Re: [PATCH] cg-seek should not complain if run twice","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-01-15T06:03:35Z","receivedAt":"2006-01-15T06:03:35Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello, Petr!\n\nQuoting Petr Baudis <pasky@suse.cz>:\n\n> It seems cleaner to just make cg-seek fail with a sensible error message\n> if it's already unseeked.\n\nI don't like this.  What if \"cvs up -A\" would fail if run twice?  What if\ncg-clean would fail if there was nothing to clean?  What if sync would fail if\nit didn't cause a single disk write?  Idempotent operations are easier to work\nwith.  Please see http://en.wikipedia.org/wiki/Idempotent_(software)\n\nI could make an exception for the case when the command invocation indicates\nthat the user is unaware of something, and that it would endanger the user's\ndata.  But it's not the case for cg-seek without arguments on non-seeked\nrepository.  The intention is clear, and the knowledge of the current state of\nthe repository doesn't matter, since there will be no merge or something.\n\n--\nRegards,\nPavel Roskin\n"},{"id":"14702","messageId":"20060115235919.GF28365@pasky.or.cz","threadId":"2883","inReplyTo":"20060115010335.dj4swocs000k008o@webmail.spamcop.net","subject":"Re: [PATCH] cg-seek should not complain if run twice","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-01-15T23:59:19Z","receivedAt":"2006-01-15T23:59:19Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hello,\n\nDear diary, on Sun, Jan 15, 2006 at 07:03:35AM CET, I got a letter\nwhere Pavel Roskin <proski@gnu.org> said that...\n> Quoting Petr Baudis <pasky@suse.cz>:\n> \n> > It seems cleaner to just make cg-seek fail with a sensible error message\n> > if it's already unseeked.\n> \n> I don't like this.  What if \"cvs up -A\" would fail if run twice?  What if\n> cg-clean would fail if there was nothing to clean?  What if sync would fail if\n> it didn't cause a single disk write?  Idempotent operations are easier to work\n> with.  Please see http://en.wikipedia.org/wiki/Idempotent_(software)\n> \n> I could make an exception for the case when the command invocation indicates\n> that the user is unaware of something, and that it would endanger the user's\n> data.  But it's not the case for cg-seek without arguments on non-seeked\n> repository.  The intention is clear, and the knowledge of the current state of\n> the repository doesn't matter, since there will be no merge or something.\n\n  I have my reservations to this argumentation in the specific cg-seek\ncase, but it's very subjective, unclear, and I personally really don't\ncare. So let it be your way. ;-)\n\n  Thanks for your opinion,\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nOf the 3 great composers Mozart tells us what it's like to be human,\nBeethoven tells us what it's like to be Beethoven and Bach tells us\nwhat it's like to be the universe.  -- Douglas Adams\n"}]}