git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: "Jakub Narębski" <jnareb@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 5/6] Document a bunch of functions defined in sha1_file.c
Date: Mon, 24 Feb 2014 12:08:55 -0800	[thread overview]
Message-ID: <20140224200855.GI7855@google.com> (raw)
In-Reply-To: <530BA530.3070603@alum.mit.edu>

Hi,

Michael Haggerty wrote:

> No, this hasn't changed.  I've been documenting public functions in the
> header files above the declaration, and private ones where they are
> defined.  So I moved the documentation for this function to cache.h:
>
> +/*
> + * Return the name of the file in the local object database that would
> + * be used to store a loose object with the specified sha1.  The
> + * return value is a pointer to a statically allocated buffer that is
> + * overwritten each time the function is called.
> + */
>  extern const char *sha1_file_name(const unsigned char *sha1);
>
> I also rewrite the comment, as you can see.  The "NOTE!" seemed a bit
> overboard to me, given that there are a lot of functions in our codebase
> that behave similarly.  So I toned the warning down, and tightened up
> the comment overall.
>
> Let me know if you think I've made it less helpful.

In the present state of the codebase, where many important functions
have no documentation or out-of-date documentation, the first place I
look to understand a function is its point of definition.  So I do
think that moving docs to the header file makes it less helpful.  I'd
prefer a mass move in the opposite direction (from header files to the
point of definition).

On the other hand I don't feel strongly about it.

Hope that helps,
Jonathan

  reply	other threads:[~2014-02-24 20:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21 16:32 [PATCH 0/6] Add a bunch of docstrings and make a few minor cleanups Michael Haggerty
2014-02-21 16:32 ` [PATCH 1/6] Add docstrings for lookup_replace_object() and do_lookup_replace_object() Michael Haggerty
2014-02-21 18:21   ` Junio C Hamano
2014-02-24  8:25     ` Michael Haggerty
2014-02-24  9:24   ` Christian Couder
2014-02-24 10:17     ` Michael Haggerty
2014-02-24 18:06       ` Junio C Hamano
2014-02-21 16:32 ` [PATCH 2/6] replace_object: use struct members instead of an array Michael Haggerty
2014-02-21 18:23   ` Junio C Hamano
2014-02-21 16:32 ` [PATCH 3/6] find_pack_entry(): document last_found_pack Michael Haggerty
2014-02-21 17:15   ` Nicolas Pitre
2014-02-21 16:32 ` [PATCH 4/6] sha1_file_name(): declare to return a const string Michael Haggerty
2014-02-21 16:32 ` [PATCH 5/6] Document a bunch of functions defined in sha1_file.c Michael Haggerty
2014-02-21 17:17   ` Nicolas Pitre
2014-02-24 18:18   ` Jakub Narębski
2014-02-24 20:01     ` Michael Haggerty
2014-02-24 20:08       ` Jonathan Nieder [this message]
2014-02-25 15:23         ` Michael Haggerty
2014-02-21 16:32 ` [PATCH 6/6] Document some functions defined in object.c Michael Haggerty
2014-02-21 17:33   ` Nicolas Pitre
2014-02-24  8:47     ` Michael Haggerty
2014-02-24 17:12       ` Junio C Hamano
2014-02-24 17:58 ` [PATCH 0/6] Add a bunch of docstrings and make a few minor cleanups 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=20140224200855.GI7855@google.com \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=mhagger@alum.mit.edu \
    /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).