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, 06:40 UTC
Message-ID
<CAPig+cSwYYD6U0bgHL+8pp+j8wOPRhVc6o6LdkP5eR=vOOy6HQ@mail.gmail.com>
In-Reply-To
<YywCImASth7I0Wx2@coredump.intra.peff.net>
On Thu, Sep 22, 2022 at 2:35 AM Jeff King <peff@peff.net> wrote:
Show 20 quoted lines
> On Thu, Sep 22, 2022 at 02:26:09AM -0400, Eric Sunshine wrote:
> > I was thinking, in particular, about this snippet from t/test-lib.sh:
> >
> >     # git sees Windows-style pwd
> >     pwd () {
> >         builtin pwd -W
> >     }
> >
> > If that's inherited by the subshell used in the test, then I suppose
> > all is okay, though I think it would not be inherited.
>
> I think it's OK. $() is itself a subshell, and you can find many calls
> to FOO=$(pwd) or similar. And in general, functions are inherited in
> subshells:
>
>   $ sh -c 'foo() { echo bar; }; (cd .. && foo)'
>   bar
>
> They'd have to be or many things in our test suite would break, since we
> use test_must_fail, etc, inside subshells.

Yep, thanks for the sanity dose. For some reason, my brain was off-kilter, thinking that it was running a shell afresh, not just using a subshell.

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