Message ID | 20230602023105.17979-1-five231003@gmail.com (mailing list archive) |
---|---|
Headers | show |
Series | Add new "signature" atom | expand |
Kousik Sanagavarapu <five231003@gmail.com> writes: > I have also rebased this to be on top of v2.41.0, the previous version > was on top of v2.41.0-rc0. I am still feverish and feeling weak so no real review from me yet, but there is one thing that immediately jumped at me. > Range-diff against v1: > > 1: 5c97d11b79 ! 1: 87465ef1a8 t/lib-gpg: introduce new prereq GPG2 > @@ t/lib-gpg.sh: test_lazy_prereq GPG ' > + test $? != 127 || exit 1 > + > + case "$gpg_version" in > -+ !"gpg (GnuPG) 2."*) > ++ "gpg (GnuPG) 0."* | "gpg (GnuPG) 1.*") The last '*' being inside double-quote would not be what you intended, I suspect?
On Fri, Jun 2, 2023 at 3:33 AM Junio C Hamano <gitster@pobox.com> wrote: > Kousik Sanagavarapu <five231003@gmail.com> writes: > > I have also rebased this to be on top of v2.41.0, the previous version > > was on top of v2.41.0-rc0. > > I am still feverish and feeling weak so no real review from me yet, > but there is one thing that immediately jumped at me. > > > 1: 5c97d11b79 ! 1: 87465ef1a8 t/lib-gpg: introduce new prereq GPG2 > > @@ t/lib-gpg.sh: test_lazy_prereq GPG ' > > + test $? != 127 || exit 1 > > + > > + case "$gpg_version" in > > -+ !"gpg (GnuPG) 2."*) > > ++ "gpg (GnuPG) 0."* | "gpg (GnuPG) 1.*") > > The last '*' being inside double-quote would not be what you > intended, I suspect? I noticed that, as well, when running my eye over the range-diff. Moreover, I wondered if using `[01]` to avoid the repetition would be worthwhile: case "$gpg_version" in "gpg (GnuPG) "[01].*) though, of course, it's subjective whether that is clearer.
On Fri, Jun 02, 2023 at 04:29:34PM +0900, Junio C Hamano wrote: > Kousik Sanagavarapu <five231003@gmail.com> writes: > > > I have also rebased this to be on top of v2.41.0, the previous version > > was on top of v2.41.0-rc0. > > I am still feverish and feeling weak so no real review from me yet, Please take care and get well soon. > but there is one thing that immediately jumped at me. > > > Range-diff against v1: > > > > 1: 5c97d11b79 ! 1: 87465ef1a8 t/lib-gpg: introduce new prereq GPG2 > > @@ t/lib-gpg.sh: test_lazy_prereq GPG ' > > + test $? != 127 || exit 1 > > + > > + case "$gpg_version" in > > -+ !"gpg (GnuPG) 2."*) > > ++ "gpg (GnuPG) 0."* | "gpg (GnuPG) 1.*") > > The last '*' being inside double-quote would not be what you > intended, I suspect? Yeah, that was kind of a typo, thanks for catching it. Thanks
Eric Sunshine <sunshine@sunshineco.com> writes: > Moreover, I wondered if using `[01]` to avoid the repetition would be > worthwhile: > > case "$gpg_version" in > "gpg (GnuPG) "[01].*) > > though, of course, it's subjective whether that is clearer. Excellent. I'd say that the value of your version is primarily that it is much less error prone than repeating the constant string part that can be misspelt. The glob limiting "begins with either '0' or '1' followed by a dot" might be slightly less easier to understand for less trained eyes, but eyes will not remain untrained forever, so it is OK.