aboutsummaryrefslogtreecommitdiffstats
path: root/options.go
Commit message (Collapse)AuthorAgeFilesLines
* git: Worktree.AddWithOptions, add skipStatus option. #993Moran Cohen2024-01-171-0/+5
|
* git: worktree checkout tag hash id (#959)Ayman Bagabas2023-12-121-3/+3
| | | | | | | Allow checking out a worktree using a tag hash id. Fixes: https://github.com/go-git/go-git/issues/959 Supersedes: https://github.com/go-git/go-git/pull/964
* git: clone --shared implementedenverbisevac2023-10-081-0/+9
|
* git: allow using `InitOptions` with `PlainInitWithOptions`ThinkChaos2023-09-151-0/+1
|
* git: add `PlainInitOptions.Bare`ThinkChaos2023-09-151-0/+2
| | | | Refactor `PlainInit` to call `PlainInitWithOptions`
* Merge branch 'master' into jc/commit-ammendPaulo Gomes2023-08-051-4/+67
|\
| * Merge pull request #765 from matejrisek/feature/shallow-submodules-optionPaulo Gomes2023-06-071-0/+3
| |\ | | | | | | git: add a clone option to allow for shallow cloning of submodules
| | * git: add a clone option to allow for shallow cloning of submodulesmatej.risek2023-06-051-0/+3
| | | | | | | | | | | | | | | This option matches the git clone option --shallow-submodules. https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---no-shallow-submodules
| * | git: remote, add support for a configurable timeout.Andrew Pollock2023-05-121-0/+2
| |/ | | | | | | | | | | | | The previous hard-coded 10 second value is too short for listing large repositories like https://gitlab.com/gitlab-org/gitlab Return an error on nonsensical subzero timeout values
| * Merge pull request #754 from matejrisek/feature/submodule-clone-depthPaulo Gomes2023-05-041-0/+3
| |\ | | | | | | git: Add Depth to SubmoduleUpdateOptions
| | * git: Add Depth to SubmoduleUpdateOptionsmatej.risek2023-05-041-0/+3
| | |
| * | plumbing/transport: add ProxyOptions to specify proxy detailsSanskar Jaiswal2023-05-041-1/+10
| | | | | | | | | | | | Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
| * | git: Add support to ls-remote with peeled references. Fixes #749Paulo Gomes2023-05-031-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new PeelingOption field was introduced into ListOptions. The new options include the default (and backwards compatible) IgnorePeeled. Plus another two variations which either only returns peeled references (OnlyPeeled), or append peeled references to the list (AppendPeeled). The ls-remote example was updated to align with upstream, in which peeled references are appended to the results by default. A new ErrEmptyUrls error is now returned when List or ListContext do not receive a URL to work with, to improve overall execution flow. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
| * | Merge pull request #728 from aymanbagabas/grep-barePaulo Gomes2023-04-261-1/+7
| |\ \ | | | | | | | | fix: git grep bare repositories
| | * | fix: git grep bare repositoriesAyman Bagabas2023-04-261-1/+7
| | |/ | | | | | | | | | | | | | | | Perform grep on `*Repository` instead of `*Worktree`. Fixes: https://github.com/go-git/go-git/issues/68
| * / feat(clone): add mirror clone optionAyman Bagabas2023-04-171-0/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | Clone remote as a mirror. This fetches all remote refs, implies bare repository, and sets the appropriate configs. Fixes: https://github.com/go-git/go-git/issues/293 Update options.go Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com> Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
| * config: Add Repository Format ExtensionPaulo Gomes2023-03-081-0/+8
| | | | | | | | | | | | Relates to the SHA256 implementation, defined in #706. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
| * Return error instead of creating empty commitsPaulo Gomes2022-12-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BuildTree now returns an ErrEmptyCommit error, when there are no changes to be committed. This can be opted-out via CommitOptions.AllowEmptyCommits. This is a breaking change which enables applications to detect when empty commits are to be created. Some instances in which this can occur is when the fs (e.g. `billy/osfs`) make changes to the underlying files, causing a conflict between what the previous Git worktree state was, and the current state. Changes to the fs implementations are orthogonal to this, and will be dealt with separately. The new behaviour aligns with the Git CLI, in which empty commits returns the error message: 'nothing to commit, working tree clean'. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
| * *: fix typographical errorJames Romeril2022-09-221-1/+1
| |
| * *: fix some typos (#567)cui fliter2022-09-221-2/+2
| | | | | | | | | | Signed-off-by: cui fliter <imcusg@gmail.com> Signed-off-by: cui fliter <imcusg@gmail.com>
* | Add Amend option to CommitOptionsJohn Cai2022-01-031-0/+11
|/ | | | | | Adds an Amend option to CommitOptions that behaves like git --amend. This change includes modifications to the Validate function to disallow a Commit call with both Amend and either Parents or All enabled.
* Merge branch 'master' into jc-push-atomicMáximo Cuadros2021-12-101-0/+17
|\
| * Merge pull request #410 from john-cai/jc-sparseMáximo Cuadros2021-12-101-0/+2
| |\ | | | | | | Worktree: Checkout, simplified sparse checkout
| | * simplified sparse checkoutJohn Cai2021-11-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is the initial logic to support a simple sparse checkout where directories to be included can be specified in CheckoutOptions. This change doesn't fully support the sparse patterns, nor does this change include the optimization to collapse flie entries in ithe index that are excluded via the sparse checkout directory patterns included under the parent directory.
| * | Add ForceWithLease Push OptionJohn Cai2021-11-021-0/+15
| |/ | | | | | | | | | | | | | | --force-with-lease allows a push to force push with some safety measures. If the ref on the remote is what we expect, then the force push is allowed to happen. See https://git-scm.com/docs/git-push#Documentation/git-push.txt---force-with-leaseltrefnamegt for more information
* / Add Atomic to push optionsJohn Cai2021-11-031-0/+2
|/ | | | | | push --atomic allows a push to succeed or fail atomically. If one ref fails, the whole push fails. This commit allows the user to set Atomic as an option for a push.
* Merge pull request #399 from S-Bohn/add-push-optionsMáximo Cuadros2021-11-011-0/+2
|\ | | | | Remote: PushOptions add push-options
| * plumbing: packp, Add encoding for push-options. Fixes #268.Sören Bohn2021-10-261-0/+2
| | | | | | | | go-git: Add field `Options` to `PushOptions`, wire functionality.
* | Document the push refspec formatThibault Jamet2021-10-281-2/+8
|/ | | | | | | | | | Taken from `git help push` and adapted to match the supported features only. Future iterations of this feature may include better support for git "SHA-1 expression", documented in `git help push` as: > any arbitrary "SHA-1 expression", such as master~4 or HEAD (see gitrevisions(7)).
* Merge pull request #375 from noerw/add-remoteurl-optionMáximo Cuadros2021-10-261-1/+7
|\ | | | | Remote: add RemoteURL to {Fetch,Pull,Push}Options
| * Add RemoteURL to {Fetch,Pull,Push}OptionsNorwin2021-09-151-1/+7
| | | | | | | | | | Can be used to override the URL to operate on: RemoteName will be ignored for the actual fetch
* | git: add --follow-tags option for pushesJohn Cai2021-10-051-0/+3
|/ | | | This PR adds support for the --follow-tags option for pushes.
* *: typo fixes #291 Jeff Widman2021-04-161-2/+2
|
* *: replace golang.org/x/crypto/openpgp by ↵Johan Fleury2021-04-061-1/+1
| | | | github.com/ProtonMail/go-crypto/openpgp (#283)
* add RequireRemoteRefs to PushOptions (#258)Andrew Suffield2021-03-251-0/+3
| | | | | | | | | | | | | | | | | | The git protocol itself uses a compare-and-swap mechanism, where changes send the old and new values and the change is only applied if the old value matches. This is used to implement the --force-with-lease feature in git push. go-git populates the `old` field with the current value of the ref that is read from the remote. We can implement a convenient (albeit more limited) form of the --force-with-lease feature just by allowing the caller to specify particular values for this ref. Callers can then implement complex multi-step atomic operations by reading the ref themselves at the start of the process, and passing to in RequireRemoteRefs at the end. This is also a suitable building block for implementing --force-with-lease (#101), which is mostly an exercise in computing the correct hash to require. Hence, this appears to be the most reasonable API to expose.
* Add insecureSkipTLS and cabundle (#228)Daishan Peng2021-01-271-0/+20
| | | | | This PR add insecureSkipTLSVerify and cabundle to any remote http calls so that https repo with private CA signed can be used. This is the equivalent of https.sslVerify and GIT_SSL_CAINFO
* Support `.git/commondir` repository layoutTimofey Kirillov2020-06-151-0/+3
| | | | | | | | | | | | | | | | Git creates `.git/commondir` when there are custom worktrees (see "git worktree add" related commands). `.git/commondir` in such case contains a link to another dot-git repository tree, which could contain some folders like: - objects; - config; - refs; - etc. In this PR a new dotgit.RepositoryFilesystem struct is defined, which is billy.Filesystem interface compatible object-wrapper, that can handle commondir and dispatch all operations to the correct file path. `git.PlainOpen` remain unchanged, but `git.PlainOpenWithOptions` has a new option: `PlainOpenOptions.EnableDotGitCommonDir=true|false` (which is false by default). When `EnableDotGitCommonDir=true` repository-open procedure will read `.git/commondir` (if it exists) and then create dotgit.RepositoryFilesystem object initialized with 2 filesystems. This object then passed into storage and then into dotgit.DotGit as `billy.Filesystem` interface. This object will catch all filesystem operations and dispatch to the correct repository-filesystem (dot-git or common-dot-git) according to the rules described in the doc: https://git-scm.com/docs/gitrepository-layout#Documentation/gitrepository-layout.txt. EnableDotGitCommonDir option will only work with the filesystem-backed storage. Also worktree_test.go has been adopted from an older, already existing existing PR: https://github.com/src-d/go-git/pull/1098. This PR needs new fixtures added in the following PR: https://github.com/go-git/go-git-fixtures/pull/1.
* Worktree.AddWithOptions: improve documentation and interfaceMáximo Cuadros2020-06-141-1/+20
|
* feat: add file with using .gitignore, fixed src-d/go-git#1219jk2k2020-06-101-0/+6
|
* CreateTagOptions.Validate: load Tagger from configMáximo Cuadros2020-06-051-2/+34
|
* Merge branch 'master' of github.com:go-git/go-git into scope-configMáximo Cuadros2020-05-241-0/+3
|\
| * Remote.Push: support force optionkappyhappy2020-05-211-1/+4
| |
* | Repository.ConfigScoped and Repository.Commit with empty author supportMáximo Cuadros2020-05-241-3/+43
|/
* *: migration from gopkg to go modulesMáximo Cuadros2020-03-101-5/+5
|
* add `PathFilter func(string) bool` to LogOptionsSaeed Rasooli2019-11-291-0/+7
| | | | Signed-off-by: Saeed Rasooli <saeed.gnu@gmail.com>
* Add limiting options to git logknqyf2632019-08-041-0/+9
| | | | Signed-off-by: knqyf263 <knqyf263@gmail.com>
* add Prune option to PushOptionsStanislav Seletskiy2019-07-251-0/+3
| | | | Signed-off-by: Stanislav Seletskiy <s.seletskiy@gmail.com>
* Keep local changes when checkout branch in worktree.Linuxer Wang2019-05-151-0/+5
| | | | Signed-off-by: Linuxer Wang <linuxerwang@gmail.com>
* Merge pull request #1072 from jeremyschlatter/patch-3Máximo Cuadros2019-03-041-1/+1
|\ | | | | git: Fix typo
| * git: Fix typoJeremy Schlatter2019-02-221-1/+1
| | | | | | Signed-off-by: Jeremy Schlatter <jeremy.schlatter@gmail.com>