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

Re: [PATCH] git-init: treat option `--bare'

From
Junio C Hamano <gitster@pobox.com>
Date
May 29, 2008, 00:55 UTC
Message-ID
<7vzlqaq67h.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080528185357.GB4431@bit.office.eurotux.com>
Luciano Rocha <luciano@eurotux.com> writes:
Show 12 quoted lines
> Currently, passing the `--bare' option to git-init proper doesn't work, and
> gives no indication that `git --bare init' would work instead:
>
> $ git init --bare
> usage: git-init [-q | --quiet] [--template=<template-directory>] [--shared]
>
> Treat the `--bare' option internally in builtin-init-db.
>
> Also, fix the usage string, synchronising it with the synopsis in the
> documentation.
>
> Signed-off-by: Luciano Rocha <strange@nsk.pt>

It could be argued that this kind of "special casing to help common mistake situation" would in the long run hamper the new users in understanding what --bare means, because one who uses "git init --bare" will not realize that --bare is an option to "git" potty in general and can be given when invoking other git commands. On the other hand, many commands do work sensibly inside a bare repository already, and "init" is truly special in that it cannot inspect the surroundings to guess if the user wants to create a bare repository or one with a work-tree because there isn't a repository yet. In that sense, probably people not learning "git --bare" is not such a loss after all.

In general, I am not particularly fond of this kind of special casing, but initializing a bare repository would be a common enough operation that I personally think it is probably Ok to take this as an exception.

Opinions?  Breakages?
Previous: Luciano RochaNext: Luciano Rocha
Message 9 of 12 in “bare --init Vs --init bare”
  1. Luciano RochaMay 19, 2008
  2. Santi BéjarMay 19, 2008
  3. Luciano RochaMay 19, 2008
  4. git-init: inform user of `git --bare init' optionLuciano Rocha, May 20, 2008
  5. Junio C HamanoMay 23, 2008
  6. Luciano RochaMay 23, 2008
  7. git-init: treat option `--bare'Luciano Rocha, May 28, 2008
  8. Luciano RochaMay 28, 2008
  9. Junio C HamanoMay 29, 2008
  10. Luciano RochaMay 29, 2008
  11. Johannes SchindelinMay 29, 2008
  12. Junio C HamanoMay 29, 2008

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.