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

[PATCH v2 5/5] pick: simplify bogus comment about commiting immediately

From
Christian Couder <chriscool@tuxfamily.org>
Date
Aug 1, 2009, 15:46 UTC
Message-ID
<20090801154607.20922.26129.chriscool@tuxfamily.org>
as suggested by Junio, and add some interesting comments from Junio.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 pick.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/pick.c b/pick.c
index a6b1d6f..128a191 100644
--- a/pick.c
+++ b/pick.c
@@ -63,6 +63,14 @@ static struct tree *empty_tree(void)
  * Pick changes introduced by "commit" argument into current working
  * tree and index.
  *
+ * It starts from the current index (not HEAD), and allow the effect
+ * of one commit replayed (either forward or backward) to that state,
+ * leaving the result in the index.
+ *
+ * You do not have to start from a commit, so you can replay many
+ * commits to the index in sequence without commiting in between to
+ * squash multiple steps if you wanted to.
+ *
  * Return 0 on success.
  * Return negative value on error before picking,
  * and a positive value after picking,
@@ -85,10 +93,8 @@ int pick_commit(struct commit *pick_commit, int mainline, int flags,
 	commit = pick_commit;
 
 	/*
-	 * We do not intend to commit immediately.  We just want to
-	 * merge the differences in, so let's compute the tree
-	 * that represents the "current" state for merge-recursive
-	 * to work on.
+	 * Let's compute the tree that represents the "current" state
+	 * for merge-recursive to work on.
 	 */
 	if (write_cache_as_tree(head, 0, NULL))
 		return error("Your index file is unmerged.");
-- 
1.6.4.133.g8a5c8
Message 1 of 1 in “pick: simplify bogus comment about commiting immediately”
  1. 5/5 pick: simplify bogus comment about commiting immediatelyChristian Couder, Aug 1, 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.