Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

improve delete support on push #472

Merged
merged 1 commit into from
Jul 11, 2017
Merged

improve delete support on push #472

merged 1 commit into from
Jul 11, 2017

Conversation

smola
Copy link
Collaborator

@smola smola commented Jul 10, 2017

  • server: implement delete-refs and announce it.
  • remote: check if server announced delete-refs before trying
    to delete and fail fast if it does not.

Note that the client does not need no send 'delete-refs' back
to the server to be able to delete references:

delete-refs
-----------
   
If the server sends back the 'delete-refs' capability, it means that
it is capable of accepting a zero-id value as the target
value of a reference update.  It is not sent back by the client, it
simply informs the client that it can be sent zero-id values
to delete references.

So our server implementation does not check if the client sent
delete-refs back, it just accepts deletes if it receives them.

@smola smola requested a review from mcuadros July 10, 2017 16:33
remote.go Outdated
var NoErrAlreadyUpToDate = errors.New("already up-to-date")
var (
NoErrAlreadyUpToDate = errors.New("already up-to-date")
ErrServerDoesNotSupportDelete = errors.New("server does not support delete")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ErrDeleteRefNotSupported = errors.New("server does not support delete-refs")

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

* server: implement delete-refs and announce it.
* remote: check if server announced delete-refs before trying
  to delete and fail fast if it does not.

Note that the client does not need no send 'delete-refs' back
to the server to be able to delete references:

```
delete-refs
-----------

If the server sends back the 'delete-refs' capability, it means that
it is capable of accepting a zero-id value as the target
value of a reference update.  It is not sent back by the client, it
simply informs the client that it can be sent zero-id values
to delete references.
```

So our server implementation does not check if the client sent
delete-refs back, it just accepts deletes if it receives them.
@codecov
Copy link

codecov bot commented Jul 11, 2017

Codecov Report

Merging #472 into master will decrease coverage by 0.58%.
The diff coverage is 78.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #472      +/-   ##
==========================================
- Coverage   78.07%   77.48%   -0.59%     
==========================================
  Files         127      127              
  Lines        9268     9270       +2     
==========================================
- Hits         7236     7183      -53     
- Misses       1244     1311      +67     
+ Partials      788      776      -12
Impacted Files Coverage Δ
remote.go 72.12% <77.77%> (-0.02%) ⬇️
plumbing/transport/server/server.go 59.61% <80%> (+1.39%) ⬆️
plumbing/transport/ssh/common.go 2.81% <0%> (-45.08%) ⬇️
plumbing/transport/ssh/auth_method.go 33.33% <0%> (-24.77%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b69a16...09f5f2a. Read the comment docs.

@smola
Copy link
Collaborator Author

smola commented Jul 11, 2017

Updated the PR, since my initial approach was not fully working. @ajnavarro is now verifying this in src-d/borges.

EDIT: Verified 👍

@mcuadros mcuadros merged commit d42ecf6 into src-d:master Jul 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants