{"thread":{"id":"10731","subject":"[PATCH 0/3] builtin-commit fixes","startedAt":"2007-11-08T12:14:59Z","lastAt":"2007-11-09T03:00:57Z","messageCount":13,"participants":["Johannes Schindelin","Johannes Sixt","Kristian Høgsberg","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"58868","messageId":"Pine.LNX.4.64.0711081213580.4362@racer.site","threadId":"10731","inReplyTo":null,"subject":"[PATCH 0/3] builtin-commit fixes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T12:14:59Z","receivedAt":"2007-11-08T12:14:59Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nThe following three commits are on top of kh/commit. With these 3 patches, \nthe test suite passes.\n\nCiao,\nDscho\n"},{"id":"58869","messageId":"Pine.LNX.4.64.0711081215140.4362@racer.site","threadId":"10731","inReplyTo":"Pine.LNX.4.64.0711081213580.4362@racer.site","subject":"[PATCH 1/3] builtin-commit: fix reflog message generation","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T12:15:26Z","receivedAt":"2007-11-08T12:15:26Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nInstead of strdup()ing, we can just reuse the buffer in which the\ncommit message is stored, and which is supposed to hold the reflog\nmessage anyway.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n builtin-commit.c |   15 ++++++++-------\n 1 files changed, 8 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex f108e90..bba9b82 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -488,7 +488,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \tint header_len, parent_count = 0;\n \tstruct strbuf sb;\n \tconst char *index_file, *reflog_msg;\n-\tchar *nl, *header_line;\n+\tchar *nl;\n \tunsigned char commit_sha1[20];\n \tstruct ref_lock *ref_lock;\n \n@@ -585,12 +585,13 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\t\t\t\t   0);\n \n \tnl = strchr(sb.buf + header_len, '\\n');\n-\theader_line = xstrndup(sb.buf + header_len,\n-\t\t\t       nl - (sb.buf + header_len));\n-\tstrbuf_release(&sb);\n-\tstrbuf_addf(&sb, \"%s: %s\\n\", reflog_msg, header_line);\n-\tstrbuf_addch(&sb, '\\0');\n-\tfree(header_line);\n+\tif (nl)\n+\t\tstrbuf_setlen(&sb, nl + 1 - sb.buf);\n+\telse\n+\t\tstrbuf_addch(&sb, '\\n');\n+\tstrbuf_remove(&sb, 0, header_len);\n+\tstrbuf_insert(&sb, 0, reflog_msg, strlen(reflog_msg));\n+\tstrbuf_insert(&sb, strlen(reflog_msg), \": \", 2);\n \n \tif (!ref_lock)\n \t\tdie(\"cannot lock HEAD ref\");\n-- \n1.5.3.5.1634.g0fa78\n"},{"id":"58870","messageId":"Pine.LNX.4.64.0711081215360.4362@racer.site","threadId":"10731","inReplyTo":"Pine.LNX.4.64.0711081213580.4362@racer.site","subject":"[PATCH 2/3] launch_editor(): read the file, even when EDITOR=:","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T12:15:48Z","receivedAt":"2007-11-08T12:15:48Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nEarlier we just returned in case EDITOR=: but the message stored\nin the file was not read back.  Fix this.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n builtin-tag.c |   21 ++++++++++-----------\n 1 files changed, 10 insertions(+), 11 deletions(-)\n\ndiff --git a/builtin-tag.c b/builtin-tag.c\nindex c3b76da..f5e0f8a 100644\n--- a/builtin-tag.c\n+++ b/builtin-tag.c\n@@ -20,7 +20,6 @@ static char signingkey[1000];\n void launch_editor(const char *path, struct strbuf *buffer)\n {\n \tconst char *editor, *terminal;\n-\tstruct child_process child;\n \tconst char *args[3];\n \n \teditor = getenv(\"GIT_EDITOR\");\n@@ -42,17 +41,17 @@ void launch_editor(const char *path, struct strbuf *buffer)\n \tif (!editor)\n \t\teditor = \"vi\";\n \n-\tif (!strcmp(editor, \":\"))\n-\t\treturn;\n+\tif (strcmp(editor, \":\")) {\n+\t\tstruct child_process child;\n+\t\tmemset(&child, 0, sizeof(child));\n+\t\tchild.argv = args;\n+\t\targs[0] = editor;\n+\t\targs[1] = path;\n+\t\targs[2] = NULL;\n \n-\tmemset(&child, 0, sizeof(child));\n-\tchild.argv = args;\n-\targs[0] = editor;\n-\targs[1] = path;\n-\targs[2] = NULL;\n-\n-\tif (run_command(&child))\n-\t\tdie(\"There was a problem with the editor %s.\", editor);\n+\t\tif (run_command(&child))\n+\t\t\tdie(\"There was a problem with the editor %s.\", editor);\n+\t}\n \n \tif (strbuf_read_file(buffer, path, 0) < 0)\n \t\tdie(\"could not read message file '%s': %s\",\n-- \n1.5.3.5.1634.g0fa78\n"},{"id":"58871","messageId":"Pine.LNX.4.64.0711081215540.4362@racer.site","threadId":"10731","inReplyTo":"Pine.LNX.4.64.0711081213580.4362@racer.site","subject":"[PATCH 3/3] builtin-commit: fix author date with --amend --author=<author>","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T12:16:07Z","receivedAt":"2007-11-08T12:16:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nWhen amending a commit with a new author, the author date is taken\nfrom the original commit.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n builtin-commit.c |   17 ++++++++++++++++-\n 1 files changed, 16 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex bba9b82..03f0b9d 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -278,7 +278,6 @@ static void determine_author_info(struct strbuf *sb)\n \t\t\tdie(\"malformed --author parameter\\n\");\n \t\tname = xstrndup(force_author, eoname - force_author);\n \t\temail = xstrndup(eoname + 2, eomail - eoname - 2);\n-\t\t/* REVIEW: drops author date from amended commit on --amend --author=<author> */\n \t\tstrbuf_addf(sb, \"author %s\\n\",\n \t\t\t    fmt_ident(name, email,\n \t\t\t\t      getenv(\"GIT_AUTHOR_DATE\"), 1));\n@@ -525,6 +524,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t} else if (amend) {\n \t\tstruct commit_list *c;\n \t\tstruct commit *commit;\n+\t\tconst char *author;\n \n \t\treflog_msg = \"commit (amend)\";\n \t\tcommit = lookup_commit(head_sha1);\n@@ -534,6 +534,21 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tfor (c = commit->parents; c; c = c->next)\n \t\t\tstrbuf_addf(&sb, \"parent %s\\n\",\n \t\t\t\t      sha1_to_hex(c->item->object.sha1));\n+\n+\t\t/* determine author date */\n+\t\tauthor = strstr(commit->buffer, \"\\nauthor\");\n+\t\tif (author && !memmem(commit->buffer,\n+\t\t\t\t\tauthor + 1 - commit->buffer,\n+\t\t\t\t\t\"\\n\\n\", 2)) {\n+\t\t\tconst char *email_end = strchr(author + 1, '>');\n+\t\t\tconst char *line_end = strchr(author + 1, '\\n');\n+\t\t\tif (email_end && line_end && email_end < line_end) {\n+\t\t\t\tchar *date = xstrndup(email_end + 1,\n+\t\t\t\t\tline_end - email_end - 1);\n+\t\t\t\tsetenv(\"GIT_AUTHOR_DATE\", date, 1);\n+\t\t\t\tfree(date);\n+\t\t\t}\n+\t\t}\n \t} else if (in_merge) {\n \t\tstruct strbuf m;\n \t\tFILE *fp;\n-- \n1.5.3.5.1634.g0fa78\n"},{"id":"58873","messageId":"47330222.7000206@viscovery.net","threadId":"10731","inReplyTo":"Pine.LNX.4.64.0711081215360.4362@racer.site","subject":"Re: [PATCH 2/3] launch_editor(): read the file, even when EDITOR=:","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2007-11-08T12:33:38Z","receivedAt":"2007-11-08T12:33:38Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> +\t\tstruct child_process child;\n> +\t\tmemset(&child, 0, sizeof(child));\n> +\t\tchild.argv = args;\n> +\t\targs[0] = editor;\n> +\t\targs[1] = path;\n> +\t\targs[2] = NULL;\n>  \n> +\t\tif (run_command(&child))\n\nYou can shorten this to\n\n\t\tconst char *args[] = { editor, path, NULL };\n\t\tif (run_command_v_opt(args, 0))\n\n(and possibly remove 'args' that is in the surrounding block).\n\n-- Hannes\n"},{"id":"58888","messageId":"Pine.LNX.4.64.0711081406280.4362@racer.site","threadId":"10731","inReplyTo":"47330222.7000206@viscovery.net","subject":"[PATCH REPLACING 2/3] launch_editor(): read the file, even when EDITOR=:","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T14:06:52Z","receivedAt":"2007-11-08T14:06:52Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nEarlier we just returned in case EDITOR=: but the message stored\nin the file was not read back.  Fix this, at the same time\nsimplifying the code as suggested by Johannes Sixt.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n builtin-tag.c |   17 +++++------------\n 1 files changed, 5 insertions(+), 12 deletions(-)\n\ndiff --git a/builtin-tag.c b/builtin-tag.c\nindex c3b76da..86d8121 100644\n--- a/builtin-tag.c\n+++ b/builtin-tag.c\n@@ -20,8 +20,6 @@ static char signingkey[1000];\n void launch_editor(const char *path, struct strbuf *buffer)\n {\n \tconst char *editor, *terminal;\n-\tstruct child_process child;\n-\tconst char *args[3];\n \n \teditor = getenv(\"GIT_EDITOR\");\n \tif (!editor && editor_program)\n@@ -42,17 +40,12 @@ void launch_editor(const char *path, struct strbuf *buffer)\n \tif (!editor)\n \t\teditor = \"vi\";\n \n-\tif (!strcmp(editor, \":\"))\n-\t\treturn;\n+\tif (strcmp(editor, \":\")) {\n+\t\tconst char *args[] = { editor, path, NULL };\n \n-\tmemset(&child, 0, sizeof(child));\n-\tchild.argv = args;\n-\targs[0] = editor;\n-\targs[1] = path;\n-\targs[2] = NULL;\n-\n-\tif (run_command(&child))\n-\t\tdie(\"There was a problem with the editor %s.\", editor);\n+\t\tif (run_command_v_opt(args, 0))\n+\t\t\tdie(\"There was a problem with the editor %s.\", editor);\n+\t}\n \n \tif (strbuf_read_file(buffer, path, 0) < 0)\n \t\tdie(\"could not read message file '%s': %s\",\n-- \n1.5.3.5.1634.g0fa78\n"},{"id":"58889","messageId":"Pine.LNX.4.64.0711081414160.4362@racer.site","threadId":"10731","inReplyTo":"Pine.LNX.4.64.0711081213580.4362@racer.site","subject":"[PATCH 4/3] t3700: avoid racy git situation","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T14:14:37Z","receivedAt":"2007-11-08T14:14:37Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nWow, the builtin commit is fast.  It sometimes triggers a racy\nsituation in the test case for \"git add --refresh -- foo\".\n\nSo when that test fails, simply sleep one second and try again.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t3700-add.sh |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex a328bf5..f4950a3 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -152,7 +152,12 @@ test_expect_success 'git add --refresh' '\n \t*) echo fail; (exit 1);;\n \tesac &&\n \tgit add --refresh -- foo &&\n-\ttest -z \"`git diff-index HEAD -- foo`\"\n+\ttest -z \"`git diff-index HEAD -- foo`\" || {\n+\t\techo Sleeping one second to avoid racy situation &&\n+\t\tsleep 1 &&\n+\t\tgit add --refresh -- foo &&\n+\t\ttest -z \"`git diff-index HEAD -- foo`\"\n+\t}\n '\n \n test_done\n-- \n1.5.3.5.1634.g0fa78\n"},{"id":"58894","messageId":"47331E65.9010209@viscovery.net","threadId":"10731","inReplyTo":"Pine.LNX.4.64.0711081414160.4362@racer.site","subject":"Re: [PATCH 4/3] t3700: avoid racy git situation","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2007-11-08T14:34:13Z","receivedAt":"2007-11-08T14:34:13Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> Wow, the builtin commit is fast.  It sometimes triggers a racy\n> situation in the test case for \"git add --refresh -- foo\".\n> \n> So when that test fails, simply sleep one second and try again.\n\n[/me looks at the calender - no, it's not April Fool's day]\n\nWouldn't it be better to fix git-commit (or git-add)? I would like to help, \nbut you already seem to have done the analysis, so...\n\n-- Hannes\n"},{"id":"58902","messageId":"Pine.LNX.4.64.0711081511440.4362@racer.site","threadId":"10731","inReplyTo":"47331E65.9010209@viscovery.net","subject":"Re: [PATCH 4/3] t3700: avoid racy git situation","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T15:16:17Z","receivedAt":"2007-11-08T15:16:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 8 Nov 2007, Johannes Sixt wrote:\n\n> Johannes Schindelin schrieb:\n> > Wow, the builtin commit is fast.  It sometimes triggers a racy\n> > situation in the test case for \"git add --refresh -- foo\".\n> > \n> > So when that test fails, simply sleep one second and try again.\n> \n> [/me looks at the calender - no, it's not April Fool's day]\n\nNo. The builtin commit is really that fast.\n\n> Wouldn't it be better to fix git-commit (or git-add)? I would like to \n> help, but you already seem to have done the analysis, so...\n\nThe problem is that the index has the same timestamp as the file \"foo\".\n\nTherefore, git cannot tell if \"foo\" is up-to-date in the index, since it \ncould have been modified (and indeed is) just a fraction of a second later \nthan the index was last updated.\n\nAnd since diff-index, as called from the test script, does not generate a \ndiff, but really only determines if the index information suggests that \nthe files are up-to-date, there is not really much you can do.\n\nThis is our good old friend, the racy git problem.\n\nNOTE: other scms do not have this problem, mostly because they are too \nslow to trigger it.\n\nCiao,\nDscho\n"},{"id":"58908","messageId":"1194535631.27305.3.camel@hinata.boston.redhat.com","threadId":"10731","inReplyTo":"Pine.LNX.4.64.0711081511440.4362@racer.site","subject":"Re: [PATCH 4/3] t3700: avoid racy git situation","fromName":"Kristian Høgsberg","fromEmail":"krh@redhat.com","sentAt":"2007-11-08T15:27:11Z","receivedAt":"2007-11-08T15:27:11Z","isPatch":true,"sender":{"key":"krh@redhat.com","avatar":"https://gravatar.com/avatar/763dee6f9594ac474f725b137a39565792928e583ddf59b32befc2907409027e?d=mp&s=160"},"body":"On Thu, 2007-11-08 at 15:16 +0000, Johannes Schindelin wrote:\n> Hi,\n> \n> On Thu, 8 Nov 2007, Johannes Sixt wrote:\n> \n> > Johannes Schindelin schrieb:\n> > > Wow, the builtin commit is fast.  It sometimes triggers a racy\n> > > situation in the test case for \"git add --refresh -- foo\".\n> > > \n> > > So when that test fails, simply sleep one second and try again.\n> > \n> > [/me looks at the calender - no, it's not April Fool's day]\n> \n> No. The builtin commit is really that fast.\n> \n> > Wouldn't it be better to fix git-commit (or git-add)? I would like to \n> > help, but you already seem to have done the analysis, so...\n> \n> The problem is that the index has the same timestamp as the file \"foo\".\n> \n> Therefore, git cannot tell if \"foo\" is up-to-date in the index, since it \n> could have been modified (and indeed is) just a fraction of a second later \n> than the index was last updated.\n> \n> And since diff-index, as called from the test script, does not generate a \n> diff, but really only determines if the index information suggests that \n> the files are up-to-date, there is not really much you can do.\n> \n> This is our good old friend, the racy git problem.\n> \n> NOTE: other scms do not have this problem, mostly because they are too \n> slow to trigger it.\n\nAh, so that's what that was.  Thanks for fixing that, I wasn't sure what\nwas going on and didn't have the time to dig into it.  I have a patch\nthat fixes the author date for commit in determine_author_info() instead\nand fixes some of the option validation problems mentioned by Björn.  I\nhave an updated launch_editor patch too, but what you sent out looks\ngood, so I'll just send the latest builtin-commit.\n\ncheers,\nKristian\n"},{"id":"58910","messageId":"47332F37.5090402@viscovery.net","threadId":"10731","inReplyTo":"Pine.LNX.4.64.0711081511440.4362@racer.site","subject":"Re: [PATCH 4/3] t3700: avoid racy git situation","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2007-11-08T15:45:59Z","receivedAt":"2007-11-08T15:45:59Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> The problem is that the index has the same timestamp as the file \"foo\".\n> \n> Therefore, git cannot tell if \"foo\" is up-to-date in the index, since it \n> could have been modified (and indeed is) just a fraction of a second later \n> than the index was last updated.\n\nThe test goes like this:\n\n         >foo && git add foo && git commit -a -m \"commit all\" &&\n         test -z \"`git diff-index HEAD -- foo`\" &&\n         git read-tree HEAD &&\n         case \"`git diff-index HEAD -- foo`\" in\n         :100644\" \"*\"M   foo\") echo ok;;\n         *) echo fail; (exit 1);;\n         esac &&\n         git add --refresh -- foo &&\n         test -z \"`git diff-index HEAD -- foo`\"\n\nI'm pretty sure that this test completed within one second even before \ngit-commit was a builtin. (I assume that timestamps don't have sub-second \nresolution.) Why then didn't this racy-git problem occur with the scripted \ngit-commit?\n\n-- Hannes\n"},{"id":"58932","messageId":"7vbqa431vj.fsf@gitster.siamese.dyndns.org","threadId":"10731","inReplyTo":"Pine.LNX.4.64.0711081511440.4362@racer.site","subject":"Re: [PATCH 4/3] t3700: avoid racy git situation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-08T20:42:40Z","receivedAt":"2007-11-08T20:42:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> The problem is that the index has the same timestamp as the file \"foo\".\n>\n> Therefore, git cannot tell if \"foo\" is up-to-date in the index, since it \n> could have been modified (and indeed is) just a fraction of a second later \n> than the index was last updated.\n>\n> And since diff-index, as called from the test script, does not generate a \n> diff, but really only determines if the index information suggests that \n> the files are up-to-date, there is not really much you can do.\n>\n> This is our good old friend, the racy git problem.\n\nThat sounds very wrong.\n\nWhat happened to the ce_smudge_racily_clean_entry() call that is\ndone from write_index()?\n\n> NOTE: other scms do not have this problem, mostly because they are too \n> slow to trigger it.\n\nI recall racy-hg mentioned on their development list twice, a\nfew months apart, and CVS has the \"delay the return from a\ncommit to the next full second\" or something to work around\nproblems in the timestamp recorded in CVS/Entries.\n"},{"id":"58986","messageId":"Pine.LNX.4.64.0711090258530.4362@racer.site","threadId":"10731","inReplyTo":"7vbqa431vj.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 4/3] t3700: avoid racy git situation","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-09T03:00:57Z","receivedAt":"2007-11-09T03:00:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 8 Nov 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > The problem is that the index has the same timestamp as the file \"foo\".\n> >\n> > Therefore, git cannot tell if \"foo\" is up-to-date in the index, since \n> > it could have been modified (and indeed is) just a fraction of a \n> > second later than the index was last updated.\n> >\n> > And since diff-index, as called from the test script, does not \n> > generate a diff, but really only determines if the index information \n> > suggests that the files are up-to-date, there is not really much you \n> > can do.\n> >\n> > This is our good old friend, the racy git problem.\n> \n> That sounds very wrong.\n> \n> What happened to the ce_smudge_racily_clean_entry() call that is\n> done from write_index()?\n\nAnd sure enough I am wrong.  My patch assumes that it was the second \ndiff-index which failed, the one after \"git add --refresh\".\n\nAlas, in shell \"a && b && c && d || e\" will execute e if a fails.  So \nafter debugging this a bit more carefully, it seems that it is indeed the \nmissing update_index --refresh that Kristian mentioned, which leads to \nthis error.\n\nAnd my patch is wrong.\n\nCiao,\nDscho\n"}]}