Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1048 +/- ##
=======================================
Coverage 89.81% 89.82%
=======================================
Files 72 72
Lines 13290 13292 +2
=======================================
+ Hits 11936 11939 +3
+ Misses 1354 1353 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.00% (16.2 MiB → 16.2 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
|
I tested your proposed fix using the same sample configuration: Nixpkgs override to use the proposed patch:pkgs.prek.overrideAttrs (
final: old:
let
rev = "427e63f5e3d211849e3f3bdfb92c8d509f61d13d";
in
{
version = old.version + "+dev.${builtins.substring 0 6 rev}";
src = pkgs.fetchFromGitHub {
owner = "j178";
repo = "prek";
inherit rev;
sha256 = "sha256-+8ff6YVnuERyHMH7/1l7hcXBZMF0lQ3AMSLEBJRyj2A=";
# sha256 = pkgs.lib.fakeSha256;
};
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (final) pname src version;
hash = "sha256-o2+ssBIwDRgtZ8B8AUyqIquGcsCqAz/+30ExREu0QJU=";
};
cargoSha256 = pkgs.lib.fakeSha256;
doCheck = false;
}
)I get the following error: Note The additional step I've tried to replicate the error manually and I get the same result (an error): $ git init /tmp/bar
Initialized empty Git repository in /tmp/bar/.git/
$ cd bar
$ git config --unset extensions.objectformat
$ git config extensions.objectformat
sha256
$ git remote add origin https://github.com/pre-commit/pre-commit-hooks
$ git fetch origin v6.0.0 --depth=1
remote: Enumerating objects: 111, done.
remote: Counting objects: 100% (111/111), done.
remote: Compressing objects: 100% (94/94), done.
remote: Total 111 (delta 8), reused 44 (delta 6), pack-reused 0 (from 0)
Receiving objects: 100% (111/111), 67.23 KiB | 3.73 MiB/s, done.
Resolving deltas: 100% (8/8), done.
From https://github.com/pre-commit/pre-commit-hooks
* tag v6.0.0 -> FETCH_HEAD
error: reftable: transaction prepare: corrupt reftable fileI've tried to go a little further manually and I think I've found something that work: $ git -c init.defaultobjectformat='' init /tmp/bar
warning: unknown hash algorithm ''
Initialized empty Git repository in /tmp/bar/.git/
$ cd /tmp/bar
$ git remote add origin https://github.com/pre-commit/pre-commit-hooks
$ git fetch origin v6.0.0 --depth=1
remote: Enumerating objects: 111, done.
remote: Counting objects: 100% (111/111), done.
remote: Compressing objects: 100% (94/94), done.
remote: Total 111 (delta 8), reused 44 (delta 6), pack-reused 0 (from 0)
Receiving objects: 100% (111/111), 67.23 KiB | 3.20 MiB/s, done.
Resolving deltas: 100% (8/8), done.
From https://github.com/pre-commit/pre-commit-hooks
* tag v6.0.0 -> FETCH_HEAD |
|
Weird, the |
extensions.objectFormat in the remote repoobjectFormat in git init
|
@FirelightFlagboy Can you try this patch again? |
FirelightFlagboy
left a comment
There was a problem hiding this comment.
It seems to work 💪
$ prek -vvv
DEBUG prek: 0.2.13
DEBUG Args: ["prek", "-vvv"]
DEBUG Git root: /tmp/foo
TRACE Executing `/etc/profiles/per-user/redacted/bin/git ls-files --unmerged`
DEBUG Found workspace root at `/tmp/foo`
TRACE Include selectors: ``
TRACE Skip selectors: ``
DEBUG discover{root="/tmp/foo" config=None refresh=false}: Performing fresh workspace discovery
DEBUG Loading project configuration path=.pre-commit-config.yaml
TRACE discover{root="/tmp/foo" config=None refresh=false}: close time.busy=2.06ms time.idle=1.55µs
TRACE Executing `/etc/profiles/per-user/redacted/bin/git diff --exit-code --name-only -z /tmp/foo/.pre-commit-config.yaml`
TRACE Checking lock resource="store" path=/home/redacted/.cache/prek/.lock
DEBUG Acquired lock resource="store"
DEBUG Cloning repo target=/home/redacted/.cache/prek/scratch/.tmpYNzplN repo=https://github.com/pre-commit/pre-commit-hooks@v6.0.0
TRACE Executing `/etc/profiles/per-user/redacted/bin/git -c init.defaultObjectFormat= init --template= /home/redacted/.cache/prek/scratch/.tmpYNzplN`
TRACE Executing `cd /home/redacted/.cache/prek/scratch/.tmpYNzplN && /etc/profiles/per-user/redacted/bin/git remote add origin https://github.com/pre-commit/pre-commit-hooks`
TRACE Executing `cd /home/redacted/.cache/prek/scratch/.tmpYNzplN && /etc/profiles/per-user/redacted/bin/git fetch origin v6.0.0 --depth=1`
TRACE Executing `cd /home/redacted/.cache/prek/scratch/.tmpYNzplN && /etc/profiles/per-user/redacted/bin/git checkout FETCH_HEAD`
TRACE Executing `cd /home/redacted/.cache/prek/scratch/.tmpYNzplN && /etc/profiles/per-user/redacted/bin/git submodule update --init --recursive --depth=1`
DEBUG Hooks going to run: ["mixed-line-ending", "trailing-whitespace"]
DEBUG No matching environment found for hook `mixed-line-ending`, installing...
DEBUG Found uv in PATH: /nix/store/n6chrdybb91npp8gvf8mjk55smx4sn8s-uv-0.8.23/bin/uv
TRACE Using system uv version 0.8.23 at /nix/store/n6chrdybb91npp8gvf8mjk55smx4sn8s-uv-0.8.23/bin/uv
DEBUG Installing environment hook=mixed-line-ending target=/home/redacted/.cache/prek/hooks/python-3D5V2qtv6tsNtL88eh0F
TRACE Executing `/nix/store/n6chrdybb91npp8gvf8mjk55smx4sn8s-uv-0.8.23/bin/uv venv /home/redacted/.cache/prek/hooks/python-3D5V2qtv6tsNtL88eh0F --python-preference managed --no-project [...]`
DEBUG Venv created successfully with no downloads: `/home/redacted/.cache/prek/hooks/python-3D5V2qtv6tsNtL88eh0F`
TRACE Installing dependencies from repo path: /home/redacted/.cache/prek/repos/9f2aecb6df5c72eb
TRACE Executing `cd /home/redacted/.cache/prek/repos/9f2aecb6df5c72eb && /nix/store/n6chrdybb91npp8gvf8mjk55smx4sn8s-uv-0.8.23/bin/uv pip install .`
TRACE Executing `/home/redacted/.cache/prek/hooks/python-3D5V2qtv6tsNtL88eh0F/bin/python -I -c import sys
print(f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}")
print(sys.base_exec_prefix)
[...]`
DEBUG Installed hook `mixed-line-ending` in `/home/redacted/.cache/prek/hooks/python-3D5V2qtv6tsNtL88eh0F`
DEBUG Found installed environment for hook `trailing-whitespace` at `/home/redacted/.cache/prek/hooks/python-3D5V2qtv6tsNtL88eh0F`
TRACE Released lock path=/home/redacted/.cache/prek/.lock
TRACE Executing `/etc/profiles/per-user/redacted/bin/git diff --diff-filter=A --name-only -z -- /tmp/foo`
TRACE Executing `/etc/profiles/per-user/redacted/bin/git write-tree`
TRACE Executing `/etc/profiles/per-user/redacted/bin/git diff-index --binary --exit-code 6ef19b41225c5369f1c104d45d8d85efa9b057b53b14b4b9b939dd74decc5321 -- /tmp/foo [...]`
DEBUG Working tree is clean
TRACE Executing `/etc/profiles/per-user/redacted/bin/git rev-parse --git-dir`
TRACE Executing `cd /tmp/foo && /etc/profiles/per-user/redacted/bin/git diff --cached --name-only --diff-filter=ACMRTUXB -z`
DEBUG Staged files: 0
TRACE Executing `/etc/profiles/per-user/redacted/bin/git diff -- /tmp/foo`
TRACE Files for project `.` after filtered: 0
TRACE Files for hook `mixed-line-ending` after filtered: 0
mixed line ending....................................(no files to check)Skipped
TRACE Files for hook `trailing-whitespace` after filtered: 0
trim trailing whitespace.............................(no files to check)Skipped
Trying to workaround #1028