Re: [PATCH v2 2/9] test-lib.sh: convert $TEST_DIRECTORY to an absolute path
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 12, 2013, 20:06 UTC
- Message-ID
- <xmqqfvr1gzbc.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <5281C522.7050403@bbn.com>
Richard Hansen <rhansen@bbn.com> writes:
Show 9 quoted lines
> On 2013-11-12 00:54, Richard Hansen wrote: >> If $TEST_DIRECTORY is specified in the environment, convert the value >> to an absolute path to ensure that it remains valid even when 'cd' is >> used. >> >> Signed-off-by: Richard Hansen <rhansen@bbn.com> > > Actually, credit for this and the next patch should go to Felipe. How > should I note that?
If the patch text was copied from his response message, you would start the _body_ of your e-mail as:
From: F.. C.. <felipe.contreras@gmail.com>
If $TEST_DIRECTORY is specified ... Signed-off-by: F.. C.. <felipe.contreras@gmail.com>
Signed-off-by: R Hansen <rhansen@...>
_after_ getting him say it is OK to add his Sign-off. The first
line in the body of your e-mail, "From: Real Author", followed by a
blank line, will signal to "git am" that you are forwarding a patch
by somebody else, and we record that real author on the "author"
line of the resulting commit object.On the other hand, if the patch is based on the _idea_ you gained by discussing with him, you would just mention it near your sign-off, like this:
If $TEST_DIRECTORY is specified ...
Helped-by: F... C... <felipe.contreras@gmail.com> Signed-off-by: R... Hansen <rhansen@...>
Show 24 quoted lines
> > Thanks, > Richard > > >> --- >> t/test-lib.sh | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/t/test-lib.sh b/t/test-lib.sh >> index b25249e..af172d9 100644 >> --- a/t/test-lib.sh >> +++ b/t/test-lib.sh >> @@ -26,6 +26,10 @@ then >> # outside of t/, e.g. for running tests on the test library >> # itself. >> TEST_DIRECTORY=$(pwd) >> +else >> + # ensure that TEST_DIRECTORY is an absolute path so that it >> + # works even if the current working directory is changed >> + TEST_DIRECTORY=$(cd "$TEST_DIRECTORY" && pwd) || exit 1 >> fi >> if test -z "$TEST_OUTPUT_DIRECTORY" >> then