{"thread":{"id":"15115","subject":"[BUG] pull faulty 'not uptodate'","startedAt":"2008-08-20T21:00:42Z","lastAt":"2008-08-20T22:35:11Z","messageCount":7,"participants":["Pieter de Bie","Junio C Hamano","Miklos Vajna"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"87875","messageId":"1508D1DF-EDE7-4A64-B354-E2F26578E24D@ai.rug.nl","threadId":"15115","inReplyTo":null,"subject":"[BUG] pull faulty 'not uptodate'","fromName":"Pieter de Bie","fromEmail":"pdebie@ai.rug.nl","sentAt":"2008-08-20T21:00:42Z","receivedAt":"2008-08-20T21:00:42Z","isPatch":false,"sender":{"key":"pdebie@ai.rug.nl","avatar":null},"body":"Hi,\n\nI think git pull does not refresh the index before trying to merge:\n\nTirana:gitbot pieter$ git reset --hard 5ff4dff\nHEAD is now at 5ff4dff Add a Git FAQ plugin\nTirana:gitbot pieter$ touch test/gitfaq.rb\nTirana:gitbot pieter$ git pull\nUpdating 5ff4dff..931a247\nerror: Entry 'test/gitfaq.rb' not uptodate. Cannot merge.\nTirana:gitbot pieter$ git st\n# On branch master\n# Your branch is behind 'origin/master' by 2 commits, and can be fast- \nforwarded.\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#\tGitLink.py\n#\tfaq.yaml\n#\ttest.py\nnothing added to commit but untracked files present (use \"git add\" to  \ntrack)\nTirana:gitbot pieter$ git pull\nUpdating 5ff4dff..931a247\nFast forward\n  plugins/gitfaq.rb  |   46 ++++++++++++++++++++++--------------------\n  plugins/irc.rb     |   56 +++++++++++++++++++++++++ \n+-------------------------\n  test/faq-test.html |   10 +++++++++\n  test/gitfaq.rb     |   42 +++++++++++++++++++-------------------\n  4 files changed, 84 insertions(+), 70 deletions(-)\n  create mode 100644 test/faq-test.html\n"},{"id":"87883","messageId":"7v7iabpejv.fsf@gitster.siamese.dyndns.org","threadId":"15115","inReplyTo":"1508D1DF-EDE7-4A64-B354-E2F26578E24D@ai.rug.nl","subject":"Re: [BUG] pull faulty 'not uptodate'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-20T21:22:28Z","receivedAt":"2008-08-20T21:22:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pieter de Bie <pdebie@ai.rug.nl> writes:\n\n> I think git pull does not refresh the index before trying to merge:\n\nYeah, that is another regression from C rewrite.  Thanks for reporting.\n\nBut I also have to wonder why a git-list regular like you are reporting\nthis _long after_ v1.6.0-rc1 was released.  Perhaps this is not really a\nbig-deal bug spelled in capital letters like you have on your Subject\nline?\n"},{"id":"87889","messageId":"EAFC48F0-5512-4A83-B9B2-44FF53319285@ai.rug.nl","threadId":"15115","inReplyTo":"7v7iabpejv.fsf@gitster.siamese.dyndns.org","subject":"Re: [bug] pull faulty 'not uptodate'","fromName":"Pieter de Bie","fromEmail":"pdebie@ai.rug.nl","sentAt":"2008-08-20T21:29:35Z","receivedAt":"2008-08-20T21:29:35Z","isPatch":false,"sender":{"key":"pdebie@ai.rug.nl","avatar":null},"body":"\nOn Aug 20, 2008, at 11:22 PM, Junio C Hamano wrote:\n> But I also have to wonder why a git-list regular like you are  \n> reporting\n> this _long after_ v1.6.0-rc1 was released.  Perhaps this is not  \n> really a\n> big-deal bug spelled in capital letters like you have on your Subject\n> line?\n\nI just noticed it and wanted to report it. I thought the usual way to  \ndo this is to put [BUG] in the subject line. If that is not the common  \nway to report bugs, I'm sorry. I can also downcase it ;)\n\n- Pieter\n"},{"id":"87890","messageId":"7vy72rnyor.fsf@gitster.siamese.dyndns.org","threadId":"15115","inReplyTo":"EAFC48F0-5512-4A83-B9B2-44FF53319285@ai.rug.nl","subject":"Re: [bug] pull faulty 'not uptodate'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-20T21:50:28Z","receivedAt":"2008-08-20T21:50:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pieter de Bie <pdebie@ai.rug.nl> writes:\n\n> On Aug 20, 2008, at 11:22 PM, Junio C Hamano wrote:\n>> But I also have to wonder why a git-list regular like you are\n>> reporting\n>> this _long after_ v1.6.0-rc1 was released.  Perhaps this is not\n>> really a\n>> big-deal bug spelled in capital letters like you have on your Subject\n>> line?\n>\n> I just noticed it and wanted to report it. I thought the usual way to\n> do this is to put [BUG] in the subject line. If that is not the common\n> way to report bugs, I'm sorry. I can also downcase it ;)\n\nNah, don't bother --- that wouldn't help.\n\nChecking if it is a regression (\"it used to work but recently broken\") or\na bug (\"it does not work as I expect it\") and marking the report as such\nwould have helped, though.\n"},{"id":"87891","messageId":"7vwsibnyof.fsf@gitster.siamese.dyndns.org","threadId":"15115","inReplyTo":"EAFC48F0-5512-4A83-B9B2-44FF53319285@ai.rug.nl","subject":"Re: [bug] pull faulty 'not uptodate'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-20T21:50:40Z","receivedAt":"2008-08-20T21:50:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pieter de Bie <pdebie@ai.rug.nl> writes:\n\n> On Aug 20, 2008, at 11:22 PM, Junio C Hamano wrote:\n>> But I also have to wonder why a git-list regular like you are\n>> reporting\n>> this _long after_ v1.6.0-rc1 was released.  Perhaps this is not\n>> really a\n>> big-deal bug spelled in capital letters like you have on your Subject\n>> line?\n>\n> I just noticed it and wanted to report it. I thought the usual way to\n> do this is to put [BUG] in the subject line. If that is not the common\n> way to report bugs, I'm sorry. I can also downcase it ;)\n\nNah, don't bother --- that wouldn't help.  A bug is a bug is a bug.\n\nChecking if it is a regression (\"it used to work but recently broken\") or\na bug (\"it does not work as I expect it\") and marking the report as such\nwould have helped, though.\n"},{"id":"87893","messageId":"7vljyrnxt3.fsf_-_@gitster.siamese.dyndns.org","threadId":"15115","inReplyTo":"EAFC48F0-5512-4A83-B9B2-44FF53319285@ai.rug.nl","subject":"\"git-merge\": allow fast-forwarding in a stat-dirty tree","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-20T22:09:28Z","receivedAt":"2008-08-20T22:09:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"We used to refresh the index to clear stat-dirtyness before a fast-forward\nmerge.  Recent C rewrite forgot to do this.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin-merge.c  |    2 +-\n t/t7600-merge.sh |   10 ++++++++++\n 2 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git c/builtin-merge.c w/builtin-merge.c\nindex dde0c7e..a201c66 100644\n--- c/builtin-merge.c\n+++ w/builtin-merge.c\n@@ -566,6 +566,7 @@ static int checkout_fast_forward(unsigned char *head, unsigned char *remote)\n \n \tif (read_cache_unmerged())\n \t\tdie(\"you need to resolve your current index first\");\n+\trefresh_cache(REFRESH_QUIET);\n \n \tfd = hold_locked_index(lock_file, 1);\n \n@@ -936,7 +937,6 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\t\thex,\n \t\t\tfind_unique_abbrev(remoteheads->item->object.sha1,\n \t\t\tDEFAULT_ABBREV));\n-\t\trefresh_cache(REFRESH_QUIET);\n \t\tstrbuf_init(&msg, 0);\n \t\tstrbuf_addstr(&msg, \"Fast forward\");\n \t\tif (have_message)\ndiff --git c/t/t7600-merge.sh w/t/t7600-merge.sh\nindex 5eeb6c2..fee8fb7 100755\n--- c/t/t7600-merge.sh\n+++ w/t/t7600-merge.sh\n@@ -488,4 +488,14 @@ test_expect_success 'merge c1 with c1 and c2' '\n \n test_debug 'gitk --all'\n \n+test_expect_success 'merge fast-forward in a dirty tree' '\n+       git reset --hard c0 &&\n+       mv file file1 &&\n+       cat file1 >file &&\n+       rm -f file1 &&\n+       git merge c2\n+'\n+\n+test_debug 'gitk --all'\n+\n test_done\n"},{"id":"87898","messageId":"20080820223511.GM23800@genesis.frugalware.org","threadId":"15115","inReplyTo":"7vljyrnxt3.fsf_-_@gitster.siamese.dyndns.org","subject":"Re: \"git-merge\": allow fast-forwarding in a stat-dirty tree","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-08-20T22:35:11Z","receivedAt":"2008-08-20T22:35:11Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Wed, Aug 20, 2008 at 03:09:28PM -0700, Junio C Hamano <gitster@pobox.com> wrote:\n>  \tif (read_cache_unmerged())\n>  \t\tdie(\"you need to resolve your current index first\");\n> +\trefresh_cache(REFRESH_QUIET);\n\nI did not realise that we need a refresh_cache() after\nread_cache_unmerged() here, and thus the other refresh_cache() call is\nunnecessary.\n\nThanks.\n"}]}