git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Shawn Bohrer <shawn.bohrer@gmail.com>
Cc: git@vger.kernel.org, johannes.schindelin@gmx.de
Subject: Re: [PATCH] Make git-clean a builtin
Date: Mon, 05 Nov 2007 21:30:52 -0800	[thread overview]
Message-ID: <7vbqa8j5yr.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20071106050512.GA6768@mediacenter.austin.rr.com> (Shawn Bohrer's message of "Mon, 5 Nov 2007 23:05:12 -0600")

Shawn Bohrer <shawn.bohrer@gmail.com> writes:

> On Mon, Nov 05, 2007 at 01:14:32PM -0800, Junio C Hamano wrote:
>> Shawn Bohrer <shawn.bohrer@gmail.com> writes:
>> [...]
>> > +static int disabled = 1;
>> 
>> This means we are committed to make clean.requireForce default
>> to true, which is fine by me.  I need to warn the users about
>> this early.
>
> Actually I don't care either way, but in my last rebase on next this
> change was already made to git-clean.sh so I adjusted accordingly.

Oh, that was not a question to you, but a note to me.

>> > +static int show_only = 0;
>> > +static int remove_directories = 0;
>> > +static int quiet = 0;
>> > +static int ignored = 0;
>> > +static int ignored_only = 0;
>> 
>> Please do not explicitly initialize static variables to zero.
>
> I realize that static variables will be automatically initialized to
> zero so this is unnecessary, but is there some technical reason not to
> initialize explicitly?  If the answer is simply a style preference that
> is fine, I'm just here to learn.

Both readability and style have to do much with this.

The style has a historical background which is a slight
technical merit.  It results in a smaller executable file, as C
compilers traditionally placed file-scope static variables that
are not explicitly initialized in the BSS section, instead of
explicitly storing N-bytes of zero as the the initial data in it
(although I do not see a reason for compilers not to do the same
for variables explicitly initialized to zero.  In fact, I think
modern gcc produces the same allocation with or without "= 0"
initialization).

> Of course as already pointed out these don't actually need to be static
> in the first place so I'll simply move them into cmd_clean().  This does
> lead me to another question though.  Now that Dscho has converted my
> patch to use parse-options, what is the best way to update my patch
> while still giving credit to Dscho?

Please send a rewritten replacement version as a single patch
that is cleanly applicable to 'next', and mention people whose
input helped you in polishing the patch in the proposed commit
log message.

  reply	other threads:[~2007-11-06  5:31 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-04 19:02 [RFC] Second attempt at making git-clean a builtin Shawn Bohrer
2007-11-04 19:02 ` [PATCH] Add more tests for git-clean Shawn Bohrer
2007-11-04 19:02   ` [PATCH] Make git-clean a builtin Shawn Bohrer
2007-11-04 19:41     ` Pierre Habouzit
2007-11-04 20:24       ` [PATCH 3/2] Use parse-options in builtin-clean Johannes Schindelin
2007-11-04 21:16         ` Pierre Habouzit
2007-11-05 21:14     ` [PATCH] Make git-clean a builtin Junio C Hamano
2007-11-05 22:10       ` Carlos Rica
2007-11-05 23:54         ` Junio C Hamano
2007-11-06  5:05       ` Shawn Bohrer
2007-11-06  5:30         ` Junio C Hamano [this message]
2007-11-04 23:35   ` [PATCH] Add more tests for git-clean Junio C Hamano
2007-11-04 23:46     ` Pierre Habouzit
2007-11-05  0:17       ` Junio C Hamano
2007-11-04 23:49     ` Johannes Schindelin
  -- strict thread matches above, loose matches on Subject: below --
2007-11-12  1:48 [PATCH] Make git-clean a builtin Shawn Bohrer
2007-11-07  5:18 Shawn Bohrer
2007-11-07 11:10 ` Johannes Schindelin
2007-11-07 13:29   ` Bill Lear
2007-11-07 14:17     ` Johannes Schindelin
2007-11-07 14:45     ` Matthieu Moy
2007-11-07 19:46     ` Jon Loeliger
2007-11-10 22:43     ` Miles Bader
2007-11-07 14:54   ` Shawn Bohrer
2007-11-07 15:04     ` Johannes Schindelin
2007-11-07 20:51       ` Brian Downing
2007-11-07 21:49         ` Junio C Hamano
2007-11-07 20:42 ` Junio C Hamano
2007-11-08  5:37   ` Shawn Bohrer
2007-10-07 23:57 Shawn Bohrer
2007-10-08  3:57 ` Johannes Schindelin
2007-10-07  1:17 Shawn Bohrer
2007-10-07  1:31 ` Linus Torvalds
2007-10-07 15:41   ` Shawn Bohrer
2007-10-07 16:42     ` rae l
2007-10-07 16:38 ` Johannes Schindelin
2007-10-06 20:54 Shawn Bohrer
2007-10-06 21:52 ` Frank Lichtenheld
2007-10-07  1:13   ` Shawn Bohrer
2007-10-08  2:04 ` Jeff King
2007-10-08  2:08   ` Jeff King
2007-10-08  2:17   ` Linus Torvalds
2007-10-08  2:22     ` Jeff King
2007-10-08  6:37       ` Johannes Sixt
2007-10-08 18:27         ` Linus Torvalds

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=7vbqa8j5yr.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=shawn.bohrer@gmail.com \
    /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).