50 Commits

Author SHA1 Message Date
Zhizhen He
32975ee2c7 *: fix some typos
Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
2023-09-08 09:30:43 +08:00
Paulo Gomes
096b3cc16b *: Remove use of deprecated io/util
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
2023-05-11 21:59:37 +01:00
Ayman Bagabas
9a5b08f5c3 feat(clone): add mirror clone option
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>
2023-04-17 17:43:46 -04:00
Paulo Gomes
99e2f85843 config: Add Repository Format Extension
Relates to the SHA256 implementation, defined in #706.

Signed-off-by: Paulo Gomes <pjbgf@linux.com>
2023-03-08 00:04:25 +00:00
Daniel Martí
bc1f419ceb all: replace go-homedir with os.UserHomeDir
Added in Go 1.12, this means we need one less dependency.
2022-05-29 16:12:57 +02:00
Máximo Cuadros
f0b111ab70 Merge pull request #425 from abhinav/error-strings
error strings: Don't capitalize, use periods, or newlines
2021-12-11 12:02:17 +01:00
Abhinav Gupta
0dcebfb72b error strings: Don't capitalize, use periods, or newlines
Per [Go Code Review Comments][1],

> Error strings should not be capitalized (unless beginning with proper
> nouns or acronyms) or end with punctuation

staticcheck's [ST1005][2] also complains about these. For example,

```
object_walker.go:63:10: error strings should not be capitalized (ST1005)
object_walker.go:101:10: error strings should not be capitalized (ST1005)
object_walker.go:101:10: error strings should not end with punctuation or a newline (ST1005)
plumbing/format/commitgraph/file.go:17:26: error strings should not be capitalized (ST1005)
```

This fixes all instances of this issue reported by staticcheck.

  [1]: https://github.com/golang/go/wiki/CodeReviewComments#error-strings
  [2]: https://staticcheck.io/docs/checks/#ST1005
2021-12-04 15:40:53 -08:00
merlin
b939cf8471 config: add support for branch description 2021-11-08 00:17:11 +03:00
Máximo Cuadros
01df753699 *: use go-billy instead of os calls 2021-05-02 23:40:08 +02:00
Kostya Ostrovsky
51cbc24bbe config: support insteadOf for remotes' URLs (#79) 2020-12-01 10:52:53 +01:00
Thomas Lazar
ec9b50d840 Add init.defaultBranch to the config 2020-09-30 17:06:17 -05:00
Máximo Cuadros
26d02b3fec config: ReadConfig and LoadConfig from scopes 2020-05-24 11:22:32 +02:00
Máximo Cuadros
1620782786 config: Config.[User|Author|Commit] marshal/unmarshal 2020-05-24 09:41:19 +02:00
Máximo Cuadros
c80979499a Revert "Merge pull request #20 from quorumcontrol/feature/other-configs"
This reverts commit 3127ad9a44, reversing
changes made to 73c52edaad.
2020-05-24 09:15:51 +02:00
Wes Morgan
ecb64c0481 Add Merged config
...for reading and writing global (~/.git/config) and reading system (/etc/gitconfig) configs in addition to local repo config
2020-04-06 10:32:06 -06:00
Máximo Cuadros
2bdfd91f04 *: migration from gopkg to go modules 2020-03-10 00:40:56 +01:00
Jeremiah Mahler
3ed21ff5df fix broken link (s/ftp/https/)
Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
2019-10-31 18:15:19 -07:00
Mike Riley
f284cd4c2f Support the 'rebase' config key for branches
Signed-off-by: Mike Riley <mikeriley@yelirekim.com>
2019-05-17 12:33:55 -04:00
Jeremy Stribling
f56336220f config: add a way to see if a "remote" URL is local or not
This factors out some URL-parsing code from the transport layer so it
can be used by config as well.

Issue: #909
Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
2019-02-11 15:13:11 -08:00
Zaq? Wiedmann
14d9faa61e config: add commentChar to core config struct
Signed-off-by: Zaq? Wiedmann <zaquestion@gmail.com>
2018-08-29 11:48:33 -07:00
Joseph Vusich
79b7f24160 config: modules, Ignore submodules with dotdot '..' path components. Fixes CVE-2018-11235
References:
 * https://blogs.msdn.microsoft.com/devops/2018/05/29/announcing-the-may-2018-git-security-vulnerability/
 * https://security-tracker.debian.org/tracker/CVE-2018-11235
 * 0383bbb901

