On Sat, Apr 6, 2024 at 5:15 AM Andreas Schwab <schwab@xxxxxxxxxxxxxx> wrote: > On Apr 06 2024, Eric Sunshine wrote: > > On Fri, Apr 5, 2024 at 8:09 PM Junio C Hamano <gitster@xxxxxxxxx> wrote: > >> https://lore.kernel.org/git/201307081121.22769.tboegi@xxxxxx/ > >> 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 VAR not the other way around, so it makes sense for CodingGuidelines to illustrate it in a fashion consistent with its use in the project.