git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Make git-clean a builtin

From
Shawn Bohrer <shawn.bohrer@gmail.com>
Date
Nov 6, 2007, 05:05 UTC
Message-ID
<20071106050512.GA6768@mediacenter.austin.rr.com>
In-Reply-To
<7vejf4pf7r.fsf@gitster.siamese.dyndns.org>
On Mon, Nov 05, 2007 at 01:14:32PM -0800, Junio C Hamano wrote:
Show 7 quoted lines
> 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.

Show 7 quoted lines
> > +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.

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?

Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 15 in “[RFC] Second attempt at making git-clean a builtin”
  1. Shawn BohrerNov 4, 2007
  2. Add more tests for git-cleanShawn Bohrer, Nov 4, 2007
  3. Make git-clean a builtinShawn Bohrer, Nov 4, 2007
  4. Pierre HabouzitNov 4, 2007
  5. 3/2 Use parse-options in builtin-cleanJohannes Schindelin, Nov 4, 2007
  6. Pierre HabouzitNov 4, 2007
  7. Junio C HamanoNov 5, 2007
  8. Carlos RicaNov 5, 2007
  9. Junio C HamanoNov 5, 2007
  10. Shawn BohrerNov 6, 2007
  11. Junio C HamanoNov 6, 2007
  12. Junio C HamanoNov 4, 2007
  13. Pierre HabouzitNov 4, 2007
  14. Junio C HamanoNov 5, 2007
  15. Johannes SchindelinNov 4, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.