162 Commits

Author SHA1 Message Date
Antonio Jesus Navarro Perez
be8d19438a Add Repository.Log() method (fix #298)
- CommitIter is now an interface
- The old CommitIter implementation is now called StorerCommitIter
- CommitWalker and CommitWalkerPost are now iterators (CommitPreIterator and CommitPostIterator).
- Remove Commit.History() method. There are so many ways to iterate a commit history, depending of the use case. Now, instead of use the History() method, you must use CommitPreIterator or CommitPostIterator.
- Move commitSorterer to references.go because is the only place that it is used, and it must not be used into another place.
- Make References method private, it must only be used into blame logic.
- Added a TODO into references method, where the sortCommits is used to remove it in a near future.
2017-04-11 11:22:45 +02:00
Santiago M. Mola
f51d4a8476 Merge pull request #296 from ajnavarro/improvement/repository
git: Repository methods changes
2017-03-21 10:27:56 +01:00
Antonio Jesus Navarro Perez
8df64141e3 use go-billy.v2 version 2017-03-10 12:23:51 +01:00
Antonio Jesus Navarro Perez
33e7c165c9 project: move imports from srcd.works to gopkg.in
To be able to fix #261 we will move again to gopkg.in before v4 stable release.
2017-03-07 12:58:18 +01:00
Antonio Jesus Navarro Perez
fa75ab40f9 git: Repository methods changes
To have a more consistent public API, we decided to rename some methods, and add others:

- Commit method renamed to CommitObject
- Commits method renamed to CommitObjects
- Tree method renamed to TreeObject
- Trees method renamed to TreeObjects
- Tags method renamed to TagObjects
- Tag method renamed to TagObject
- Added method Tags that returns tag references
- Added method Branches that returns branch references
- Added method Notes that returns note references
- Added BlobObject method
- Added BlobObjects method

Also, we added more functionality related to references:
- Added iterator to iterate References with a specific filter

Some notes:
- #298
2017-03-06 10:37:32 +01:00
Máximo Cuadros
ed288b30de documentation and API improvements 2017-02-21 16:03:39 +01:00
Máximo Cuadros
d6a6decd1b submodule update implementation 2017-02-15 09:30:05 +01:00
Máximo Cuadros
65351f835d Repository.Init now handles non-standard .git location 2017-02-13 23:59:49 +01:00
Máximo Cuadros
c551c29a93 submodule init implementation 2017-02-13 00:40:14 +01:00
Máximo Cuadros
b3b6e51565 submodule init implementation 2017-02-12 23:04:00 +01:00
Santiago M. Mola
726204ed80 git: make Storer public in Repository. 2017-02-09 15:28:48 +01:00
Anthony HAMON
d0cf207974 Add revision implementation (#139) 2017-02-06 17:53:11 +01:00
Máximo Cuadros
a6197bd8c4 documentation changes 2017-01-31 23:09:52 +01:00
Máximo Cuadros
85a4efcc45 new srcd.works/go-git.v4 path 2017-01-30 23:52:39 +01:00
Máximo Cuadros
30ebf1bd9b new git fixture path 2017-01-30 23:42:11 +01:00
Máximo Cuadros
80179adaab rename billy imports 2017-01-30 22:03:19 +01:00
Máximo Cuadros
35378e7db9 example: using new constructors 2017-01-30 16:13:56 +01:00
Máximo Cuadros
a48bc6e17e Repository.Progress moved as a field in *Options (#237) 2017-01-30 14:42:19 +01:00
Máximo Cuadros
45669655f0 test and comments improvements 2017-01-30 11:40:51 +01:00
Máximo Cuadros
d24e1e9a69 Repository.Worktree, removing custom fs 2017-01-30 11:27:11 +01:00
Máximo Cuadros
a052498f23 Repository.Clone made private 2017-01-29 22:53:24 +01:00
Máximo Cuadros
24c1878260 new repository constructors and worktree 2017-01-28 00:42:22 +01:00
Máximo Cuadros
241e8ba00a repository: fix pull when fetch returns up-to-date (#207) 2017-01-16 16:09:40 +01:00
Santiago M. Mola
90d67bb648 remote: add Push (#178)
* remote: add Push.

* add Push method to Remote.
* add method Push to Repository.
* examples: add push example.

* requested changes

* add tests, fixes
2016-12-19 23:36:44 +01:00
Santiago M. Mola
b3adbed0ce remote: make Fetch atomic. (#185)
* Remote now exposes only Fetch. No Connect, Disconnect, etc.
* Repository uses a private fetch method in Remote for Clone/Pull.
* getting capabilities, HEAD or other information from remote
  requires using the lower level client.
* add Fetch method to Repository.
2016-12-16 19:31:01 +01:00
Santiago M. Mola
0af572dd21 move plumbing from top level package to plumbing (#183)
* plumbing: rename Object -> EncodedObject.

* plumbing/storer: rename ObjectStorer -> EncodedObjectStorer.

* move difftree to plumbing/difftree.

* move diff -> utils/diff

* make Object/Tag/Blob/Tree/Commit/File depend on storer.

* Object and its implementations now depend only on
  storer.EncodedObjectStorer, not git.Repository.
* Tests are decoupled accordingly.

* move Object/Commit/File/Tag/Tree to plumbing/object.

* move Object/Commit/File/Tag/Tree to plumbing/object.
* move checkClose to utils/ioutil.

* move RevListObjects to plumbing/revlist.Objects.

* move DiffTree to plumbing/difftree package.

* rename files with plural nouns to singular

* plumbing/object: add GetBlob/GetCommit/GetTag/GetTree.
2016-12-14 23:12:44 +01:00
Máximo Cuadros
2dac5c1d1b config: Config, bare flag (#177)
* config.Config: bare flag

* changes

* changes
2016-12-12 15:57:34 +01:00
Santiago M. Mola
a91727b6d5 repository: Ref -> Reference; Refs -> References. (#168) 2016-12-08 14:24:01 +01:00
Máximo Cuadros
01ea726be6 remote: sideband support (#164)
* remote: sideband support

* changes
2016-12-07 11:16:59 +01:00
Máximo Cuadros
5990aeb719 revision based on goreportcard.com 2016-12-06 23:18:50 +01:00
Máximo Cuadros
17e3f85613 repository: fix test setting global config 2016-12-06 22:42:05 +01:00
Máximo Cuadros
22fe81f342 protocol/packp: UploadPackResponse implementation (#161)
* plumbing/protocol: paktp avoid duplication of haves, wants and shallow

* protocol/pakp: UploadPackResponse implementation

* changes

* changes

* changes

* debug

* changes
2016-12-06 15:46:09 +01:00
Máximo Cuadros
6996381ae4 BaseSuite improvements, usage of file:// proto 2016-12-02 00:44:06 +01:00
Máximo Cuadros
ac095bb12c new plumbing package (#118)
* plumbing: now core was renamed to core, and formats and clients moved inside
2016-11-08 23:46:38 +01:00
Máximo Cuadros
0ff9ef2b44 global storage interface refactor (#112)
* core: ObjectStorage, ReferenceStorage renamed to ObjectStorer and
ReferenceStorer

* rebase

* general, changes request by @alcortes

* general, changes request by @alcortes
2016-11-07 20:29:58 +01:00
Máximo Cuadros
0c6c404715 remote, fix fetch tags 2016-10-27 02:42:36 +02:00
Máximo Cuadros
5913aee500 test coverage improved, Remote.Refs and Repository.Refs returns error, TreeWalker -> TreeIter 2016-09-22 23:41:48 +02:00
Máximo Cuadros
d57f90b78e fixtures: new fixture package being use in all packages 2016-09-12 02:22:08 +02:00
Santiago M. Mola
e4246138cb storage: Add object type hint parameter to ObjectStorage.Get. (#69)
Some storage backends can optimize object lookup if they get
the object type that is expected. So we the signature of the Get
method is now Get(Hash, ObjectType).

Added generic tests for storage backends.
2016-08-29 22:47:13 +02:00
Máximo Cuadros
a3418c5e0a Repository: Clone protection if non empty object storage, Remote: NoErrAlreadyUpToDate 2016-08-25 17:25:31 +02:00
Máximo Cuadros
2ed3474ab8 ForEach review and Commit.Tree err return 2016-08-22 03:29:05 +02:00
Máximo Cuadros
5b13c1a2e5 options renamed and some text fixes 2016-08-22 00:30:50 +02:00
Máximo Cuadros
b32e92d013 remote and repository base on ConfigStore 2016-08-21 01:07:15 +02:00
Máximo Cuadros
1d56b98d9b Remote.Fetch base on RefSpec, improvement of the responsabilities separation 2016-08-19 17:42:13 +02:00
Máximo Cuadros
bcb49927a3 Repository.Clone and Remote.Fetch remote, local branches and client: correct header read 2016-08-15 03:51:04 +02:00
Máximo Cuadros
79087748f6 Repository.Clone and Remote.Fetch tests and improvements 2016-08-13 22:32:34 +02:00
Máximo Cuadros
a6ea9e8dd2 Repository and Remote API changes 2016-08-13 01:51:00 +02:00
Máximo Cuadros
223308ee23 storage: seekable renamed to filesystem 2016-08-11 18:40:12 +02:00
Máximo Cuadros
c1e277a7ca v3 -> v4 2016-08-11 14:12:04 +02:00
Alberto Cortés
5413c7aead Repository head (#61)
* add Repository.Head() tests

* add head support for remote repos and more tests

* add head support for local repos

* clean code

* remove dead code
2016-08-02 10:58:49 +02:00