git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: "Vusich, Joseph" <jvusich@amazon.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: bug: conflicting core.bare setting causes segfault during bare clone
Date: Wed, 3 Mar 2021 23:59:28 +0000	[thread overview]
Message-ID: <YEAi4OkkNnp+IMJD@camp.crustytoothpaste.net> (raw)
In-Reply-To: <D99DD9AD-54E5-4357-BA50-8B9CAE23084E@amazon.com>

[-- Attachment #1: Type: text/plain, Size: 2034 bytes --]

On 2021-03-03 at 00:06:01, Vusich, Joseph wrote:
> Thank you for filling out a Git bug report!
> Please answer the following questions to help us understand your issue.
> 
> What did you do before the bug happened? (Steps to reproduce your issue)
> 
> $ env | grep GIT
> 
> $ git config --list
> user.email=jvusich@amazon.com
> user.name=Joseph Vusich
> core.bare=false
> 
> $ git clone --bare https://github.com/josephvusich/fixture
> Cloning into bare repository 'fixture.git'...
> zsh: segmentation fault  /opt/local/bin/git clone --bare https://github.com/josephvusich/fixture
> 
> What did you expect to happen? (Expected behavior)
> 
> "git clone --bare" should clone a bare repository, regardless of the core.bare setting in the global config
> 
> What happened instead? (Actual behavior)
> 
> "git clone --bare" causes a segfault if the global gitconfig has core.bare=false

I appreciate the report, and I can reproduce with 45526154a5 from next.
We should definitely not segfault in this case.  I completely agree that
segfaulting is the wrong behavior (because it's always the wrong
behavior for a command-line tool).

I do, however, think we should either ignore core.bare in the global
configuration, if we don't already, or produce an error.  The
documentation says, "If true this repository is assumed to be bare" and
much like we ignore certain other settings outside of .git/config, we
should ignore this one.

I also agree that "git clone --bare" should clone a bare repository
since we'd ignore the global setting.

I'm probably not going to get a chance to look at this before the
weekend, so anyone is free to come up with a patch in the meantime, but
if nobody has gotten to it then, I'll try to send out a patch.

I will admit being a bit interested in how this was discovered, since it
seems like an odd configuration to have, so if you can share, I'd
appreciate it, if only to satisfy my curiosity.
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2021-03-04  0:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03  0:06 bug: conflicting core.bare setting causes segfault during bare clone Vusich, Joseph
2021-03-03 23:59 ` brian m. carlson [this message]
2021-03-04  1:13   ` Junio C Hamano
2021-03-04 11:48     ` Vusich, Joseph
2021-03-08 13:17 ` [PATCH] builtin/init-db: handle bare clones when core.bare set to false brian m. carlson
2021-03-08 16:43   ` Eric Sunshine
2021-03-08 23:22     ` brian m. carlson
2021-03-10  1:11 ` [PATCH v2] " brian m. carlson
2021-03-10 23:09   ` Junio C Hamano
2021-03-10 23:33     ` brian m. carlson

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YEAi4OkkNnp+IMJD@camp.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=jvusich@amazon.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).