{"thread":{"id":"9439","subject":"git-write-tree strangeness","startedAt":"2007-08-08T15:42:11Z","lastAt":"2007-08-08T22:16:20Z","messageCount":4,"participants":["Steven Walter","Alex Riesen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"50198","messageId":"20070808154211.GA25015@dervierte","threadId":"9439","inReplyTo":null,"subject":"git-write-tree strangeness","fromName":"Steven Walter","fromEmail":"stevenrwalter@gmail.com","sentAt":"2007-08-08T15:42:11Z","receivedAt":"2007-08-08T15:42:11Z","isPatch":false,"sender":{"key":"stevenrwalter@gmail.com","avatar":"https://avatars.githubusercontent.com/u/79127?v=4"},"body":"I'm importing a large repository from svn into git with a custom tool,\nand I noticed a strange issue with one of the commits.\n\nUpon investigating further, I found that when I ran \"git-write-tree\"\nfollowed immediately by \"git-diff-index <tree>\" I had differences.  Does\nthat mean that git-write-tree incorrectly recorded the index, or do I\nmisunderstand things?\n\nI just wanted to verify that I have at least some clue what is going on\nbefore I dig too much deeper into this issue.  I'm running\ngit-1.5.3-rc4; I'll see if it occurs with 1.5.2 and bisect if not.\n-- \n-Steven Walter <stevenrwalter@gmail.com>\n\"A human being should be able to change a diaper, plan an invasion,\nbutcher a hog, conn a ship, design a building, write a sonnet, balance\naccounts, build a wall, set a bone, comfort the dying, take orders,\ngive orders, cooperate, act alone, solve equations, analyze a new\nproblem, pitch manure, program a computer, cook a tasty meal, fight\nefficiently, die gallantly. Specialization is for insects.\"\n   -Robert Heinlein\n"},{"id":"50200","messageId":"81b0412b0708080910u3aee166fo92ea73a4a0a78ccf@mail.gmail.com","threadId":"9439","inReplyTo":"20070808154211.GA25015@dervierte","subject":"Re: git-write-tree strangeness","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-08-08T16:10:52Z","receivedAt":"2007-08-08T16:10:52Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 8/8/07, Steven Walter <stevenrwalter@gmail.com> wrote:\n> I'm importing a large repository from svn into git with a custom tool,\n> and I noticed a strange issue with one of the commits.\n>\n> Upon investigating further, I found that when I ran \"git-write-tree\"\n> followed immediately by \"git-diff-index <tree>\" I had differences.  Does\n> that mean that git-write-tree incorrectly recorded the index, or do I\n> misunderstand things?\n\nWhat kind of differences? Different sha1 of content?\nI can't simply reproduce it.\n"},{"id":"50216","messageId":"7vabt14y08.fsf@assigned-by-dhcp.cox.net","threadId":"9439","inReplyTo":"81b0412b0708080910u3aee166fo92ea73a4a0a78ccf@mail.gmail.com","subject":"Re: git-write-tree strangeness","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-08T19:39:03Z","receivedAt":"2007-08-08T19:39:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Alex Riesen\" <raa.lkml@gmail.com> writes:\n\n> On 8/8/07, Steven Walter <stevenrwalter@gmail.com> wrote:\n>> I'm importing a large repository from svn into git with a custom tool,\n>> and I noticed a strange issue with one of the commits.\n>>\n>> Upon investigating further, I found that when I ran \"git-write-tree\"\n>> followed immediately by \"git-diff-index <tree>\" I had differences.  Does\n>> that mean that git-write-tree incorrectly recorded the index, or do I\n>> misunderstand things?\n>\n> What kind of differences? Different sha1 of content?\n> I can't simply reproduce it.\n\nIsn't this simply just a dirty worktree and missing --cached\noption?\n"},{"id":"50251","messageId":"20070808221620.GA3120@dervierte","threadId":"9439","inReplyTo":"7vabt14y08.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-write-tree strangeness","fromName":"Steven Walter","fromEmail":"stevenrwalter@gmail.com","sentAt":"2007-08-08T22:16:20Z","receivedAt":"2007-08-08T22:16:20Z","isPatch":false,"sender":{"key":"stevenrwalter@gmail.com","avatar":"https://avatars.githubusercontent.com/u/79127?v=4"},"body":"On Wed, Aug 08, 2007 at 12:39:03PM -0700, Junio C Hamano wrote:\n> \"Alex Riesen\" <raa.lkml@gmail.com> writes:\n> \n> > On 8/8/07, Steven Walter <stevenrwalter@gmail.com> wrote:\n> >> I'm importing a large repository from svn into git with a custom tool,\n> >> and I noticed a strange issue with one of the commits.\n> >>\n> >> Upon investigating further, I found that when I ran \"git-write-tree\"\n> >> followed immediately by \"git-diff-index <tree>\" I had differences.  Does\n> >> that mean that git-write-tree incorrectly recorded the index, or do I\n> >> misunderstand things?\n> >\n> > What kind of differences? Different sha1 of content?\n> > I can't simply reproduce it.\n> \n> Isn't this simply just a dirty worktree and missing --cached\n> option?\n\nIt doesn't happen everytime; I haven't found a set procedure to cause\nthe problem.  Your remark, Junio, combined with my later testing, lead\nme to believe that this is not a write-tree problem, but a git-add\nproblem.\n\nThe entire procedure I was following was:\n\n    <change working copy by svn>\n    git add .\n    git add -u\n    git write-tree\n    git diff-index <tree>\n\nIt seems to me that my expectation that diff-index show no changes was\nreasonable, but I misunderstood the implication; I expected diff-index\nto always compare the given tree to the index, regardless of the\npresence or absence of a '--cached' option.\n\nIf I rebuilt git from v1.5.2 and repeated the above commands, diff-tree\nshowed no differences, as I would expect.  Further, if I then re-ran\nwrite-tree/diff-index from v1.5.3-rc4, I still received no differences.\nI believe this result exculpates write-tree.\n\nWas there not a thread recently about a missing optimization in git-add?\nIf this change was included in v1.5.3-rc4, could it be the cause of my\ndiscrepency?  Suggestions for testing this theory, if it is reasonable?\n-- \n-Steven Walter <stevenrwalter@gmail.com>\n\"A human being should be able to change a diaper, plan an invasion,\nbutcher a hog, conn a ship, design a building, write a sonnet, balance\naccounts, build a wall, set a bone, comfort the dying, take orders,\ngive orders, cooperate, act alone, solve equations, analyze a new\nproblem, pitch manure, program a computer, cook a tasty meal, fight\nefficiently, die gallantly. Specialization is for insects.\"\n   -Robert Heinlein\n"}]}