[PATCH v1 0/1] traverse_trees_and_blobs: rename and tree-wide

STALE1829d

7 messages, 2 authors, 2021-08-12 · open the first message on its own page

[PATCH v1 0/1] traverse_trees_and_blobs: rename and tree-wide

From: Teng Long <hidden>
Date: 2021-08-11 09:07:33

Teng Long (1):
  list-objects.c: traverse_trees_and_blobs: rename and tree-wide

 list-objects.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.32.0.dirty

[PATCH v1 1/1] list-objects.c: traverse_trees_and_blobs: rename and tree-wide

From: Teng Long <hidden>
Date: 2021-08-11 09:07:38

Function `traverse_trees_and_blobs` not only works on trees and blobs,
but also on tags, the function name is somewhat misleading. This commit
rename it to `traverse_trees_and_blobs_and_tags`.

Signed-off-by: Teng Long <redacted>
---
 list-objects.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/list-objects.c b/list-objects.c
index 7f404677d5..37a37fc502 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -334,7 +334,7 @@ static void add_pending_tree(struct rev_info *revs, struct tree *tree)
 	add_pending_object(revs, &tree->object, "");
 }
 
-static void traverse_trees_and_blobs(struct traversal_context *ctx,
+static void traverse_trees_and_blobs_and_tags(struct traversal_context *ctx,
 				     struct strbuf *base)
 {
 	int i;
@@ -407,9 +407,9 @@ static void do_traverse(struct traversal_context *ctx)
 			 * needs a reallocation for each commit. Can we pass the
 			 * tree directory without allocation churn?
 			 */
-			traverse_trees_and_blobs(ctx, &csp);
+			traverse_trees_and_blobs_and_tags(ctx, &csp);
 	}
-	traverse_trees_and_blobs(ctx, &csp);
+	traverse_trees_and_blobs_and_tags(ctx, &csp);
 	strbuf_release(&csp);
 }
 
-- 
2.32.0.dirty

[PATCH v2 0/1] list-objects.c: rename "traverse_trees_and_blobs" to "traverse_non_commits"

From: Teng Long <hidden>
Date: 2021-08-12 08:47:27

Teng Long (1):
  list-objects.c: rename "traverse_trees_and_blobs" to
    "traverse_non_commits"

 list-objects.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Range-diff against v1:
1:  b6f3b15253 ! 1:  2d19f0901c list-objects.c: traverse_trees_and_blobs: rename and tree-wide
    @@ Metadata
     Author: Teng Long [off-list ref]
     
      ## Commit message ##
    -    list-objects.c: traverse_trees_and_blobs: rename and tree-wide
    +    list-objects.c: rename "traverse_trees_and_blobs" to "traverse_non_commits"
     
         Function `traverse_trees_and_blobs` not only works on trees and blobs,
         but also on tags, the function name is somewhat misleading. This commit
    -    rename it to `traverse_trees_and_blobs_and_tags`.
    +    rename it to `traverse_non_commits`.
     
         Signed-off-by: Teng Long [off-list ref]
     
    @@ list-objects.c: static void add_pending_tree(struct rev_info *revs, struct tree
      }
      
     -static void traverse_trees_and_blobs(struct traversal_context *ctx,
    -+static void traverse_trees_and_blobs_and_tags(struct traversal_context *ctx,
    ++static void traverse_non_commits(struct traversal_context *ctx,
      				     struct strbuf *base)
      {
      	int i;
    @@ list-objects.c: static void do_traverse(struct traversal_context *ctx)
      			 * tree directory without allocation churn?
      			 */
     -			traverse_trees_and_blobs(ctx, &csp);
    -+			traverse_trees_and_blobs_and_tags(ctx, &csp);
    ++			traverse_non_commits(ctx, &csp);
      	}
     -	traverse_trees_and_blobs(ctx, &csp);
    -+	traverse_trees_and_blobs_and_tags(ctx, &csp);
    ++	traverse_non_commits(ctx, &csp);
      	strbuf_release(&csp);
      }
      
-- 
2.32.0.1.g4c9ac18d93.dirty

[PATCH v2 1/1] list-objects.c: rename "traverse_trees_and_blobs" to "traverse_non_commits"

From: Teng Long <hidden>
Date: 2021-08-12 08:47:37

Function `traverse_trees_and_blobs` not only works on trees and blobs,
but also on tags, the function name is somewhat misleading. This commit
rename it to `traverse_non_commits`.

Signed-off-by: Teng Long <redacted>
---
 list-objects.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/list-objects.c b/list-objects.c
index 7f404677d5..edaf1f5d64 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -334,7 +334,7 @@ static void add_pending_tree(struct rev_info *revs, struct tree *tree)
 	add_pending_object(revs, &tree->object, "");
 }
 
