Re: [PATCH] Make git-clean a builtin

Previous thread: [PATCH] git-commit.sh: Fix usage checks regarding paths given when they do not make sense by Björn Steinbrink on Monday, November 5, 2007 - 12:36 pm. (2 messages)

Next thread: Re: [PATCH 0/3] more terse push output by Junio C Hamano on Monday, November 5, 2007 - 2:14 pm. (1 message)
From: Junio C Hamano
Date: Monday, November 5, 2007 - 2:14 pm

This means we are committed to make clean.requireForce default
to true, which is fine by me.  I need to warn the users about

Please do not explicitly initialize static variables to zero.
-

From: Carlos Rica
Date: Monday, November 5, 2007 - 3:10 pm

Is it really needed to declare those variables outside of a function
in this case? This scheme makes difficult reusing the code from other
builtins, rewriting it for libification, calling it many times, or
even understand if they were declared that way with a purpose or not.
I just don't know why they are that way in this case, is there a
reason for it?
-

From: Junio C Hamano
Date: Monday, November 5, 2007 - 4:54 pm

I do not think so --- I suspect that this is a simple cut &
paste from the standalone ls-files implementation.
-

From: Shawn Bohrer
Date: Monday, November 5, 2007 - 10:05 pm

Actually I don't care either way, but in my last rebase on next this

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.

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?
-

From: Junio C Hamano
Date: Monday, November 5, 2007 - 10:30 pm

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"

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.
-

Previous thread: [PATCH] git-commit.sh: Fix usage checks regarding paths given when they do not make sense by Björn Steinbrink on Monday, November 5, 2007 - 12:36 pm. (2 messages)

Next thread: Re: [PATCH 0/3] more terse push output by Junio C Hamano on Monday, November 5, 2007 - 2:14 pm. (1 message)