Re: [PATCH v2] pack-refs: fail on falsely sorted packed-refs
- From
Max Kirillov <max@max630.net>
- Date
- Feb 13, 2019, 04:23 UTC
- Message-ID
- <20190213042307.GA3064@jessie.local>
- In-Reply-To
- <CAMy9T_EX_L80-V4zD626nFCxw6qa90+pZwcbd6wHw9ZHcj2rNA@mail.gmail.com>
On Mon, Feb 11, 2019 at 08:24:46PM +0100, Michael Haggerty wrote:
> The change to `write_with_updates()` doesn't only affect `pack-refs`. > That function is also called when the `packed-refs` file has to be > rewritten when a packed reference is deleted. This is another thing > that you could test.
Ok, I'll check ti and add to the tests.
Show 7 quoted lines
> But that also means that fairly common commands like `git branch -d` > could be slowed down by this change. I doubt that the slowdown is > prohibitive, but it would be great to see numbers to prove it. For > example, create a repository with a lot (say 10000) references, pack > them, then run `git branch -d` to delete one of them. Benchmark that > once with master and once with your modification and document the > difference.
At my hardware, with 1M references, "branch -d" takes 0.31s of user time before change vs 0.38 after change. Should I mention it in the commit message?
Show 8 quoted lines
>> +test_expect_success 'off-order branch not found' ' >> + test_must_fail git show-ref --verify --quiet refs/heads/b00 >> +' > > I don't think that the above test makes sense. We don't *guarantee* > that an out-of-order reference won't be found. That is an > implementation detail that we are free to change. I think that it > would be OK to just omit this test.
Thanks, will remove this one