Re: [PATCH v2 01/11] t: add tool to translate hash-related values

2018-08-19 Thread brian m. carlson
On Sun, Aug 19, 2018 at 07:06:14PM -0400, Eric Sunshine wrote: > On Sun, Aug 19, 2018 at 5:50 PM brian m. carlson > wrote: > > I think what I'd like to do instead is store in a variable and make > > test_oid return unsuccessfully if the value doesn't exist. I think > > that's better for writing

Re: [PATCH v2 01/11] t: add tool to translate hash-related values

2018-08-19 Thread Eric Sunshine
On Sun, Aug 19, 2018 at 5:50 PM brian m. carlson wrote: > On Sun, Aug 19, 2018 at 03:40:22PM -0400, Eric Sunshine wrote: > > On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson > > wrote: > > > + test "$(test_oid hexsz)" -eq $(wc -c > > + test $(( $(test_oid rawsz) * 2)) -eq

Re: [PATCH v2 01/11] t: add tool to translate hash-related values

2018-08-19 Thread brian m. carlson
On Sun, Aug 19, 2018 at 03:40:22PM -0400, Eric Sunshine wrote: > On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson > wrote: > > diff --git a/t/oid-info/oid b/t/oid-info/oid > > @@ -0,0 +1,29 @@ > > +# All zeros or Fs missing one or two hex segments. > > +zero_1

Re: [PATCH v2 01/11] t: add tool to translate hash-related values

2018-08-19 Thread Eric Sunshine
On Sun, Aug 19, 2018 at 1:54 PM brian m. carlson wrote: > diff --git a/t/oid-info/oid b/t/oid-info/oid > @@ -0,0 +1,29 @@ > +# All zeros or Fs missing one or two hex segments. > +zero_1 sha1:000 > +zero_2 >

[PATCH v2 01/11] t: add tool to translate hash-related values

2018-08-19 Thread brian m. carlson
Add a test function helper, test_oid, that produces output that varies depending on the hash in use. Add an additional helper, test_oid_cache, that can be used to load data for test_oid, either through a list of filenames or on standard input. Check that these functions work in t, as the