Re: [PATCH] transport-helper: enforce atomic in push_refs_with_push

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Emily,

On Wed, 3 Jul 2019, Emily Shaffer wrote:

> > > +	up="$HTTPD_URL"/smart/atomic-branches.git &&
> > > +	test_commit atomic1 &&
> > > +	test_commit atomic2 &&
> > > +	git push "$up" master &&
> >
> > It would be more succinct to do a `git clone --bare . "$d"` here, instead
> > of a `git init --bare` and a `git push` no?
>
> I'm not sure I would say "more succinct." This leaves the test with the
> same number of lines,

No, it does not, as `git clone --bare . "$d"` does _both_ the initializing
and the object transfer.

It only saves one line, of course, but do keep in mind that anybody
running into any kind of regression with your test case needs to
understand what it does. And from experience I can tell you that reading
any test case longer than 5 lines is quite annoying when you actually
only care about fixing the regression, and not so much about the wonderful
story the test case tells.

So in a sense, I guess I would even suggest to move as much of the setup
for your test cases outside, preferably into an initial `setup` test case
that initializes the minimal scenario required by the regression test
case.

Thanks,
Dscho




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux