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

Re: [PATCH 1/2] clone: allow "--bare" with "-o"

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Sep 22, 2022, 05:58 UTC
Message-ID
<CAPig+cTEF=jBoW07_eLQ_BAWxULfWtehVa-JbJKpS+8rPenSiQ@mail.gmail.com>
In-Reply-To
<YyvzVdfQVdysvMp2@coredump.intra.peff.net>
On Thu, Sep 22, 2022 at 1:33 AM Jeff King <peff@peff.net> wrote:
Show 17 quoted lines
> [...]
> Let's allow the options to be used together, and switch the "forbid"
> test in t5606 to check that we use the requested name. That test came
> much later in 349cff76de (clone: add tests for --template and some
> disallowed option pairs, 2020-09-29), and does not offer any logic
> beyond "let's test what the code currently does".
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
> @@ -42,11 +42,12 @@ test_expect_success 'rejects invalid -o/--origin' '
> +test_expect_success 'clone --bare -o' '
> +       git clone -o foo --bare parent clone-bare-o &&
> +       (cd parent && pwd) >expect &&
> +       git -C clone-bare-o config remote.foo.url >actual &&
> +       test_cmp expect actual
>  '
Is this safe on Microsoft Windows? My understanding from t/README:
    When a test checks for an absolute path that a git command
    generated, construct the expected value using $(pwd) rather than
    $PWD, $TEST_DIRECTORY, or $TRASH_DIRECTORY. It makes a difference
    on Windows, where the shell (MSYS bash) mangles absolute path
    names. For details, see the commit message of 4114156ae9.

was that you should use $(pwd) rather than raw `pwd` when comparing against a path generated by Git. Is there a gap in my understanding here?

Previous: Jeff KingNext: Jeff King
Message 5 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.