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

[PATCH] commit: Add commit_list prefix to reduce_heads function.

From
Thiago Farina <tfransosi@gmail.com>
Date
Dec 5, 2010, 01:59 UTC
Message-ID
<a3f4bdc2d5f5d13c772a82de9afe2691b8a12863.1291514223.git.tfransosi@gmail.com>
Signed-off-by: Thiago Farina <tfransosi@gmail.com>
---
 builtin/commit.c     |    2 +-
 builtin/merge-base.c |    2 +-
 builtin/merge.c      |    2 +-
 commit.c             |    2 +-
 commit.h             |    2 +-
 revision.c           |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/builtin/commit.c b/builtin/commit.c
index 4fd1a16..11a0412 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1321,7 +1321,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 				allow_fast_forward = 0;
 		}
 		if (allow_fast_forward)
-			parents = reduce_heads(parents);
+			parents = commit_list_reduce_reads(parents);
 	} else {
 		if (!reflog_msg)
 			reflog_msg = "commit";
diff --git a/builtin/merge-base.c b/builtin/merge-base.c
index 96dd160..9a8b445 100644
--- a/builtin/merge-base.c
+++ b/builtin/merge-base.c
@@ -54,7 +54,7 @@ static int handle_octopus(int count, const char **args, int reduce, int show_all
 	for (i = count - 1; i >= 0; i--)
 		commit_list_insert(get_commit_reference(args[i]), &revs);
 
-	result = reduce ? reduce_heads(revs) : get_octopus_merge_bases(revs);
+	result = reduce ? commit_list_reduce_reads(revs) : get_octopus_merge_bases(revs);
 
 	if (!result)
 		return 1;
diff --git a/builtin/merge.c b/builtin/merge.c
index c24a7be..de21499 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -821,7 +821,7 @@ static int finish_automerge(struct commit_list *common,
 	if (allow_fast_forward) {
 		parents = remoteheads;
 		commit_list_insert(lookup_commit(head), &parents);
-		parents = reduce_heads(parents);
+		parents = commit_list_reduce_reads(parents);
 	} else {
 		struct commit_list **pptr = &parents;
 
diff --git a/commit.c b/commit.c
index 2d9265d..50bd85b 100644
--- a/commit.c
+++ b/commit.c
@@ -759,7 +759,7 @@ int in_merge_bases(struct commit *commit, struct commit **reference, int num)
 	return ret;
 }
 
-struct commit_list *reduce_heads(struct commit_list *heads)
+struct commit_list *commit_list_reduce_reads(struct commit_list *heads)
 {
 	struct commit_list *p;
 	struct commit_list *result = NULL, **tail = &result;
diff --git a/commit.h b/commit.h
index 9113bbe..648cadc 100644
--- a/commit.h
+++ b/commit.h
@@ -165,7 +165,7 @@ static inline int single_parent(struct commit *commit)
 	return commit->parents && !commit->parents->next;
 }
 
-struct commit_list *reduce_heads(struct commit_list *heads);
+struct commit_list *commit_list_reduce_reads(struct commit_list *heads);
 
 extern int commit_tree(const char *msg, unsigned char *tree,
 		struct commit_list *parents, unsigned char *ret,
diff --git a/revision.c b/revision.c
index b1c1890..a000d5d 100644
--- a/revision.c
+++ b/revision.c
@@ -1795,7 +1795,7 @@ static struct commit_list **simplify_one(struct rev_info *revs, struct commit *c
 	 * Further reduce the parents by removing redundant parents.
 	 */
 	if (1 < cnt) {
-		struct commit_list *h = reduce_heads(commit->parents);
+		struct commit_list *h = commit_list_reduce_reads(commit->parents);
 		cnt = commit_list_count(h);
 		free_commit_list(commit->parents);
 		commit->parents = h;
-- 
1.7.3.2.343.g7d43d
Next: Jonathan Nieder
Message 1 of 13 in “commit: Add commit_list prefix to reduce_heads function.”
  1. commit: Add commit_list prefix to reduce_heads function.Thiago Farina, Dec 5, 2010
  2. Jonathan NiederDec 5, 2010
  3. Thiago FarinaDec 5, 2010
  4. Jonathan NiederDec 5, 2010
  5. Thiago FarinaDec 5, 2010
  6. Thiago FarinaDec 5, 2010
  7. Junio C HamanoDec 5, 2010
  8. Thiago FarinaDec 5, 2010
  9. Junio C HamanoDec 6, 2010
  10. Junio C HamanoDec 6, 2010
  11. Junio C HamanoDec 5, 2010
  12. Thiago FarinaDec 5, 2010
  13. Junio C HamanoDec 5, 2010

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.