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

98 Commits

Author SHA1 Message Date
Grzegorz Dlugoszewski
0df82ba272 Update incorrect module name - Go requires a domain-based path for public modules 2025-08-25 20:26:07 +02:00
Grzegorz Dlugoszewski
df6c239099 Add test parallelization and re-enable paralleltest linter 2025-08-25 19:13:09 +02:00
Grzegorz Dlugoszewski
ea178b2ccd Add sync mechanism to git operations to avoid race conditions when testing on Windows 2025-08-24 22:45:47 +02:00
Grzegorz Dlugoszewski
5922fd8e3c Fix incorrect tests in repo_test 2025-08-24 21:10:13 +02:00
Grzegorz Dlugoszewski
42df73c75e Set git user and email in tests helper instead of CI jobs. Simplify CI 2025-08-24 20:14:08 +02:00
Grzegorz Dlugoszewski
ca8681f997 Fix issues found by nlreturn linter 2025-08-24 18:28:09 +02:00
Grzegorz Dlugoszewski
1bf52c4c32 Fix issues found by perfsprint linter 2025-08-24 18:22:49 +02:00
Grzegorz Dlugoszewski
aa1da8e3da Refactor package print into out to fix failing predeclared linter 2025-08-24 18:20:18 +02:00
Grzegorz Dlugoszewski
8b8c814ced Fix issues found by staticcheck linter 2025-08-24 18:13:55 +02:00
Grzegorz Dlugoszewski
08f3264cd0 Fix issues found by mirror linter 2025-08-24 18:02:06 +02:00
Grzegorz Dlugoszewski
0db5ba6f5a Fix issues found by ineffassign linter 2025-08-24 18:00:59 +02:00
Grzegorz Dlugoszewski
2de126166f Fix smaller issues found by various linters 2025-08-24 17:58:05 +02:00
Grzegorz Dlugoszewski
b39f5e63fd Fix issues found by thelper linter 2025-08-24 17:42:59 +02:00
Grzegorz Dlugoszewski
c9a5539670 Fix issues found by testifylint linter 2025-08-24 17:28:21 +02:00
Grzegorz Dlugoszewski
eadc2ff45e Fix issues found by godot linter 2025-08-24 17:18:03 +02:00
Grzegorz Dlugoszewski
7bc9cbb128 Fix issues found by goconst linter 2025-08-24 17:17:34 +02:00
Grzegorz Dlugoszewski
f20ab7dea2 Fix issues found by err113 linter 2025-08-24 16:53:48 +02:00
Grzegorz Dlugoszewski
1e1584ba33 Fix issues found by goerrcheck linter 2025-08-24 16:33:50 +02:00
Grzegorz Dlugoszewski
599643892b Fix issues found by revive linter 2025-08-24 16:09:27 +02:00
Grzegorz Dlugoszewski
f60cfd1e40 Fix issues found by varnamelen linter 2025-08-24 15:44:22 +02:00
Grzegorz Dlugoszewski
0bf2765349 Fix issues found by wsl linter 2025-08-24 14:54:02 +02:00
Grzegorz Dlugoszewski
09da7ea05b Fix cyclop issues in url.go 2025-08-24 14:35:26 +02:00
Grzegorz Dlugoszewski
8a9002e678 Replace the godirwalk package with a native implementation, replace pathpkg with filepath for better cross-platform support 2025-08-24 12:55:40 +02:00
Grzegorz Dlugoszewski
f0365087ce Remove the awkward "built at" section from --version 2025-08-23 22:36:03 +02:00
Grzegorz Dlugoszewski
31fa76afb8 Fix failing windows tests
Fix incorrect filepath.join usage in building filepaths from URL
2025-08-11 23:34:05 +02:00
Grzegorz Dlugoszewski
fe007fda43 Fix a git-list crash on empty repo or repo without a remote 2025-08-11 22:13:56 +02:00
Grzegorz Dlugoszewski
7ecef9c85d Replace deprecated modules
Replace go-homedir with builtin os.UserHomeDir and pkg/errors with
builtin errors
2025-08-11 20:43:49 +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
f610fd9930 Add a worker pool to status loader
This will limit a number of councurrently running git commands when loading statuses of a large number of repositories.
2020-07-31 14:23:22 +02:00
Grzegorz Dlugoszewski
ef3369bd4e Fix typos in a comment 2020-07-31 09:28:48 +02:00
Grzegorz Dlugoszewski
5fe2ddb74f Cleanup empty directories created by a failed git clone 2020-07-30 20:31:06 +02:00
Grzegorz Dlugoszewski
b2d1d773f7 Indicate if error occured during status loading and print the list of errors 2020-07-27 16:17:13 +02:00
Grzegorz Dlugoszewski
d660a73c7f Add a path to error messages when directory can't be accessed 2020-07-27 13:23:49 +02:00
Grzegorz Dlugoszewski
c2fe6e6bab Move test package inside the git package
It is not being used by other packages so it should belong to `git` package.
2020-07-27 12:17:30 +02:00
Grzegorz Dlugoszewski
3aef50a4d0 Move status loader into the git package
- Loading status belongs to git domain so it makes more sense for it to
  be in git package.
