6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-04 18:34:51 +00:00
Commit Graph

31 Commits

Author SHA1 Message Date
Grzegorz Dlugoszewski
b31de718d4 Simplify linters config, fix cyclop issues in main.go 2025-08-24 14:29:56 +02:00
Grzegorz Dlugoszewski
e1f73dc99d Replace two separate binaries with a single one 2025-08-23 22:06:56 +02:00
Grzegorz Dlugoszewski
0d797d625a Make the URL scheme default to ssh instead of https and make it configurable 2020-09-02 03:14:01 +02:00
Grzegorz Dlugoszewski
0064fc3b8e Add --skip-host flag to get command (#7)
When set, git-get won't create a directory for the repo host.
So instead of `<root>/<host>/<user>/<repo>`, a repo will be cloned into `<root>/<user>/<repo>`.
It's useful if all repos some from the same host and that additional folder feels redundant.
2020-07-07 18:35:30 +02:00
Grzegorz Dlugoszewski
d964158bf7 Fix problems with loading values from gitconfig 2020-06-30 21:25:42 +02:00
Grzegorz Dlugoszewski
b8606568ef Expand home dir path after reading config 2020-06-30 11:22:55 +02:00
Grzegorz Dlugoszewski
8c132cdafa Remove gogit and major refactoring (#2)
* Fix typo in readme

* Reimplement all git methods without go-git

* Rename repo pkg to git, add gitconfig methods

* Improve tests for configuration reading

* Rename package file to io and move RepoFinder there

* Refactor printers

- Remove smart printer
- Decouple printers from git repos with interfaces
- Update printer functions
- Remove unnecessary flags
- Add better remote URL detection

* Update readme and go.mod

* Add author to git commit in tests

Otherwise tests will fail in CI.

* Install git before running tests and don't use cgo

* Add better error message, revert installing git

* Ensure commit message is in quotes

* Set up git config before running tests
2020-06-24 23:54:44 +02:00
Grzegorz Dlugoszewski
4868713746 Update help commands and errors messages 2020-06-19 16:39:26 +02:00
Grzegorz Dlugoszewski
7ba950a6a0 Refactor cloning dump file 2020-06-18 17:10:14 +02:00
Grzegorz Dlugoszewski
5a588f22d1 Refactor implementations of get and list commands
- Simplify the main functions by moving actual implementation to "pkg" package
- Remove the "path" package and move files into the root "pkg" package
- Replace viper with explicit Cfg structs
2020-06-18 15:44:10 +02:00
Grzegorz Dlugoszewski
8511cd6c97 Rename git package to repo package 2020-06-18 14:22:03 +02:00
Grzegorz Dlugoszewski
da8f0931d0 Add a "dump" output option to git-list
It prints a list of all repos URL and is supposed to be consumed by `git get --dump` option.
2020-06-18 11:05:39 +02:00
Grzegorz Dlugoszewski
5835777850 Split get and list commands into separate binaries 2020-06-12 21:36:31 +02:00
Grzegorz Dlugoszewski
c71ebea2d4 Move the version metadata to cfg packageThis way it can be used by multiple binaries. 2020-06-12 21:09:32 +02:00
Grzegorz Dlugoszewski
33ca245d3a Refactor pkg directory back 2020-06-12 20:19:05 +02:00
Grzegorz Dlugoszewski
823a522a97 Add a --bundle flag accepting a bundle file of repos to clone
Also refactor CloneRepo to accept CloneOpts as agruments - makes it cleaner and easier to test.
2020-06-12 17:01:35 +02:00
Grzegorz Dlugoszewski
dfef6151d1 Add a --branch flag that specifies which branch or tag to check out after cloning 2020-06-08 21:37:26 +02:00
Grzegorz Dlugoszewski
ee26ddc38f Add a --fetch flag to first fetch from remotes before printing repos status 2020-06-08 14:54:19 +02:00
Grzegorz Dlugoszewski
e5c3285040 Add output flag and simple tree option 2020-06-08 14:00:59 +02:00
Grzegorz Dlugoszewski
f3d0df1bfd Refactor packages structure
- Isolate files into their own packages
- Create new printer package and interface
- Refactor Repo stuct to embed the go-git *Repository directly
- Simplify cmd package
2020-06-08 12:07:03 +02:00
Grzegorz Dlugoszewski
239ff699a3 Add ssh key authentication when cloning via ssh 2020-06-04 15:45:46 +02:00
Grzegorz Dlugoszewski
f4636a3a73 Fix reading config values from cli flags
* InitConfig needs to be called after cmd.Execute, otherwise the flags are not parsed yet
* Values need to be checked also for emptiness, not only for being unset
2020-06-04 13:02:24 +02:00
Grzegorz Dlugoszewski
f2d8496136 Refactor config provider using viper 2020-06-04 11:38:01 +02:00
Grzegorz Dlugoszewski
64dfea5a7f Add a list flag and basic rendering of repos status 2020-06-03 15:59:51 +02:00
Grzegorz Dlugoszewski
3d18b664e9 Remove git-list command 2020-05-30 13:52:38 +02:00
Grzegorz Dlugoszewski
f9c362a53e Add build version metadata to be overridden by ldflags 2020-05-30 13:00:31 +02:00
Grzegorz Dlugoszewski
1798816b6a Enable accessing config from gitconfig file or env variables 2020-05-29 21:19:55 +02:00
Grzegorz Dlugoszewski
b72f984512 Don't show usage on clone error 2020-05-29 10:50:52 +02:00
Grzegorz Dlugoszewski
1bc3928cf5 Finish refactoring by replacing old pkg with new one 2020-05-28 16:34:44 +02:00
Grzegorz Dlugoszewski
7ab4489dfe Add ssh credentials callback when cloning via ssh protocol 2020-05-26 10:34:36 +02:00
Grzegorz Dlugoszewski
ac765c9c06 Add cobra commands and update project folder structure 2020-05-20 11:37:16 +02:00