Signed-off-by: Joseph Vusich <jvusich@amazon.com>
2018-05-30 17:42:09 +00:00
Jeremy Chambers
02335b10de config: adds branches to config for tracking branches against remotes, updates clone to track when cloning a branch. Fixes #313
Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>
2018-04-10 19:43:38 -05:00
Javi Fontan
a4ea96f42e Make DefaultPackWindow const public and document it
Signed-off-by: Javi Fontan <jfontan@gmail.com>
2018-01-10 16:23:53 +01:00
Javi Fontan
4b71e650c4 Set default pack window size in config
Config is not initialized with the default window size. Without this the
window size is 0 by default and packfile code is unable to generate
deltas.

Signed-off-by: Javi Fontan <jfontan@gmail.com>
2018-01-09 15:35:11 +01:00
ferhat elmas
18e6f9daa3 all: simplification
- 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`
2017-11-29 13:01:32 +01:00
Jeremy Stribling
52c1f982ea config: support a configurable, and turn-off-able, pack.window
One use of go-git is to transfer git data from a non-standard git repo
(not stored in a file system, for example) to a "remote" backed by a
standard, local .git repo.

In this scenario, delta compression is not needed to reduce transfer
time over the "network", because there is no network. The underlying
storage layer has already taken care of the data tranfer, and sending
the objects to local .git storage doesn't require compression. So this
PR gives the user the option to turn off compression when it isn't
needed.

Of course, this results in a larger, uncompressed local .git repo, but
the user can then run git gc or git repack on that repo if they care
about the storage costs.

Turning the pack window to 0 on reduces total push time of a 36K repo
by 50 seconds (out of a pre-PR total of 3m26s).
2017-09-11 08:56:54 -07:00
Manuel Carmona
0f8ed5664c serialized remotes in alphabetical order 2017-08-10 09:34:47 +02:00
Santiago M. Mola
e5c6fa2377 config: preserve option order on config marshalling
Do not change order of options (e.g. in RemoteConfig)
when serializing for any option whose value has not changed.
2017-08-01 13:01:59 +02:00
Santiago M. Mola
9488c59834 config: multiple values in RemoteConfig (URLs and Fetch)
* 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.
2017-08-01 13:01:54 +02:00
JP Sugarbroad
fef45940aa Export raw config. 2017-04-06 15:39:55 -07: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
Máximo Cuadros
ed288b30de documentation and API improvements 2017-02-21 16:03:39 +01:00
Máximo Cuadros
09110d8e6d config: added Config.Submodules 2017-02-14 15:56:32 +01:00
Máximo Cuadros
f8b5557875 config: adding Config.Core.Worktree 2017-02-13 23:38:57 +01:00
Máximo Cuadros
387683bbcf config: RefSpec.Validate returning errors and doc (Fixes #232) 2017-01-31 12:00:40 +01:00
Máximo Cuadros
85a4efcc45 new srcd.works/go-git.v4 path 2017-01-30 23:52:39 +01:00
Máximo Cuadros
80179adaab rename billy imports 2017-01-30 22:03:19 +01:00
Sergio Arbeo
bb36105c3d Fix typos in config pkg (#233) 2017-01-30 13:15:47 +01:00
Máximo Cuadros
7581d7f76a config: documentation improvements 2017-01-30 11:55:11 +01:00
Máximo Cuadros
e2e4e7f748 config: marshal and unmarshal implementation 2017-01-26 20:53:32 +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
Máximo Cuadros
2dac5c1d1b config: Config, bare flag (#177)
* config.Config: bare flag

* changes

* changes
2016-12-12 15:57:34 +01:00
Máximo Cuadros
e523701393 config: storer comment 2016-11-07 21:22:45 +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
ad94562675 doc packages 2016-09-01 01:31:58 +02:00
Máximo Cuadros
0fa6f26b0e clients/ssh: test fix 2016-08-24 22:00:44 +02:00
Máximo Cuadros
f42d82364c Remote.Fetch multiple RefSpec support 2016-08-22 00:18:02 +02:00
Máximo Cuadros
b32e92d013 remote and repository base on ConfigStore 2016-08-21 01:07:15 +02:00
Máximo Cuadros
4652c0e753 remote and repository base on ConfigStore 2016-08-20 01:30:05 +02:00
Máximo Cuadros
1d56b98d9b Remote.Fetch base on RefSpec, improvement of the responsabilities separation 2016-08-19 17:42:13 +02:00