* add a test for negative dates and see how onefetch handles it.
Currently there is an 'empty' error which probably is related to
a failure to parse commits with negative dates.
This should be fixed in future versions of `gitoxide`.
* feat: support repositories with dates prior to UNIX epoch.
Note that such repositories aren't easy to create in the first place
and such pre-dated commits need to be created with tool-assistance.
In any case, now `onefetch` is able to handle these as well.
* update dependencies, also in the hopes to fix CI caches
* add unit test
---------
Co-authored-by: o2sh <ossama-hjaji@live.fr>
* Skip commit when computing diff if blob missing
* add integration test
* Assure that `changes()` don't track rewrites which accesses blobs; make filter=blob:none work.
We reproduce the issue by triggering rename detection, which means a change happens on top of a rename.
This tries to access blobs, and that doesn't always work.
It's a good idea to disable rewrite tracking and an oversight in the initial implementation, and one might
say it's tricky given that `gitoxide` automatically does what git does, which may be surprising sometimes
and be a hidden cost even if it doesn't fail.
---------
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
* add churn metric
* add diff_count
* revert
* rename
* add churn cli flags
* fix integration test
* add unit tests
* try fix codeowners
* fix codeowners
* Optimize diff implementation
* delay conversion to String for filepaths to the last moment. That way, only the paths that
are displayed will be converted in an operation that isn't free.
* change diff implementation to decode parents only once, instead of three times in the commmon case.
* setup an object cache in the `Repository` for faster traversals and much faster diffs.
* Don't fail on missing parent as we want to work in shallow repos, too
* Increase performance by decoding the commit only once
Previously, each time we would query commit information, the commit would
lazily be decoded until the point of interest under the hood.
Now we decode everything once, which is faster than what happened before.
Note that diffs are still causing the parents to be decoded even we *could*
pass them in, but it's not worth the complexity for just 100 commits
(the default value for churn).
* track changes on executable files
* remove for_each method
* use horizontal ellipsis
* review
* use MAIN_SEPERATOR when building path
* revert
* run expensive diffs in parallel and abort them once we run out of time.
That way, we could even use higher amounts of diffs if we wanted to, or could
warn if there was not enough time to reach the desired amount of diffs.
* Always calculate at least one diff for 'churn'
That way, there is always some data to work with.
This is important in case the repo is very small and the thread needs some time
to start-up and finish.
* improved readability + churn_pool_size CLI flag
The churn_pool_size allow the user to force onefetch to be deterministic
in the number of commits used to create the churn summary
* fix test
* halt if the churn pool size is bigger than the total number of commits
* improve readability
* add unit test
* refactor
* simplify `should_break()`
* update to latest `gix` version
* Avoid exhaustive memory consumption by sending the commit-id instead of its buffer.
The delta-processing happens by referring to a commit, and previously we could
send the whole commit buffer (which is expensive) as the overall amount of buffers
in flight would be bounded.
Now that the bound was removed, it's necessary to limit the costs of the commit,
and we do this by referring to it by id instead.
That way, on the linux kernel, we get these values for memory consumption:
* bounded: 960MB
* unbounded buffer: 2156
* unbounded id: 1033
---------
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
This upgrade is mainly to benefit from the new names of all `git-*`
crates which now share the `gix-` prefix, with `gix` naturally being
what was formerly `git-repository`.
Now there is no need anymore to rename crates in order to get the `git`
namespace, instead we refer to `gitoxide` as `gix` from the get-go.
* add manifest crate
* read deps and repo_name from manifest
* fix tests
* address some PR comments
* use Option<&T> instead of &Option<T>
* merge two functions in manifest crate
* read version from manifest
* revert last commit
* fallback to manifest for version
* avoid panicking when reading cargo.toml is workspace and not package
* rename manifest to onefetch-manifest and create workspace
* fix typo
* cargo clippy
* remove Cargo.lock from manifest
* break line after every 5 words in the description
* Update src/info/repo/description.rs
Co-authored-by: Spenser Black <spenserblack01@gmail.com>
* add fallback to manifest entry for license info line
* remove section in contributing.md about adding support for a package manager
* Update manifest/Cargo.toml
Co-authored-by: Spenser Black <spenserblack01@gmail.com>
* fix Cargo.toml
* add integration test for manifest (cargo)
* add integration test for manifest (npm)
* revert new line
* update screenshots
* update screenshots
* add unit test for long description
* add unit test to dependencies
* update manifest's readme
Co-authored-by: Spenser Black <spenserblack01@gmail.com>
* testing bare git repo error using git-testtools script #700
* after running cargo fmt
* refactoring new to call init for testing of bare repo detection
* brute force testing of format function
* idea for testing formatted output using git-testtools arguments
* fix formatting
* adding pretty assert and concept of match anything in expected string
* fixing windows expected output failures
* fixing formatting, eventually I will use a hook
* removing color based checking, simple regex now
* Update src/info/mod.rs
Co-authored-by: Spenser Black <spenserblack01@gmail.com>
* Update src/info/mod.rs
Co-authored-by: Spenser Black <spenserblack01@gmail.com>
* updates to use external file w/ regex in it
* trying standard path separator to see if windows ci passes
* updates to regex that make it easier to read
* test coverage of serializer using json
* fix formatting
* better assert logic for bare repo and pretty assert to debug CI failure in json
* fixing git version in json serializarion
* obtains 100% code coverage by manipulating git repo and files parsed
* more code coverage, trying to get those last few lines
* making use of snapshot name in testing
* changing verification to string based test
* switching to using inst snapshots
* adding snap file needed for previous commit
* refactor default into Config object to allow Default construction
* better naming on function
* removing snap file from ignore
* using object serialization in test
Co-authored-by: Spenser Black <spenserblack01@gmail.com>
* testing get_git_username using git-testtools #700
* testing title format function
* oops, fixing code format
* adding more testing to get better coverage
* combining basic git repo create functions and renaming script
* fixing format error
* Update src/info/title.rs
Co-authored-by: Spenser Black <spenserblack01@gmail.com>
* Update src/info/title.rs
Co-authored-by: Spenser Black <spenserblack01@gmail.com>
* Update src/info/title.rs
Co-authored-by: Spenser Black <spenserblack01@gmail.com>
Co-authored-by: Spenser Black <spenserblack01@gmail.com>