[m-rev.] for review: git hook improvements

Zoltan Somogyi zoltan.somogyi at runbox.com
Wed Mar 13 16:21:51 AEDT 2024


On 2024-03-13 15:57 +11:00 AEDT, "Peter Wang" <novalazy at gmail.com> wrote:
> On Sat, 09 Mar 2024 18:34:58 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
>> For review by Peter.

>>  rootdir=$( git rev-parse --show-toplevel )
>> -update_copyright="$rootdir/git_hooks/update_copyright"
>> +if test "${UPDATE_MERCURY_COPYRIGHT}" != ""
>> +then
>> +    update_copyright="${UPDATE_MERCURY_COPYRIGHT}"
>> +else
>> +    update_copyright="$rootdir/git_hooks/update_copyright"
>> +fi
> 
> Obviously that could also be:
> 
>     update_copyright=${UPDATE_MERCURY_COPYRIGHT-"$rootdir/git_hooks/update_copyright"}

I could be, but there about a dozen short char sequences you can put
between the var name and the default, they have all slightly different semantics,
and I find it hard to remember which is which. The longer code I used
is easier to check, at least for fossils like myself.

I followed all your other suggestions. The attached diff includes them all,
as well as the previously missing Makefile. Does it have your approval?

Thanks for the review.

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.gh2
Type: application/octet-stream
Size: 5821 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20240313/b5ea3682/attachment.obj>


More information about the reviews mailing list