- It also makes the `list` file simpler.
- Because status loader is now part of the RepoFinder, the ugly Repo interface is no longer necessary.
2020-07-27 11:15:35 +02:00
Grzegorz Dlugoszewski
13e936c376 Add repo finder tests 2020-07-08 14:58:19 +02:00
Grzegorz Dlugoszewski
cdca8b89d9 Move temp dir cleanup into tempDir function
Cleaning up belongs to a directory, not an abstract git repo.
2020-07-08 14:37:29 +02:00
Grzegorz Dlugoszewski
8ab4681c26 Refactor repoFinder
- Remove io package and move finder to git package
- Move tempDir and writeFile into test package. They are only used for testing purposes anyway.
- Add a way to specify parent folder for tempDir. Useful for testing nested repos.
- Add new test repos with .git/config files
2020-07-08 14:37:29 +02:00
Mallory Adams
5ab6031382 Do not traverse through git repositories (#6)
This makes `git list` a lot faster (10 minutes to under 2 minutes in one
test) and displays more useful information.

Example of `git list` from before this change demonstrating that `git
list` was hiding the information about the main repository in favour of
showing information about a `composer` dependency:

```
├── iguana-extras
│   └── vendor
│       └── dxw
│           └── iguana HEAD ok
│                      master ok
```

Example from after this change:

```
├── iguana-extras master  [ 1 untracked ]
│                 feature/readme no upstream
│                 feature/update-iguana no upstream
│                 fix/php-cs-fixer no upstream
```
2020-07-08 14:35:22 +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
132b3ef13d Fix missing fetch call 2020-07-02 09:39:35 +02:00
Grzegorz Dlugoszewski
5c9cb12bab Fix tree view indentation 2020-07-01 21:31:50 +02:00
Grzegorz Dlugoszewski
d964158bf7 Fix problems with loading values from gitconfig 2020-06-30 21:25:42 +02:00
Grzegorz Dlugoszewski
aee6d8209b Improve printing tree view
...by correctly indenting the branches list
2020-06-30 16:19:15 +02:00
Grzegorz Dlugoszewski
d0797ad9b7 Fix showing stdout of git commands
We need to capture also stderr because this is where eg, the progress of git clone is printed
2020-06-30 13:54:43 +02:00
Grzegorz Dlugoszewski
29330d8af7 Add missing docstrings 2020-06-30 11:32:05 +02:00
Grzegorz Dlugoszewski
235ea0d811 Replace path.Join with filepath.Join
Path is for URLs, filepath is for os paths. This solves the problem with wrong repo root on windows.
2020-06-30 11:25:49 +02:00
Grzegorz Dlugoszewski
b8606568ef Expand home dir path after reading config 2020-06-30 11:22:55 +02:00
Grzegorz Dlugoszewski
7b9e74f903 Skip cloning a repo if target path already exists when getting a dump file 2020-06-30 10:23:10 +02:00
Grzegorz Dlugoszewski
28b24ec5ce Add a run package responsible for running git commands
- Add better git error handling
- Move repo helpers into a separate package
2020-06-26 13:36:58 +02:00