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

storage: shallow storage #180

Merged
merged 3 commits into from
Dec 15, 2016
Merged

storage: shallow storage #180

merged 3 commits into from
Dec 15, 2016

Conversation

mcuadros
Copy link
Contributor

@mcuadros mcuadros commented Dec 13, 2016

This PR implements the shallow storage, when a Repository is cloned using Depth != 0, the shallow commits should be saved

@codecov-io
Copy link

codecov-io commented Dec 13, 2016

Current coverage is 77.12% (diff: 77.50%)

Merging #180 into master will decrease coverage by 0.61%

@@             master       #180   diff @@
==========================================
  Files            91         92     +1   
  Lines          5823       5863    +40   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits           4527       4522     -5   
- Misses          816        866    +50   
+ Partials        480        475     -5   

Powered by Codecov. Last update fb7b525...a5b4d3b


// ShallowStorer storage of shallow commits, meaning that it does not have the
// parents of a commit (explanation from git documentation)
type ShallowStorer interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is there a storer.ShallowStorer interface when we already have an storer.ObjectStorer?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why the interfaces repeat the word Storer in their name when it is already part of the package name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it only stores the references not the objects it self.
Yes maybe we can keep the Storer what you suggest?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. The comments of ShallowStorer suggest it stores commits not hashes. I would change that.

If this is just a collection of hashes I would said it so, and remove any reference to the shallow word in the name of the interface. Maybe call it Hashes, for example.

I would call it storer.Hashes or storer.HashCollection.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd propose something along these lines:

// ShallowStorer storage of references to shallow commits by hash, meaning that these commits have
// missing parents because of a shallow fetch.

?


import (
"fmt"

Copy link
Collaborator

Choose a reason for hiding this comment

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

extra space ;)

@mcuadros mcuadros merged commit 76f2e6e into src-d:master Dec 15, 2016
mcuadros added a commit that referenced this pull request Jan 31, 2017
* storage: shallow storage

* changes

* changes
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.

4 participants