git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jim Meyering <jim@meyering.net>
Cc: git list <git@vger.kernel.org>
Subject: Re: [PATCH] use write_str_in_full helper to avoid literal string lengths
Date: Sat, 12 Sep 2009 16:56:59 -0700	[thread overview]
Message-ID: <7veiqbbttg.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <87skes35mf.fsf@meyering.net> (Jim Meyering's message of "Sat\, 12 Sep 2009 10\:54\:32 +0200")

Jim Meyering <jim@meyering.net> writes:

>  ...Thus not requiring the added allocation, and still avoiding
> the maintenance risk of literal string lengths.
> These days, compilers are good enough that strlen("literal")
> imposes no run-time cost.
>
> Transformed via this:
>
>     perl -pi -e \
>         's/write_in_full\((.*?), (".*?"), \d+\)/write_str_in_full($1, $2)/'\
>       $(git grep -l 'write_in_full.*"')
>
>
> From fe368f8b3720f04c9dfce952711d2fb412b52e3c Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@redhat.com>
> Date: Sat, 12 Sep 2009 09:56:13 +0200
> Subject: [PATCH] use write_str_in_full helper to avoid literal string lengths
>
> * cache.h (write_str_in_full): Define function.
> * builtin-fetch.c (quickfetch): Use it.
> * builtin-reflog.c (expire_reflog): Likewise.
> * commit.c (write_shallow_commits): Likewise.
> * config.c (git_config_set_multivar): Likewise.
> * rerere.c (write_rr): Likewise.
> * transport-helper.c (get_helper, disconnect_helper): Likewise.
> (get_refs_list): Likewise.
> * upload-pack.c (receive_needs): Likewise.

Thanks.  I agree with the reasoning you wrote outside the proposed log
message.

We usually do not write these bullet points (iow, we are not GNU) in our
log message.  The names of the functions, call sites and files that are
involved are something anybody can see from the patch text,

I think the GNU convention was useful back when we were trapped in a
system with non-atomic commits, where it was very hard to see what files
were affected in a single logical changeset (i.e. CVS).

Luckily, we graduated those dark ages.

Instead, we prefer to have justifications (and methods), like what you
wrote at the beginning of your message.  These are not something people
can find in the patch text and they deserve to be recorded in the commit.

  reply	other threads:[~2009-09-12 23:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-12  8:54 [PATCH] use write_str_in_full helper to avoid literal string lengths Jim Meyering
2009-09-12 23:56 ` Junio C Hamano [this message]
2009-09-13  7:32   ` Jim Meyering

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=7veiqbbttg.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jim@meyering.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 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).