diff options
author | Patrick Steinhardt <ps@pks.im> | 2020-04-02 09:09:57 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-04-02 11:09:49 -0700 |
commit | 94fd491a54b955990146f63e7283e9813dc85fef (patch) | |
tree | 031acd3d064226897ed11ebeacf4615cdccdf10d /t/t9824-git-p4-git-lfs.sh | |
parent | update-ref: move transaction handling into `update_refs_stdin()` (diff) | |
download | tgif-94fd491a54b955990146f63e7283e9813dc85fef.tar.xz |
update-ref: read commands in a line-wise fashion
The git-update-ref(1) supports a `--stdin` mode that allows it to read
all reference updates from standard input. This is mainly used to allow
for atomic reference updates that are all or nothing, so that either all
references will get updated or none.
Currently, git-update-ref(1) reads all commands as a single block of up
to 1000 characters and only starts processing after stdin gets closed.
This is less flexible than one might wish for, as it doesn't really
allow for longer-lived transactions and doesn't allow any verification
without committing everything. E.g. one may imagine the following
exchange:
> start
< start: ok
> update refs/heads/master $NEWOID1 $OLDOID1
> update refs/heads/branch $NEWOID2 $OLDOID2
> prepare
< prepare: ok
> commit
< commit: ok
When reading all input as a whole block, the above interactive protocol
is obviously impossible to achieve. But by converting the command to
read commands linewise, we can make it more interactive than before.
Obviously, the linewise interface is only a first step in making
git-update-ref(1) work in a more transaction-oriented way. Missing is
most importantly support for transactional commands that manage the
current transaction.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9824-git-p4-git-lfs.sh')
0 files changed, 0 insertions, 0 deletions