mbox series

[v2,0/4] update-ref: Allow creation of multiple transactions

Message ID cover.1604908834.git.ps@pks.im (mailing list archive)
Headers show
Series update-ref: Allow creation of multiple transactions | expand

Message

Patrick Steinhardt Nov. 9, 2020, 10:06 a.m. UTC
Hi,

this is the second version of this patch series implementing support for
creation of multiple reference transactions in a single git-update-ref
process.

There's two changes compared to v1:

    - A small refactoring of t1400, which refactors many tests to not
      touch references via the filesystem but instead to use
      git-update-ref and git-show-ref. There's still tests in there
      which do, but converting them is harder as they create and read
      broken references.

    - I've added another commit on top which disallows restarting of
      transactions. E.g. writing "start\nstart\n" to git-update-ref is
      now going to fail.

Patrick

Patrick Steinhardt (4):
  t1400: Avoid touching refs on filesystem
  update-ref: Allow creation of multiple transactions
  p1400: Use `git-update-ref --stdin` to test multiple transactions
  update-ref: Disallow restart of ongoing transactions

 Documentation/git-update-ref.txt |   3 +-
 builtin/update-ref.c             |  15 +++-
 t/perf/p1400-update-ref.sh       |  20 ++---
 t/t1400-update-ref.sh            | 124 ++++++++++++++++++++++++-------
 4 files changed, 119 insertions(+), 43 deletions(-)

Comments

Jeff King Nov. 9, 2020, 10:33 p.m. UTC | #1
On Mon, Nov 09, 2020 at 11:06:43AM +0100, Patrick Steinhardt wrote:

> this is the second version of this patch series implementing support for
> creation of multiple reference transactions in a single git-update-ref
> process.
> 
> There's two changes compared to v1:
> 
>     - A small refactoring of t1400, which refactors many tests to not
>       touch references via the filesystem but instead to use
>       git-update-ref and git-show-ref. There's still tests in there
>       which do, but converting them is harder as they create and read
>       broken references.
> 
>     - I've added another commit on top which disallows restarting of
>       transactions. E.g. writing "start\nstart\n" to git-update-ref is
>       now going to fail.

Thanks. Aside from the issues raised by Junio, this all looks good to me
(and I agree on the fourth one it is just a matter of the commit
message; what the code is doing is a definite improvement).

-Peff
Junio C Hamano Nov. 9, 2020, 10:38 p.m. UTC | #2
Jeff King <peff@peff.net> writes:

> On Mon, Nov 09, 2020 at 11:06:43AM +0100, Patrick Steinhardt wrote:
>
>> this is the second version of this patch series implementing support for
>> creation of multiple reference transactions in a single git-update-ref
>> process.
>> 
>> There's two changes compared to v1:
>> 
>>     - A small refactoring of t1400, which refactors many tests to not
>>       touch references via the filesystem but instead to use
>>       git-update-ref and git-show-ref. There's still tests in there
>>       which do, but converting them is harder as they create and read
>>       broken references.
>> 
>>     - I've added another commit on top which disallows restarting of
>>       transactions. E.g. writing "start\nstart\n" to git-update-ref is
>>       now going to fail.
>
> Thanks. Aside from the issues raised by Junio, this all looks good to me
> (and I agree on the fourth one it is just a matter of the commit
> message; what the code is doing is a definite improvement).

Yeah, I agree that it is just terminology.  If we were to explain it
as lack of nested transaction, however, the error message would need
to be updated.  Other than that, I think this is quite good.

Oh, Patrick, please do not forget that it is our convention not to
Capitalize the word immediately after <area>: on the title of the
commit (cf. "git shortlog --no-merges -200").

Thanks.