{"thread":{"id":"3997","subject":"Re: fatal: git-write-tree: not able to write tree","startedAt":"2006-04-29T13:23:24Z","lastAt":"2006-04-29T18:34:26Z","messageCount":2,"participants":["colin@horizon.com","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"19250","messageId":"20060429132324.31638.qmail@science.horizon.com","threadId":"3997","inReplyTo":null,"subject":"Re: fatal: git-write-tree: not able to write tree","fromName":"","fromEmail":"colin@horizon.com","sentAt":"2006-04-29T13:23:24Z","receivedAt":"2006-04-29T13:23:24Z","isPatch":false,"sender":{"key":"colin@horizon.com","avatar":null},"body":"diff --git a/git-am.sh b/git-am.sh\nindex eab4aa8..872145b 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -376,6 +376,13 @@ do\n \t\t\techo \"No changes - did you forget update-index?\"\n \t\t\tstop_here $this\n \t\tfi\n+\t\tunmerged=$(git-ls-files -u)\n+\t\tif test -n \"$unmerged\"\n+\t\tthen\n+\t\t\techo \"You still have unmerged paths in your index\"\n+\t\t\techo \"did you forget update-index?\"\n+\t\t\tstop_here $this\n+\t\tfi\n \t\tapply_status=0\n \t\t;;\n \tesac\n\nEr... it's very non-obvious to me why you'd want to stick a workaround\nhere when you could instead fix git-write-tree to do it.  That seems\nlike The Right Thing.\n(It would also be helpful to mention at least one unmerged file by name.)\n"},{"id":"19262","messageId":"7v1wvg8c3x.fsf@assigned-by-dhcp.cox.net","threadId":"3997","inReplyTo":"20060429132324.31638.qmail@science.horizon.com","subject":"Re: fatal: git-write-tree: not able to write tree","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-29T18:34:26Z","receivedAt":"2006-04-29T18:34:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"colin@horizon.com writes:\n\n> diff --git a/git-am.sh b/git-am.sh\n> index eab4aa8..872145b 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n> @@ -376,6 +376,13 @@ do\n>  \t\t\techo \"No changes - did you forget update-index?\"\n>  \t\t\tstop_here $this\n>  \t\tfi\n> +\t\tunmerged=$(git-ls-files -u)\n> +\t\tif test -n \"$unmerged\"\n> +\t\tthen\n> +\t\t\techo \"You still have unmerged paths in your index\"\n> +\t\t\techo \"did you forget update-index?\"\n> +\t\t\tstop_here $this\n> +\t\tfi\n>  \t\tapply_status=0\n>  \t\t;;\n>  \tesac\n>\n> Er... it's very non-obvious to me why you'd want to stick a workaround\n> here when you could instead fix git-write-tree to do it.  That seems\n> like The Right Thing.\n\nAs I said in an earlier message in the thread, I've considered\nit, but that is a very risky thing to do, and write-tree is\ndefinitely a wrong place to do it.  If we wanted to, the right\nway would be to update-index using the output of \"ls-files -u\".\n\nHowever, it would invite the user to mistakenly say --resolved\nbefore resolving all paths.\n\n> (It would also be helpful to mention at least one unmerged file by name.)\n\nThat is true.\n"}]}