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

Re: [PATCH] doc: filter-branch does not require re-export of vars

From
Jeff King <peff@peff.net>
Date
May 29, 2017, 04:20 UTC
Message-ID
<20170529042005.xgjx2kuuelak62sl@sigill.intra.peff.net>
In-Reply-To
<CAJZjrdVjeeHUN_biza-MA9iqP5Y5CO3DkLaGG-Bq1w5oo5tW_g@mail.gmail.com>
On Sun, May 28, 2017 at 09:35:30PM -0400, Samuel Lijin wrote:
Show 5 quoted lines
> > However, I think POSIX mandates the behavior you'd expect. And the only
> > shell I know that misbehaves in this way is Solaris /bin/sh, which we
> > have already declared too broken to support.
> 
> Off-topic, but where is this explicitly documented?

I couldn't find a place that mentioned it explicitly, but POSIX defines the concept as "the export attribute" of the variables. Which implies to me that the bit is tied to the variable itself, not its value.

It also says that the flag is cleared when a variable is unset, so:
  foo=one
  export foo
  sh -c 'echo $foo should be one'
  unset foo
  foo=two
  sh -c 'echo $foo is not exported'

That could potentially affect somebody writing a filter-branch snippet, but presumably if they are using "unset" they know what they're doing.

-Peff
Previous: Samuel LijinNext: Junio C Hamano
Message 5 of 7 in “doc: filter-branch does not require re-export of vars”
  1. doc: filter-branch does not require re-export of varsAndreas Heiduk, May 26, 2017
  2. Jeff KingMay 26, 2017
  3. Junio C HamanoMay 28, 2017
  4. Samuel LijinMay 29, 2017
  5. Jeff KingMay 29, 2017
  6. Junio C HamanoMay 29, 2017
  7. Jeff KingMay 29, 2017

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.