Re: [PATCH 1/6] CodingGuidelines: describe "export VAR=VAL" rule
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Apr 6, 2024, 17:34 UTC
- Message-ID
- <CAPig+cQurykHFWvPY7jRKSPARMDyUhJJHH8fL6zffE6ke8b1mA@mail.gmail.com>
- In-Reply-To
- <87bk6mc0nj.fsf@linux-m68k.org>
On Sat, Apr 6, 2024 at 5:15 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
Show 21 quoted lines
> On Apr 06 2024, Eric Sunshine wrote: > > On Fri, Apr 5, 2024 at 8:09 PM Junio C Hamano <gitster@pobox.com> wrote: > >> https://lore.kernel.org/git/201307081121.22769.tboegi@web.de/ > >> resulted in 9968ffff (test-lint: detect 'export FOO=bar', > >> 2013-07-08) to add a rule to t/check-non-portable-shell.pl script to > >> reject > >> > >> export VAR=VAL > >> > >> and suggest us to instead write it as "export VAR" followed by > >> "VAR=VAL". This however was not spelled out in the CodingGuidelines > >> document. > > > > I suspect you meant: > > > > ... and suggest us to instead write it as "VAR=VAL" followed by > > "export VAR". > > There is no difference between them. The export command only marks the > variable for export, independent of the current or future value of the > variable. The exported value is always the last assigned one.
Yes, I know, but it is customary in this code-base to write it as:
VAR=VAL &&
export VARnot the other way around, so it makes sense for CodingGuidelines to illustrate it in a fashion consistent with its use in the project.