aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of github.com:src-d/go-git into f-add-tagging-supportMáximo Cuadros2018-09-101-11/+5
|\
| * Expose Storage cache.kuba--2018-09-071-8/+3
| | | | | | | | Signed-off-by: kuba-- <kuba@sourced.tech>
| * git: do not expose storage options in PlainOpenJavi Fontan2018-08-311-1/+1
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
| * git, storer: use a common storer.Options for storer and PlainOpenJavi Fontan2018-08-301-5/+1
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
| * git: add Static option to PlainOpenJavi Fontan2018-08-301-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also adds Static configuration to Storage and DotGit. This option means that the git repository is not expected to be modified while open and enables some optimizations. Each time a file is accessed the storer tries to open an object file for the requested hash. When this is done for a lot of objects it is expensive. With Static option a list of object files is generated the first time an object is accessed and used to check if exists instead of using system calls. A similar optimization is done for packfiles. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* | git: s/TagObjectOptions/CreateTagOptions/Chris Marchesi2018-09-071-2/+2
| | | | | | | | | | | | | | Just renaming the TagObjectOptions type to CreateTagOptions so that it's consistent with the other option types. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
* | git: Don't touch tag objects orphaned by tag deletionChris Marchesi2018-09-071-16/+2
| | | | | | | | | | | | | | | | Deleting a tag ref for an annotated tag in normal git behavior does not delete the tag object right away. This is handled by the normal GC process. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
* | git: s/fetch/returns/ on Tag function docChris Marchesi2018-09-071-1/+1
| | | | | | | | | | | | | | This is to avoid any ambiguity with the act of "fetching" in git in general. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
* | git: Don't return tag object with Tag, adjust docs for Tag and TagsChris Marchesi2018-08-231-15/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've mainly noticed that in using the current Tag function, that there were lots of times that I was ignoring the ref or the object, depending on what I needed. This was evident in the tests as well. As such, I think it just makes more sense for a singular tag fetcher to return just a ref, through which the caller may grab the annotation if they need it, and if it exists. Also, contrary to the docs on Tags, all tags have a ref, even if they are annotated. The difference between a lightweight tag and an annotated tag is the presence of the tag object, which the ref will point to if the tag is annotated. As such I've adjusted the docs with an example as to how one can get the annotation for a tag ref through the iterator. Source: https://git-scm.com/book/en/v2/Git-Internals-Git-References, tags section. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
* | git: Discern tag target type from supplied hashChris Marchesi2018-08-231-1/+6
| | | | | | | | | | | | | | | | | | | | I figured there was a way to do this without having to have TagObjectOptions supply this in - there is. Added support for this in and removed the object type from TagObjectOptions. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
* | git: Add tagging supportChris Marchesi2018-08-211-1/+133
|/ | | | | | | | | | | | | | | | | | | | | | | This adds a few methods: * CreateTag, which can be used to create both lightweight and annotated tags with a supplied TagObjectOptions struct. PGP signing is possible as well. * Tag, to fetch a single tag ref. As opposed to Tags or TagObjects, this will also fetch the tag object if it exists and return it along with the output. Lightweight tags just return the object as nil. * DeleteTag, to delete a tag. This simply deletes the ref. The object is left orphaned to be GCed later. I'm not 100% sure if DeleteTag is the correct behavior - looking for details on exactly *what* happens to a tag object if you delete the ref and not the tag were sparse, and groking the Git source did not really produce much insight to the untrained eye. This may be something that comes up in review. If deletion of the object is necessary, the in-memory storer may require some updates to allow DeleteLooseObject to be supported. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
* Fixed cloning of a single tagFedor Korotkov2018-08-081-3/+3
| | | | | | Relates to #870 Signed-off-by: Fedor Korotkov <fedor.korotkov@gmail.com>
* Fix wrong godoc on Tags() method.Antonio Jesus Navarro Perez2018-07-301-2/+3
| | | | | | Reword Tags() method documentation. Point to TagObjects() method to get all the tags on a repository. Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>
* Fix documentation for NotesMorgan2018-06-161-1/+2
| | | | | | It previously said that it returned all references that are branches, but that's not true. Signed-off-by: Morgan Bazalgette <the@howl.moe>
* git: worktree, Skip special git directory. Fixes #814kuba--2018-04-181-6/+9
| | | | Signed-off-by: kuba-- <kuba@sourced.tech>
* Resolve full commit sha to plumbing hashantham2018-04-161-5/+20
| | | | Signed-off-by: antham <hamonanth@gmail.com>
* config: adds branches to config for tracking branches against remotes, ↵Jeremy Chambers2018-04-101-2/+77
| | | | | | updates clone to track when cloning a branch. Fixes #313 Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>
* add PlainOpen variant to find .git in parent dirsDaniel Martí2018-04-031-6/+32
| | | | | | | | | This is the git tool's behavior that people are used to; if one runs a git command in a repository's subdirectory, git still works. Fixes #765. Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
* *: Use CheckClose with named returnsJavi Fontan2018-03-271-4/+2
| | | | | | | | Previously some close errors were losts. This is specially problematic in go-git as lots of work is done here like generating indexes and moving packfiles. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* add LogOrder, LogOptions.Order, implement Order=LogOrderCommitterTime and ↵Saeed Rasooli2018-03-051-1/+13
| | | | | | Order=LogOrderBSF Signed-off-by: Saeed Rasooli <saeed.gnu@gmail.com>
* Support for clone without checkoutMichael Rykov2018-01-171-1/+1
|
* Fix revision solver for branch and tag (#660)Anthony HAMON2017-12-011-28/+15
| | | fix Repository.ResolveRevision for branch and tag
* repository: add tests for pruning and object re-packingJeremy Stribling2017-11-291-0/+17
| | | | | Also, object re-packing should clean up any loose objects that were packed.
* storer: separate loose and packed object mgmt into optional ifacesJeremy Stribling2017-11-291-10/+16
| | | | Suggested by mcuadros.
* Use object walker in repacking codeTaru Karttunen2017-11-291-12/+9
|
* Use Storer.Config pack window when repacking objectsTaru Karttunen2017-11-291-3/+5
|
* Make object repacking more configurableTaru Karttunen2017-11-291-7/+19
|
* Support for repacking objectsTaru Karttunen2017-11-291-0/+62
|
* Address CI and move code aroundTaru Karttunen2017-11-291-124/+0
|
* First pass of prune designTaru Karttunen2017-11-291-0/+124
|
* all: simplificationferhat elmas2017-11-291-1/+1
| | | | | | | | | | - no length for map initialization - don't check for boolean/error return - don't format string - use string method of bytes buffer instead of converting bytes to string - use `strings.Contains` instead of `strings.Index` - use `bytes.Equal` instead of `bytes.Compare`
* Use optionally locking when updating refsTaru Karttunen2017-11-271-4/+9
|
* update to go-billy.v4 and go-git-fixtures.v3Máximo Cuadros2017-11-231-2/+2
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* plumbing: the commit walker can skip externally-seen commitsJeremy Stribling2017-09-091-3/+3
| | | | | | | | | | When the revlist is computing the set of hashes needed to transfer, it doesn't need to walk over commits it has already processed. So, it can instruct the commit walker not to walk those commits by passing in its own `seen` map. For a 36K object repo, this brought the time for `revlist.Objects` down from 50s to 30s.
* Minor fix to grammatical error in error message for ErrRepositoryNotExists.Nathan Ollerenshaw2017-09-061-1/+1
|
* Repository.Clone added Tags option, and set by default AllTags as git doesMáximo Cuadros2017-09-041-0/+1
|
* Worktree.Reset ignore untracked files on Merge modeMáximo Cuadros2017-09-011-1/+4
|
* repository: Resolve commit when cloning annotated tag, fixes #557Ori Rawlings2017-08-241-12/+41
|
* *: windows support, some more fixes (#533)Manuel Carmona2017-08-031-1/+1
| | | | | | | | | | * fixed windows failed test: "134 FAIL: repository_test.go:340: RepositorySuite.TestPlainOpenBareRelativeGitDirFileTrailingGarbage" * fixed windows failed test: "143 FAIL: worktree_test.go:367: WorktreeSuite.TestCheckoutIndexOS" * fixed windows failed test: "296 FAIL: receive_pack_test.go:36: ReceivePackSuite.TearDownTest" * fixed windows failed test: "152 FAIL: worktree_test.go:278: WorktreeSuite.TestCheckoutSymlink"
* Remote.Clone fix clone of tags in shallow modeMáximo Cuadros2017-08-021-15/+14
|
* Merge pull request #531 from mcuadros/ref-nameMáximo Cuadros2017-08-021-4/+4
|\ | | | | plumbing: moved `Reference.Is*` methods to `ReferenceName.Is*`
| * *: use the new API for ReferenceName.Is* methodsMáximo Cuadros2017-08-021-4/+4
| |
* | Merge pull request #501 from smola/config-multiple-urlsMáximo Cuadros2017-08-021-1/+1
|\ \ | | | | | | config: multiple values in RemoteConfig (URLs and Fetch)
| * | config: multiple values in RemoteConfig (URLs and Fetch)Santiago M. Mola2017-08-011-1/+1
| |/ | | | | | | | | | | | | | | * Change `URL string` to `URL []string` in `RemoteConfig`, since git allows multiple URLs per remote. See: http://marc.info/?l=git&m=116231242118202&w=2 * Fix marshalling of multiple fetch refspecs.
* / reuse Auth method when recursing submodules, fixes #521Devon Barrett2017-07-291-1/+4
|/
* worktree: expose underlying filesystemMáximo Cuadros2017-07-261-1/+1
|
* *: package context support in Repository, Remote and SubmoduleMáximo Cuadros2017-07-261-13/+70
|
* move Repository.Pull to Worktree.PullMáximo Cuadros2017-07-241-116/+55
|
* repository: allow push from shallow repositoriesMáximo Cuadros2017-07-191-3/+3
|
* git: remove ErrObjectNotFound in favor of plumbing.ErrObjectNotFoundJP Sugarbroad2017-07-121-5/+0
|