{"thread":{"id":"31205","subject":"merging confusion and question","startedAt":"2012-08-08T00:25:49Z","lastAt":"2012-08-10T20:16:38Z","messageCount":5,"participants":["Rich Pixley","Junio C Hamano","Phil Hord"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"196634","messageId":"5021B20D.2030702@palm.com","threadId":"31205","inReplyTo":null,"subject":"merging confusion and question","fromName":"Rich Pixley","fromEmail":"rich.pixley@palm.com","sentAt":"2012-08-08T00:25:49Z","receivedAt":"2012-08-08T00:25:49Z","isPatch":false,"sender":{"key":"rich.pixley@palm.com","avatar":null},"body":"I'm confused.\n\nWhat is the intended work flow here?  Ie, aside from trashing my \nrepository and starting over, what does one do to recover?\n\nrich@cobra> git clone /home/rich/repos/webos webos\nCloning into 'webos'...\ndone.\nrich@cobra> cd webos\nrich@cobra> git remote add central git@github.com:openwebos/webos.git\nrich@cobra> git co master\nAlready on 'master'\nrich@cobra> git pull central master\nX11 forwarding request failed on channel 0\nremote: Counting objects: 22, done.\nremote: Compressing objects: 100% (19/19), done.\nremote: Total 21 (delta 12), reused 11 (delta 2)\nUnpacking objects: 100% (21/21), done.\n From github.com:openwebos/webos\n  * branch            master     -> FETCH_HEAD\nwarning: Failed to merge submodule meta-webos (not checked out)\nAuto-merging meta-webos\nCONFLICT (submodule): Merge conflict in meta-webos\nAuto-merging README.md\nAutomatic merge failed; fix conflicts and then commit the result.\nrich@cobra> git commit -a\nerror: unable to index file meta-webos\nfatal: updating files failed\nrich@cobra> git add meta-webos\nerror: unable to index file meta-webos\nfatal: updating files failed\nrich@cobra> git rm meta-webos\nmeta-webos: needs merge\nrm 'meta-webos'\nfatal: git rm: 'meta-webos': Is a directory\nrich@cobra> git merge meta-webos\nerror: 'merge' is not possible because you have unmerged files.\nhint: Fix them up in the work tree,\nhint: and then use 'git add/rm <file>' as\nhint: appropriate to mark resolution and make a commit,\nhint: or use 'git commit -a'.\nfatal: Exiting because of an unresolved conflict.\n\n--rich\n"},{"id":"196636","messageId":"7v393yupjp.fsf@alter.siamese.dyndns.org","threadId":"31205","inReplyTo":"5021B20D.2030702@palm.com","subject":"Re: merging confusion and question","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-08-08T01:43:06Z","receivedAt":"2012-08-08T01:43:06Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Rich Pixley <rich.pixley@palm.com> writes:\n\n> I'm confused.\n>\n> What is the intended work flow here?  Ie, aside from trashing my\n> repository and starting over, what does one do to recover?\n>\n> rich@cobra> git clone /home/rich/repos/webos webos\n> Cloning into 'webos'...\n> done.\n> rich@cobra> cd webos\n> rich@cobra> git remote add central git@github.com:openwebos/webos.git\n> rich@cobra> git co master\n> Already on 'master'\n> rich@cobra> git pull central master\n> X11 forwarding request failed on channel 0\n> remote: Counting objects: 22, done.\n> remote: Compressing objects: 100% (19/19), done.\n> remote: Total 21 (delta 12), reused 11 (delta 2)\n> Unpacking objects: 100% (21/21), done.\n> From github.com:openwebos/webos\n>  * branch            master     -> FETCH_HEAD\n> warning: Failed to merge submodule meta-webos (not checked out)\n> Auto-merging meta-webos\n> CONFLICT (submodule): Merge conflict in meta-webos\n> Auto-merging README.md\n> Automatic merge failed; fix conflicts and then commit the result.\n> rich@cobra> git commit -a\n\nWhy isn't there any \"fix conflicts and then\" step between this line\nand the friendly insn message on the previous line?\n\n> error: unable to index file meta-webos\n> fatal: updating files failed\n> rich@cobra> git add meta-webos\n> error: unable to index file meta-webos\n> fatal: updating files failed\n> rich@cobra> git rm meta-webos\n> meta-webos: needs merge\n> rm 'meta-webos'\n> fatal: git rm: 'meta-webos': Is a directory\n> rich@cobra> git merge meta-webos\n> error: 'merge' is not possible because you have unmerged files.\n> hint: Fix them up in the work tree,\n> hint: and then use 'git add/rm <file>' as\n> hint: appropriate to mark resolution and make a commit,\n> hint: or use 'git commit -a'.\n> fatal: Exiting because of an unresolved conflict.\n\nIf you are not interested in mucking with meta-webos with this\nmerge, you would resolve meta-webos by taking either your (i.e. the\none that came from /home/rich/repos/webos) version or their\n(i.e. the one that came from openwebos/webos.git) version.  Go back\nto the state before \"git pull central master\" with \"reset --hard\",\ninit and update webos submodule, try the \"pull\" again and then \"git\nadd webos\" to resolve to your version, perhaps?\n"},{"id":"196678","messageId":"5022A6DA.2010702@palm.com","threadId":"31205","inReplyTo":"7v393yupjp.fsf@alter.siamese.dyndns.org","subject":"Re: merging confusion and question","fromName":"Rich Pixley","fromEmail":"rich.pixley@palm.com","sentAt":"2012-08-08T17:50:18Z","receivedAt":"2012-08-08T17:50:18Z","isPatch":false,"sender":{"key":"rich.pixley@palm.com","avatar":null},"body":"Thank you.\n\nI think the work flow here needs some work, but reset --hard gets me \nrunning again.  That should probably be mentioned in the error message.\n\n--rich\n\nOn 8/7/12 18:43 , Junio C Hamano wrote:\n> Rich Pixley <rich.pixley@palm.com> writes:\n>\n>> I'm confused.\n>>\n>> What is the intended work flow here?  Ie, aside from trashing my\n>> repository and starting over, what does one do to recover?\n>>\n>> rich@cobra> git clone /home/rich/repos/webos webos\n>> Cloning into 'webos'...\n>> done.\n>> rich@cobra> cd webos\n>> rich@cobra> git remote add central git@github.com:openwebos/webos.git\n>> rich@cobra> git co master\n>> Already on 'master'\n>> rich@cobra> git pull central master\n>> X11 forwarding request failed on channel 0\n>> remote: Counting objects: 22, done.\n>> remote: Compressing objects: 100% (19/19), done.\n>> remote: Total 21 (delta 12), reused 11 (delta 2)\n>> Unpacking objects: 100% (21/21), done.\n>>  From github.com:openwebos/webos\n>>   * branch            master     -> FETCH_HEAD\n>> warning: Failed to merge submodule meta-webos (not checked out)\n>> Auto-merging meta-webos\n>> CONFLICT (submodule): Merge conflict in meta-webos\n>> Auto-merging README.md\n>> Automatic merge failed; fix conflicts and then commit the result.\n>> rich@cobra> git commit -a\n> Why isn't there any \"fix conflicts and then\" step between this line\n> and the friendly insn message on the previous line?\n>\n>> error: unable to index file meta-webos\n>> fatal: updating files failed\n>> rich@cobra> git add meta-webos\n>> error: unable to index file meta-webos\n>> fatal: updating files failed\n>> rich@cobra> git rm meta-webos\n>> meta-webos: needs merge\n>> rm 'meta-webos'\n>> fatal: git rm: 'meta-webos': Is a directory\n>> rich@cobra> git merge meta-webos\n>> error: 'merge' is not possible because you have unmerged files.\n>> hint: Fix them up in the work tree,\n>> hint: and then use 'git add/rm <file>' as\n>> hint: appropriate to mark resolution and make a commit,\n>> hint: or use 'git commit -a'.\n>> fatal: Exiting because of an unresolved conflict.\n> If you are not interested in mucking with meta-webos with this\n> merge, you would resolve meta-webos by taking either your (i.e. the\n> one that came from /home/rich/repos/webos) version or their\n> (i.e. the one that came from openwebos/webos.git) version.  Go back\n> to the state before \"git pull central master\" with \"reset --hard\",\n> init and update webos submodule, try the \"pull\" again and then \"git\n> add webos\" to resolve to your version, perhaps?\n"},{"id":"196825","messageId":"CABURp0q6OXF5Mu3m20z5ZwL4kz0A0HgZynVMLZZBMNXtga01Vg@mail.gmail.com","threadId":"31205","inReplyTo":"7v393yupjp.fsf@alter.siamese.dyndns.org","subject":"Re: merging confusion and question","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2012-08-10T19:37:22Z","receivedAt":"2012-08-10T19:37:22Z","isPatch":false,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"On Tue, Aug 7, 2012 at 9:43 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Rich Pixley <rich.pixley@palm.com> writes:\n>\n>> I'm confused.\n>>\n>> What is the intended work flow here?  Ie, aside from trashing my\n>> repository and starting over, what does one do to recover?\n>>\n>> rich@cobra> git clone /home/rich/repos/webos webos\n>> Cloning into 'webos'...\n>> done.\n>> rich@cobra> cd webos\n>> rich@cobra> git remote add central git@github.com:openwebos/webos.git\n>> rich@cobra> git co master\n>> Already on 'master'\n>> rich@cobra> git pull central master\n>> X11 forwarding request failed on channel 0\n>> remote: Counting objects: 22, done.\n>> remote: Compressing objects: 100% (19/19), done.\n>> remote: Total 21 (delta 12), reused 11 (delta 2)\n>> Unpacking objects: 100% (21/21), done.\n>> From github.com:openwebos/webos\n>>  * branch            master     -> FETCH_HEAD\n>> warning: Failed to merge submodule meta-webos (not checked out)\n>> Auto-merging meta-webos\n>> CONFLICT (submodule): Merge conflict in meta-webos\n>> Auto-merging README.md\n>> Automatic merge failed; fix conflicts and then commit the result.\n>> rich@cobra> git commit -a\n>\n> Why isn't there any \"fix conflicts and then\" step between this line\n> and the friendly insn message on the previous line?\n\nI think I know the answer.  I remember it from my newbie days.\n\nThe reason is that \"fix conflicts\" is confusing to new users. The new\nuser didn't really want to merge here, perhaps, which is why there\nwere so many conflicts.  Git \"helpfully\" points out each one of the\nconflicts, but he doesn't explain what happened as a result (change\nmarkers in the file, etc.).  For the newbie, this is not intuitive;\nthe barrage of conflict details is intimidating.\n\n\"Fix conflicts\"?  If I do not know how the conflicts are represented\nyet, I also do not know how to fix them.\n\n\"Commit the result\"?  Result of what?  Commit how?\n\nAdding insult to injury, newbies can find no obvious way to \"undo and\ntry again.\"  Each command they think should move forward or \"do over\"\nis met with \"cannot do that. conflicts exist.  fix this mess and try\nagain.\"\n\nImagine your mom on the web for the first time encountering a \"404\".\nNow imagine that once this happens her browser refuses to work\ninsisting she \"fix the web\" first.\n\nI do not know a better description which would not rub the gurus the\nwrong way.  When I try to think of one, the hint always involves\nsomething called \"git undo\".  So I guess the status quo is good for\nnow, which is \"google git merge conflict\"\n\nI agree that 'git reset --hard' should be mentioned in the hint for\nnewbies, but this conflicts with my desire to avoid giving chainsaws\nto toddlers.\n\nPhil\n"},{"id":"196831","messageId":"7vy5lmijtl.fsf@alter.siamese.dyndns.org","threadId":"31205","inReplyTo":"CABURp0q6OXF5Mu3m20z5ZwL4kz0A0HgZynVMLZZBMNXtga01Vg@mail.gmail.com","subject":"Re: merging confusion and question","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-08-10T20:16:38Z","receivedAt":"2012-08-10T20:16:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phil Hord <phil.hord@gmail.com> writes:\n\n> I agree that 'git reset --hard' should be mentioned in the hint for\n> newbies, but this conflicts with my desire to avoid giving chainsaws\n> to toddlers.\n\nExactly.  So what are you suggesting?\n\nPerhaps force the user to go through a series of quiz when \"git\nmerge\" was run by the user for the first time to make sure she at\nleast read the sections on merges and conflict resolutions in the\ndocumentation to understand the fundamentals, and refuse to proceed\nuntil the user passes?\n\nI personally do not see a good way out.  Even telling new users not\nto do merges, rebases, or resets but to only build a straight linear\nhistory is not a fix, as the user will never gain the necessary\nunderstanding by doing only limited and simple things.\n"}]}