git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 1/4] builtin-for-each-ref.c: comment fixes
Date: Sat, 13 Feb 2010 12:30:30 -0800	[thread overview]
Message-ID: <1266093033-9526-2-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1266093033-9526-1-git-send-email-gitster@pobox.com>

The primary purpose of this is to get rid of stale comments that lamented
the lack of callback parameter from for_each_ref(), which we have already
fixed.  While at it, adjust the multi-line comment style as well.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin-for-each-ref.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
index a5a83f1..3698e82 100644
--- a/builtin-for-each-ref.c
+++ b/builtin-for-each-ref.c
@@ -143,7 +143,8 @@ static const char *find_next(const char *cp)
 {
 	while (*cp) {
 		if (*cp == '%') {
-			/* %( is the start of an atom;
+			/*
+			 * %( is the start of an atom;
 			 * %% is a quoted per-cent.
 			 */
 			if (cp[1] == '(')
@@ -420,7 +421,8 @@ static void grab_person(const char *who, struct atom_value *val, int deref, stru
 			grab_date(wholine, v, name);
 	}
 
-	/* For a tag or a commit object, if "creator" or "creatordate" is
+	/*
+	 * For a tag or a commit object, if "creator" or "creatordate" is
 	 * requested, do something special.
 	 */
 	if (strcmp(who, "tagger") && strcmp(who, "committer"))
@@ -502,7 +504,8 @@ static void grab_sub_body_contents(struct atom_value *val, int deref, struct obj
 	}
 }
 
-/* We want to have empty print-string for field requests
+/*
+ * We want to have empty print-string for field requests
  * that do not apply (e.g. "authordate" for a tag object)
  */
 static void fill_missing_values(struct atom_value *val)
@@ -633,18 +636,21 @@ static void populate_value(struct refinfo *ref)
 	if (!eaten)
 		free(buf);
 
-	/* If there is no atom that wants to know about tagged
+	/*
+	 * If there is no atom that wants to know about tagged
 	 * object, we are done.
 	 */
 	if (!need_tagged || (obj->type != OBJ_TAG))
 		return;
 
-	/* If it is a tag object, see if we use a value that derefs
+	/*
+	 * If it is a tag object, see if we use a value that derefs
 	 * the object, and if we do grab the object it refers to.
 	 */
 	tagged = ((struct tag *)obj)->tagged->sha1;
 
-	/* NEEDSWORK: This derefs tag only once, which
+	/*
+	 * NEEDSWORK: This derefs tag only once, which
 	 * is good to deal with chains of trust, but
 	 * is not consistent with what deref_tag() does
 	 * which peels the onion to the core.
@@ -681,9 +687,8 @@ struct grab_ref_cbdata {
 };
 
 /*
- * A call-back given to for_each_ref().  It is unfortunate that we
- * need to use global variables to pass extra information to this
- * function.
+ * A call-back given to for_each_ref().  Filter refs and keep them for
+ * later object processing.
  */
 static int grab_single_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
 {
@@ -711,7 +716,8 @@ static int grab_single_ref(const char *refname, const unsigned char *sha1, int f
 			return 0;
 	}
 
-	/* We do not open the object yet; sort may only need refname
+	/*
+	 * We do not open the object yet; sort may only need refname
 	 * to do its job and the resulting list may yet to be pruned
 	 * by maxcount logic.
 	 */
-- 
1.7.0.169.g57c99

  reply	other threads:[~2010-02-13 20:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-13  5:55 [PATCH] git-for-each-ref: add new field name "symbolic" Larry D'Anna
2010-02-13  7:45 ` Junio C Hamano
2010-02-13  8:51   ` Jeff King
2010-02-13 20:30     ` [PATCH 0/4] for-each-ref --format='%(symref) %(symref:short) %(flag)' Junio C Hamano
2010-02-13 20:30       ` Junio C Hamano [this message]
2010-02-13 20:30       ` [PATCH 2/4] builtin-for-each-ref.c: check if we need to peel onion while parsing the format Junio C Hamano
2010-02-13 20:30       ` [PATCH 3/4] for-each-ref --format='%(symref) %(symref:short)' Junio C Hamano
2010-02-14  6:32         ` Jeff King
2010-02-14 10:32           ` Junio C Hamano
2010-02-15  8:39             ` Jeff King
2010-02-13 20:30       ` [PATCH 4/4] for-each-ref --format='%(flag)' Junio C Hamano

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=1266093033-9526-2-git-send-email-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).