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

Re: fatal: options '--bare' and '--origin foo' cannot be used together

From
Jeff King <peff@peff.net>
Date
Sep 22, 2022, 05:31 UTC
Message-ID
<YyvzIQL9H9aTYNch@coredump.intra.peff.net>
In-Reply-To
<Yyvq01W/r73xfgqf@coredump.intra.peff.net>
On Thu, Sep 22, 2022 at 12:55:47AM -0400, Jeff King wrote:
Show 6 quoted lines
> This second case is IMHO a minor bug in the git-remote code. As
> documented in git-clone(1):
> [...]
> So probably it needs to use the "gently" version of git_config_set_multivar(),
> which avoids calling die(), and then check for a return code which
> indicates no value was found.

Actually, there is an even simpler fix. So here are two cleaned-up patches which fix both issues you found.

  [1/2]: clone: allow "--bare" with "-o"
  [2/2]: remote: handle rename of remote without fetch refspec
 builtin/clone.c          |  3 ---
 builtin/remote.c         | 48 +++++++++++++++++++++-------------------
 t/t5505-remote.sh        | 11 +++++++++
 t/t5606-clone-options.sh |  9 ++++----
 4 files changed, 41 insertions(+), 30 deletions(-)
-Peff
Previous: Jeff KingNext: Jeff King
Message 3 of 11 in “fatal: options '--bare' and '--origin foo' cannot be used together”
  1. John A. LeuenhagenSep 21, 2022
  2. Jeff KingSep 22, 2022
  3. Jeff KingSep 22, 2022
  4. 1/2 clone: allow "--bare" with "-o"Jeff King, Sep 22, 2022
  5. Eric SunshineSep 22, 2022
  6. Jeff KingSep 22, 2022
  7. Eric SunshineSep 22, 2022
  8. Jeff KingSep 22, 2022
  9. Eric SunshineSep 22, 2022
  10. Jeff KingSep 22, 2022
  11. 2/2 remote: handle rename of remote without fetch refspecJeff King, Sep 22, 2022

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.