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 26, 2017, 18:37 UTC
Message-ID
<20170526183702.jrjkykhldz74pquq@sigill.intra.peff.net>
In-Reply-To
<20170526173654.4238-1-asheiduk@gmail.com>
On Fri, May 26, 2017 at 07:36:54PM +0200, Andreas Heiduk wrote:
> The function `set_ident` in `filter-branch` exported the variables
> GIT_(AUTHOR|COMMITTER)_(NAME|EMAIL|DATE) at least since 6f6826c52b in 2007.
> Therefore the filter scripts don't need to re-eport them again.

Some old shells keep separate values for the internal and exporter versions of variables. I.e., this:

  foo=one
  export foo
  foo=two

would continue to export $foo as "one", even though it is "two" inside the script.

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. According to

  https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Limitations-of-Builtins.html#export

it sounds like there are some other antique shells which may do the same (it doesn't cover this case explicitly, but the "coexist" cases it mentions are likely to behave in this way).

At this point, I'd be inclined to remove the text as you suggest and either make a small note at the bottom of the page, or just omit it entirely and assume that anybody on an old non-POSIX shell can fend for themselves.

-Peff
Previous: Andreas HeidukNext: Junio C Hamano
Message 2 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.