Message ID | 20240726081522.28015-2-ericsunshine@charter.net (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | improve one-shot variable detection with shell function | expand |
Eric Sunshine <ericsunshine@charter.net> writes: > From: Eric Sunshine <sunshine@sunshineco.com> > > The behavior of a one-shot environment variable assignment of the form > "VAR=val cmd" is undefined according to POSIX when "cmd" is a shell Please use the right word to describe what the standard says. Throughout the topic's discussion, you seem to be repeating "undefined", but the word POSIX uses for this particular unportable behaviour is "unspecified". The differences are subtle, and for programs that want to be conformant, there is no practical difference (in other words, we should not rely on the existence or validity of the value or behaviour if we wanted to be portable). The former is what results from use of an invalid construct or feeding an invalid data input. The implementation can do whatever it wants to do once you trigger an undefined behaviour. The latter is what results from use of a valid construct or valid data input, but outcome may differ across implementations. An "unspecified" behaviour often are still consistent and sensible within a single conformant implementation.
On Fri, Jul 26, 2024 at 2:50 PM Junio C Hamano <gitster@pobox.com> wrote: > Eric Sunshine <ericsunshine@charter.net> writes: > > The behavior of a one-shot environment variable assignment of the form > > "VAR=val cmd" is undefined according to POSIX when "cmd" is a shell > > Please use the right word to describe what the standard says. > > Throughout the topic's discussion, you seem to be repeating > "undefined", but the word POSIX uses for this particular unportable > behaviour is "unspecified". The differences are subtle, and for > programs that want to be conformant, there is no practical > difference (in other words, we should not rely on the existence or > validity of the value or behaviour if we wanted to be portable). > > The former is what results from use of an invalid construct or > feeding an invalid data input. The implementation can do whatever > it wants to do once you trigger an undefined behaviour. The latter > is what results from use of a valid construct or valid data input, > but outcome may differ across implementations. An "unspecified" > behaviour often are still consistent and sensible within a single > conformant implementation. Makes sense. Will adjust the commit messages.
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh index 36ca126bcd..2aa8593f77 100755 --- a/t/t3430-rebase-merges.sh +++ b/t/t3430-rebase-merges.sh @@ -392,8 +392,7 @@ test_expect_success 'refuse to merge ancestors of HEAD' ' test_expect_success 'root commits' ' git checkout --orphan unrelated && - (GIT_AUTHOR_NAME="Parsnip" GIT_AUTHOR_EMAIL="root@example.com" \ - test_commit second-root) && + test_commit --author "Parsnip <root@example.com>" second-root && test_commit third-root && cat >script-from-scratch <<-\EOF && pick third-root