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

Re: [PATCH 2/2] config: die when --blob is used outside a repository

From
Taylor Blau <me@ttaylorr.com>
Date
May 18, 2018, 22:31 UTC
Message-ID
<20180518223134.GA56823@syl.local>
In-Reply-To
<20180518222704.GB9623@sigill.intra.peff.net>
On Fri, May 18, 2018 at 03:27:04PM -0700, Jeff King wrote:
> If you run "config --blob" outside of a repository, then we
> eventually try to resolve the blob name and hit a BUG().
> Let's catch this earlier and provide a useful message.

I think that this approach is sensible. Let's (1) fix a SIGSEGV that should be a BUG(), and (2) make sure that we never get there in the first place.

This looks fine to me.
Show 8 quoted lines
> Note that we could also catch this much lower in the stack,
> in git_config_from_blob_ref(). That might cover other
> callsites, too, but it's unclear whether those ones would
> actually be bugs or not. So let's leave the low-level
> functions to assume the caller knows what it's doing (and
> BUG() if it turns out it doesn't).
>
> Signed-off-by: Jeff King <peff@peff.net>

Thanks, Taylor

Previous: Jeff KingNext: Johannes Schindelin
Message 5 of 6 in “fix a segfault in get_main_ref_store()”
  1. 0/2 fix a segfault in get_main_ref_store()Jeff King, May 18, 2018
  2. 1/2 get_main_ref_store: BUG() when outside a repositoryJeff King, May 18, 2018
  3. Stefan BellerMay 18, 2018
  4. 2/2 config: die when --blob is used outside a repositoryJeff King, May 18, 2018
  5. Taylor BlauMay 18, 2018
  6. Johannes SchindelinMay 18, 2018

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.