All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	GIT Mailing-list <git@vger.kernel.org>
Subject: [PATCH] object: make add_object_array_with_mode a static function
Date: Sun, 19 Oct 2014 00:19:07 +0100	[thread overview]
Message-ID: <5442F56B.8020205@ramsay1.demon.co.uk> (raw)


Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---

Hi Jeff,

I noticed that your 'jk/prune-mtime' branch also removes the only
call to the add_object_array_with_mode() function outside of the
object.c file; specifically commit 75ac69fa ("traverse_commit_list:
support pending blobs/trees with paths", 15-10-2014).

This patch (which was generated using the '--histogram' option to
format-patch), moves the function to before the definition of the
add_object_array() function (to avoid a forward declaration), and
makes it static.

If you need to re-roll this branch, could you please squash this
patch into the above commit. (again, assuming you have no plans
to add new external callers.)

[If new external callers are very likely in the future (i.e. this
function is an essential part of the object-array API), then it may
well not be worth doing this. (with perhaps a note in the commit
message? - dunno). Similar comments apply to the previous 'add_object'
patch as well!]

Thanks!

ATB,
Ramsay Jones


 object.c | 10 +++++-----
 object.h |  1 -
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/object.c b/object.c
index df86bdd..e1ef3f9 100644
--- a/object.c
+++ b/object.c
@@ -339,16 +339,16 @@ void add_object_array_with_path(struct object *obj, const char *name,
 	array->nr = ++nr;
 }
 
+static void add_object_array_with_mode(struct object *obj, const char *name, struct object_array *array, unsigned mode)
+{
+	add_object_array_with_path(obj, name, array, mode, NULL);
+}
+
 void add_object_array(struct object *obj, const char *name, struct object_array *array)
 {
 	add_object_array_with_mode(obj, name, array, S_IFINVALID);
 }
 
-void add_object_array_with_mode(struct object *obj, const char *name, struct object_array *array, unsigned mode)
-{
-	add_object_array_with_path(obj, name, array, mode, NULL);
-}
-
 /*
  * Free all memory associated with an entry; the result is
  * in an unspecified state and should not be examined.
diff --git a/object.h b/object.h
index e5178a5..6416247 100644
--- a/object.h
+++ b/object.h
@@ -114,7 +114,6 @@ int object_list_contains(struct object_list *list, struct object *obj);
 
 /* Object array handling .. */
 void add_object_array(struct object *obj, const char *name, struct object_array *array);
-void add_object_array_with_mode(struct object *obj, const char *name, struct object_array *array, unsigned mode);
 void add_object_array_with_path(struct object *obj, const char *name, struct object_array *array, unsigned mode, const char *path);
 
 typedef int (*object_array_each_func_t)(struct object_array_entry *, void *);
-- 
2.1.0

             reply	other threads:[~2014-10-18 23:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-18 23:19 Ramsay Jones [this message]
2014-10-19  2:03 ` [PATCH] object: make add_object_array_with_mode a static function Jeff King
2014-10-19 10:21   ` Ramsay Jones
2014-10-20 16:21   ` Junio C Hamano
2014-10-20 17:03     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5442F56B.8020205@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1.demon.co.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.