{"thread":{"id":"20413","subject":"[PATCH v2 2/4] sequencer: add comments about reset_almost_hard()","startedAt":"2009-08-05T20:52:58Z","lastAt":"2009-08-05T20:52:58Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":2,"patchTotal":4},"messages":[{"id":"119703","messageId":"20090805205301.3673.2317.chriscool@tuxfamily.org","threadId":"20413","inReplyTo":null,"subject":"[PATCH v2 2/4] sequencer: add comments about reset_almost_hard()","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-08-05T20:52:58Z","receivedAt":"2009-08-05T20:52:58Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n\n\tHere is some information about the reset_almost_hard\n\tfunction. This is the result of reading the code and\n\tthe documentation of related commands, but as I don't\n\tknow much these areas of git...\n\n builtin-sequencer--helper.c |   17 +++++++++++++++--\n 1 files changed, 15 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-sequencer--helper.c b/builtin-sequencer--helper.c\nindex 82a830d..a15139c 100644\n--- a/builtin-sequencer--helper.c\n+++ b/builtin-sequencer--helper.c\n@@ -77,8 +77,21 @@ static int reset_index_file(const unsigned char *sha1, int update, int dirty)\n \n /*\n  * Realize reset --hard behavior.\n- * If allow_dirty is set and there is a dirty working tree,\n- * then the changes are to be kept.\n+ * If allow_dirty is set and there is a dirty work tree,\n+ * then the changes in the work tree are to be kept.\n+ *\n+ * This should be faster than calling \"git reset --hard\" because\n+ * this calls \"unpack_trees()\" directly (instead of forking and\n+ * execing \"git read-tree\").\n+ *\n+ * Unmerged entries in the index will be discarded.\n+ *\n+ * If allow_dirty is set and fast forwarding the work tree\n+ * fails because it is dirty, then the work tree will not be\n+ * updated.\n+ *\n+ * No need to read or discard the index before calling this\n+ * function.\n  */\n static int reset_almost_hard(const unsigned char *sha)\n {\n-- \n1.6.4.133.g8a5c8\n"}]}