git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 2/4] sequencer: add comments about reset_almost_hard()

From
Christian Couder <chriscool@tuxfamily.org>
Date
Aug 5, 2009, 20:52 UTC
Message-ID
<20090805205301.3673.2317.chriscool@tuxfamily.org>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
	Here is some information about the reset_almost_hard
	function. This is the result of reading the code and
	the documentation of related commands, but as I don't
	know much these areas of git...
 builtin-sequencer--helper.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/builtin-sequencer--helper.c b/builtin-sequencer--helper.c
index 82a830d..a15139c 100644
--- a/builtin-sequencer--helper.c
+++ b/builtin-sequencer--helper.c
@@ -77,8 +77,21 @@ static int reset_index_file(const unsigned char *sha1, int update, int dirty)
 
 /*
  * Realize reset --hard behavior.
- * If allow_dirty is set and there is a dirty working tree,
- * then the changes are to be kept.
+ * If allow_dirty is set and there is a dirty work tree,
+ * then the changes in the work tree are to be kept.
+ *
+ * This should be faster than calling "git reset --hard" because
+ * this calls "unpack_trees()" directly (instead of forking and
+ * execing "git read-tree").
+ *
+ * Unmerged entries in the index will be discarded.
+ *
+ * If allow_dirty is set and fast forwarding the work tree
+ * fails because it is dirty, then the work tree will not be
+ * updated.
+ *
+ * No need to read or discard the index before calling this
+ * function.
  */
 static int reset_almost_hard(const unsigned char *sha)
 {
-- 
1.6.4.133.g8a5c8
Message 1 of 1 in “sequencer: add comments about reset_almost_hard()”
  1. 2/4 sequencer: add comments about reset_almost_hard()Christian Couder, Aug 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.