{"thread":{"id":"46686","subject":"Produce contents of index with existing directory as cache","startedAt":"2017-08-30T14:11:13Z","lastAt":"2017-08-31T09:58:52Z","messageCount":5,"participants":["Florian Weimer","David Lloyd"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"327401","messageId":"5a9e4efd-8c48-487e-4a9f-9362a944c992@redhat.com","threadId":"46686","inReplyTo":null,"subject":"Produce contents of index with existing directory as cache","fromName":"Florian Weimer","fromEmail":"fweimer@redhat.com","sentAt":"2017-08-30T14:11:03Z","receivedAt":"2017-08-30T14:11:13Z","isPatch":false,"sender":{"key":"fweimer@redhat.com","avatar":null},"body":"Is there a variant of “git checkout-index” which will produce the\nexisting index contents, like “git checkout-index” would do with an\nempty directory, but can reuse an existing directory tree, to avoid\nwriting all files from scratch?\n\nI'm writing some analysis scripts which need to change a checked-out\nworking tree.  Right now I'm throwing away the tree after making the\nchanges and create the next tree (which is expected to be quite similar\nin contents) from scratch, starting with an empty directory.  This is\nquite slow.\n\nThanks,\nFlorian\n"},{"id":"327403","messageId":"CANghgrS9hZyA4vWU=4PZuYue3iLsLx7ObbT_VgRGSXpACwNkcg@mail.gmail.com","threadId":"46686","inReplyTo":"5a9e4efd-8c48-487e-4a9f-9362a944c992@redhat.com","subject":"Re: Produce contents of index with existing directory as cache","fromName":"David Lloyd","fromEmail":"david.lloyd@redhat.com","sentAt":"2017-08-30T14:15:21Z","receivedAt":"2017-08-30T14:16:06Z","isPatch":false,"sender":{"key":"david.lloyd@redhat.com","avatar":"https://gravatar.com/avatar/f1e98e7f01e943b78c4742d20263a2b3bf283775819308ca6e9aabccd2bd5dd8?d=mp&s=160"},"body":"git reset --hard ?\n\nOn Wed, Aug 30, 2017 at 9:11 AM, Florian Weimer <fweimer@redhat.com> wrote:\n> Is there a variant of “git checkout-index” which will produce the\n> existing index contents, like “git checkout-index” would do with an\n> empty directory, but can reuse an existing directory tree, to avoid\n> writing all files from scratch?\n>\n> I'm writing some analysis scripts which need to change a checked-out\n> working tree.  Right now I'm throwing away the tree after making the\n> changes and create the next tree (which is expected to be quite similar\n> in contents) from scratch, starting with an empty directory.  This is\n> quite slow.\n>\n> Thanks,\n> Florian\n\n\n\n-- \n- DML\n"},{"id":"327404","messageId":"df9cb4e8-13f7-54b9-b737-be4e56977867@redhat.com","threadId":"46686","inReplyTo":"CANghgrS9hZyA4vWU=4PZuYue3iLsLx7ObbT_VgRGSXpACwNkcg@mail.gmail.com","subject":"Re: Produce contents of index with existing directory as cache","fromName":"Florian Weimer","fromEmail":"fweimer@redhat.com","sentAt":"2017-08-30T14:18:23Z","receivedAt":"2017-08-30T14:18:32Z","isPatch":false,"sender":{"key":"fweimer@redhat.com","avatar":null},"body":"On 08/30/2017 04:15 PM, David Lloyd wrote:\n> git reset --hard ?\n\nThat doesn't remove unstaged files.\n\nFlorian\n"},{"id":"327405","messageId":"CANghgrTFjybxfmn=DzKwvoqRP3GA3sWiGFtYdEfPZtWmyznq9g@mail.gmail.com","threadId":"46686","inReplyTo":"df9cb4e8-13f7-54b9-b737-be4e56977867@redhat.com","subject":"Re: Produce contents of index with existing directory as cache","fromName":"David Lloyd","fromEmail":"david.lloyd@redhat.com","sentAt":"2017-08-30T14:55:43Z","receivedAt":"2017-08-30T14:56:29Z","isPatch":false,"sender":{"key":"david.lloyd@redhat.com","avatar":"https://gravatar.com/avatar/f1e98e7f01e943b78c4742d20263a2b3bf283775819308ca6e9aabccd2bd5dd8?d=mp&s=160"},"body":"Ah, does it not?  Perhaps add a \"git clean -d -f\" as well.\n\nOn Wed, Aug 30, 2017 at 9:18 AM, Florian Weimer <fweimer@redhat.com> wrote:\n> On 08/30/2017 04:15 PM, David Lloyd wrote:\n>> git reset --hard ?\n>\n> That doesn't remove unstaged files.\n>\n> Florian\n\n\n\n-- \n- DML\n"},{"id":"327479","messageId":"8ca2e078-88d2-83db-bc28-5f8fbf3c0dd6@redhat.com","threadId":"46686","inReplyTo":"CANghgrTFjybxfmn=DzKwvoqRP3GA3sWiGFtYdEfPZtWmyznq9g@mail.gmail.com","subject":"Re: Produce contents of index with existing directory as cache","fromName":"Florian Weimer","fromEmail":"fweimer@redhat.com","sentAt":"2017-08-31T09:58:31Z","receivedAt":"2017-08-31T09:58:52Z","isPatch":false,"sender":{"key":"fweimer@redhat.com","avatar":null},"body":"On 08/30/2017 04:55 PM, David Lloyd wrote:\n> On Wed, Aug 30, 2017 at 9:18 AM, Florian Weimer <fweimer@redhat.com> wrote:\n>> On 08/30/2017 04:15 PM, David Lloyd wrote:\n>>> git reset --hard ?\n>>\n>> That doesn't remove unstaged files.\n\n> Ah, does it not?  Perhaps add a \"git clean -d -f\" as well.\n\nIt would have to be “git clean -d -f -f -x” (not the two “-f”) to be on\nthe safe side.  I wonder what else I'm missing, though, and if this is\ncompletely reliable and has the same effect as removing the tree before\n“git checkout-index”.\n\nThanks,\nFlorian\n"}]}