Skip to content

update some tests and docs - #57

Merged
genedna merged 16 commits into
libra-tools:mainfrom
jackieismpc:docs/update-docs
Dec 24, 2025
Merged

update some tests and docs#57
genedna merged 16 commits into
libra-tools:mainfrom
jackieismpc:docs/update-docs

Conversation

@jackieismpc

Copy link
Copy Markdown
Contributor

#52
update some tests and docs

jackieismpc and others added 14 commits December 22, 2025 15:05
Signed-off-by: jackieismpc <jackieismpc@gmail.com>
Signed-off-by: jackieismpc <jackieismpc@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Quanyi Ma <eli@patch.sh>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Quanyi Ma <eli@patch.sh>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Quanyi Ma <eli@patch.sh>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Quanyi Ma <eli@patch.sh>
Signed-off-by: jackieismpc <jackieismpc@gmail.com>
Signed-off-by: jackieismpc <jackieismpc@gmail.com>
Signed-off-by: jackieismpc <jackieismpc@gmail.com>
Signed-off-by: jackieismpc <jackieismpc@gmail.com>
Signed-off-by: jackieismpc <jackieismpc@gmail.com>
Signed-off-by: jackieismpc <jackieismpc@gmail.com>
Signed-off-by: jackieismpc <jackieismpc@gmail.com>
Signed-off-by: jackieismpc <jackieismpc@gmail.com>
@genedna
genedna requested review from benjamin-747 and Copilot and removed request for benjamin-747 December 22, 2025 14:17
@genedna

genedna commented Dec 22, 2025

Copy link
Copy Markdown
Contributor

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive test coverage across the codebase and improves documentation, with a focus on ensuring both SHA-1 and SHA-256 hash algorithms are properly tested. The changes refactor duplicated test code into helper functions that test both hash kinds, add new tests for protocol layers, and introduce example programs demonstrating library usage.

Key changes:

  • Test refactoring: Consolidated duplicate SHA-1/SHA-256 tests into parameterized helper functions
  • New test coverage: Added tests for protocol layers (smart, SSH, HTTP, core), pack operations, and internal object handling
  • Documentation additions: New example programs demonstrating hashing, pack encoding/decoding, and tree creation
  • Documentation improvements: Added doc comments to previously undocumented public functions and structs

Reviewed changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
docs/GIT_OBJECTS.md CRITICAL: Contains unresolved merge conflict markers
docs/ARCHITECTURE.md CRITICAL: Contains massive duplication (3-4 copies) and merge conflicts
src/protocol/* Added comprehensive test coverage for smart protocol, types, SSH, HTTP, and core modules
src/internal/pack/* Refactored tests to eliminate duplication; consolidated SHA-1/SHA-256 test variants
src/internal/object/* Refactored tests using helper functions; improved test organization
src/internal/zlib/stream/inflate.rs Added tests for inflate operations; minor typo in comments
src/internal/index.rs Added new unit tests for Index operations
src/internal/metadata/* Added doc comments to public APIs
Examples/*.rs Added four new example programs (minor Chinese comment in one file)
.gitignore Added examples/output_packs to ignore list

Comment thread Examples/create_tree.rs Outdated
Comment thread docs/GIT_OBJECTS.md Outdated
Comment thread docs/ARCHITECTURE.md Outdated
Comment thread src/internal/zlib/stream/inflate.rs Outdated
Comment thread src/internal/zlib/stream/inflate.rs Outdated
Comment thread src/internal/object/commit.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/ARCHITECTURE.md Outdated
jackieismpc and others added 2 commits December 23, 2025 08:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jackie <jackieismpc@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jackie <jackieismpc@gmail.com>
Signed-off-by: jackieismpc <jackieismpc@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

https://github.com/web3infra-foundation/git-internal/blob/ddb6f8904e9ff09d25a91f706c2b939ebf43ba24/src/protocol/core.rs#L250-L257
P1 Badge upload-pack response drops required pkt-line header

In GitProtocol::upload_pack the wrapper discards the BytesMut header returned by SmartProtocol::git_upload_pack (line 256 returns only the pack stream). The upload-pack response in protocol v0/v1 must begin with pkt-line status such as NAK/ACK before the packfile bytes; HTTP handler handle_upload_pack uses this wrapper, so clients will receive a stream containing only raw pack data with no initial pkt-line and will reject the response or hang waiting for the status line.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@genedna
genedna merged commit 4447e3d into libra-tools:main Dec 24, 2025
8 checks passed
genedna added a commit to genedna/git-internal that referenced this pull request Mar 15, 2026
* add 2 docs

Signed-off-by: jackieismpc <jackieismpc@gmail.com>

* update readme

Signed-off-by: jackieismpc <jackieismpc@gmail.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Quanyi Ma <eli@patch.sh>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Quanyi Ma <eli@patch.sh>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Quanyi Ma <eli@patch.sh>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Quanyi Ma <eli@patch.sh>

* update src/delta

Signed-off-by: jackieismpc <jackieismpc@gmail.com>

* modify some docs

Signed-off-by: jackieismpc <jackieismpc@gmail.com>

* update protocol doc and tests

Signed-off-by: jackieismpc <jackieismpc@gmail.com>

* update docs and tests

Signed-off-by: jackieismpc <jackieismpc@gmail.com>

* fix a bug

Signed-off-by: jackieismpc <jackieismpc@gmail.com>

* update object

Signed-off-by: jackieismpc <jackieismpc@gmail.com>

* update pack

Signed-off-by: jackieismpc <jackieismpc@gmail.com>

* add examples and Analyze the coverage of test cases.

Signed-off-by: jackieismpc <jackieismpc@gmail.com>

* Update Examples/create_tree.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jackie <jackieismpc@gmail.com>

* Update docs/GIT_OBJECTS.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jackie <jackieismpc@gmail.com>
Signed-off-by: jackieismpc <jackieismpc@gmail.com>

---------

Signed-off-by: jackieismpc <jackieismpc@gmail.com>
Signed-off-by: Quanyi Ma <eli@patch.sh>
Signed-off-by: Jackie <jackieismpc@gmail.com>
Co-authored-by: Quanyi Ma <eli@patch.sh>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants