Re: [PATCH v2 1/4] list-object: add get_commit_count function

2015-07-03 Thread Lawrence Siebert
Mattieu,

Understood. I don't suppose there is any commonly code formatting tool
to automate formatting in the git style, is there?

Thanks,
Lawrence

On Fri, Jul 3, 2015 at 12:24 AM, Matthieu Moy
matthieu@grenoble-inp.fr wrote:
 Lawrence Siebert lawrencesieb...@gmail.com writes:

 +void get_commit_count(struct rev_info * revs) {

 Please, write struct rev_info *revs (stick * to revs).

 +void get_commit_count(struct rev_info * revs);

 Likewise.

 --
 Matthieu Moy
 http://www-verimag.imag.fr/~moy/



-- 
About Me: http://about.me/lawrencesiebert
Constantly Coding: http://constantcoding.blogspot.com
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/4] list-object: add get_commit_count function

2015-07-03 Thread Matthieu Moy
Lawrence Siebert lawrencesieb...@gmail.com writes:

 +void get_commit_count(struct rev_info * revs) {

Please, write struct rev_info *revs (stick * to revs).

 +void get_commit_count(struct rev_info * revs);

Likewise.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/4] list-object: add get_commit_count function

2015-07-03 Thread Matthieu Moy
Lawrence Siebert lawrencesieb...@gmail.com writes:

 Mattieu,

 Understood. I don't suppose there is any commonly code formatting tool
 to automate formatting in the git style, is there?

IIRC, someone posted a configuration file for clang-format that
essentially matches the Git coding style.

You can read Documentation/CodingGuidelines. Unsurprisingly, Git uses a
coding style similar to the Linux kernel, so anything you find about the
kernel essentially applies here too.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/4] list-object: add get_commit_count function

2015-07-02 Thread Lawrence Siebert
Moving commit counting from rev-list into list-object which is a step
toward letting git log do counting as well.

Signed-off-by: Lawrence Siebert lawrencesieb...@gmail.com
---
 builtin/rev-list.c | 12 ++--
 list-objects.c | 14 ++
 list-objects.h |  1 +
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index ff84a82..07f522b 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -388,16 +388,8 @@ int cmd_rev_list(int argc, const char **argv, const char 
*prefix)
 
traverse_commit_list(revs, show_commit, show_object, info);
 
-   if (revs.count) {
-   if (revs.left_right  revs.cherry_mark)
-   printf(%d\t%d\t%d\n, revs.count_left, 
revs.count_right, revs.count_same);
-   else if (revs.left_right)
-   printf(%d\t%d\n, revs.count_left, revs.count_right);
-   else if (revs.cherry_mark)
-   printf(%d\t%d\n, revs.count_left + revs.count_right, 
revs.count_same);
-   else
-   printf(%d\n, revs.count_left + revs.count_right);
-   }
+   if (revs.count)
+   get_commit_count(revs);
 
return 0;
 }
diff --git a/list-objects.c b/list-objects.c
index 41736d2..6f76301 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -234,3 +234,17 @@ void traverse_commit_list(struct rev_info *revs,
object_array_clear(revs-pending);
strbuf_release(base);
 }
+
+void get_commit_count(struct rev_info * revs) {
+   if (revs-count) {
+   if (revs-left_right  revs-cherry_mark)
+   printf(%d\t%d\t%d\n, revs-count_left, 
revs-count_right, revs-count_same);
+   else if (revs-left_right)
+   printf(%d\t%d\n, revs-count_left, revs-count_right);
+   else if (revs-cherry_mark)
+   printf(%d\t%d\n, revs-count_left + 
revs-count_right, revs-count_same);
+   else
+   printf(%d\n, revs-count_left + revs-count_right);
+   }
+   return;
+}
diff --git a/list-objects.h b/list-objects.h
index 136a1da..d28c1f3 100644
--- a/list-objects.h
+++ b/list-objects.h
@@ -7,5 +7,6 @@ void traverse_commit_list(struct rev_info *, show_commit_fn, 
show_object_fn, voi
 
 typedef void (*show_edge_fn)(struct commit *);
 void mark_edges_uninteresting(struct rev_info *, show_edge_fn);
+void get_commit_count(struct rev_info * revs);
 
 #endif
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html