-static void traverse_trees_and_blobs(struct traversal_context *ctx,
+static void traverse_non_commits(struct traversal_context *ctx,
 				     struct strbuf *base)
 {
 	int i;
@@ -407,9 +407,9 @@ static void do_traverse(struct traversal_context *ctx)
 			 * needs a reallocation for each commit. Can we pass the
 			 * tree directory without allocation churn?
 			 */
-			traverse_trees_and_blobs(ctx, &csp);
+			traverse_non_commits(ctx, &csp);
 	}
-	traverse_trees_and_blobs(ctx, &csp);
+	traverse_non_commits(ctx, &csp);
 	strbuf_release(&csp);
 }
 
-- 
2.32.0.1.g4c9ac18d93.dirty

[PATCH v3 0/1] list-objects.c: rename "traverse_trees_and_blobs" to "traverse_non_commits"

From: Teng Long <hidden>
Date: 2021-08-12 08:59:40

Patch-v3 fix the indent problem in v2.


Teng Long (1):
  list-objects.c: rename "traverse_trees_and_blobs" to
    "traverse_non_commits"

 list-objects.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Range-diff against v2:
1:  2d19f0901c ! 1:  8548aa8bb1 list-objects.c: rename "traverse_trees_and_blobs" to "traverse_non_commits"
    @@ list-objects.c: static void add_pending_tree(struct rev_info *revs, struct tree
      }
      
     -static void traverse_trees_and_blobs(struct traversal_context *ctx,
    +-				     struct strbuf *base)
     +static void traverse_non_commits(struct traversal_context *ctx,
    - 				     struct strbuf *base)
    ++				 struct strbuf *base)
      {
      	int i;
    + 
     @@ list-objects.c: static void do_traverse(struct traversal_context *ctx)
      			 * needs a reallocation for each commit. Can we pass the
      			 * tree directory without allocation churn?
-- 
2.32.0.1.g4c9ac18d93.dirty

[PATCH v3 1/1] list-objects.c: rename "traverse_trees_and_blobs" to "traverse_non_commits"

From: Teng Long <hidden>
Date: 2021-08-12 08:59:43

Function `traverse_trees_and_blobs` not only works on trees and blobs,
but also on tags, the function name is somewhat misleading. This commit
rename it to `traverse_non_commits`.

Signed-off-by: Teng Long <redacted>
---
 list-objects.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/list-objects.c b/list-objects.c
index 7f404677d5..11d97ac380 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -334,8 +334,8 @@ static void add_pending_tree(struct rev_info *revs, struct tree *tree)
 	add_pending_object(revs, &tree->object, "");
 }
 
-static void traverse_trees_and_blobs(struct traversal_context *ctx,
-				     struct strbuf *base)
+static void traverse_non_commits(struct traversal_context *ctx,
+				 struct strbuf *base)
 {
 	int i;
 
@@ -407,9 +407,9 @@ static void do_traverse(struct traversal_context *ctx)
 			 * needs a reallocation for each commit. Can we pass the
 			 * tree directory without allocation churn?
 			 */
-			traverse_trees_and_blobs(ctx, &csp);
+			traverse_non_commits(ctx, &csp);
 	}
-	traverse_trees_and_blobs(ctx, &csp);
+	traverse_non_commits(ctx, &csp);
 	strbuf_release(&csp);
 }
 
-- 
2.32.0.1.g4c9ac18d93.dirty

Re: [PATCH v3 1/1] list-objects.c: rename "traverse_trees_and_blobs" to "traverse_non_commits"

From: Jeff King <hidden>
Date: 2021-08-12 19:24:20

On Thu, Aug 12, 2021 at 04:59:31PM +0800, Teng Long wrote:
Function `traverse_trees_and_blobs` not only works on trees and blobs,
but also on tags, the function name is somewhat misleading. This commit
rename it to `traverse_non_commits`.
Thanks, this version looks good to me.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help