[PR #474] [CLOSED] Close PR - Issue is outdated, function is unused #501

Closed
opened 2026-03-02 04:13:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/git-ai-project/git-ai/pull/474
Author: @Copilot
Created: 2/8/2026
Status: Closed

Base: mainHead: copilot/fix-git-version-incompatibility


📝 Commits (5)

  • 88b10fe Initial plan
  • a9a1ba8 Add Git version check for merge-tree --merge-base support
  • 1334a2e Add documentation and format code for merge-tree version check
  • 4e3799e Address code review feedback on version check implementation
  • 351238e Revert changes - issue is outdated, function is unused

📄 Description

After investigation, this PR is being closed because the issue is completely outdated.

Investigation Findings

  1. Tests don't exist: The issue claims tests authorship::rebase_authorship::tests::test_prepare_working_log_* are failing, but these tests don't exist in the codebase. Running cargo test authorship::rebase_authorship::tests returns 0 tests.

  2. Function is unused: The merge_trees_favor_ours() function is marked with #[allow(dead_code)] and has no callers anywhere in the codebase.

  3. Actual tests pass: The real tests in tests/squash_merge.rs (which have similar names) all pass because they use git merge --squash directly via the test framework, not the unused merge_trees_favor_ours() function.

Changes Reverted

All changes have been reverted to commit 2bbdf5c. The repository is back to its original state with:

  • All 412 library tests passing
  • No modifications to src/git/repository.rs

Conclusion

The issue was based on incorrect information about failing tests that never existed. Since the function in question is unused and the tests all pass, no changes are needed. This PR and the associated issue should be closed.

Original prompt

This section details on the original issue you should resolve

<issue_title>Test Failures in rust:slim-bookworm (Debian 12) Due to Git Version Incompatibility</issue_title>
<issue_description>

Environment

  • Docker Image: rust:slim-bookworm
  • OS: Debian 12 (Bookworm)
  • Git Version: 2.39.5
  • Rust Version: 1.90.0

Issue Description

Four tests fail when running cargo test in the rust:slim-bookworm Docker image due to Git version incompatibility. The tests attempt to use the --merge-base option with git merge-tree --write-tree, which is not supported in Git 2.39.5.

Failed Tests

  1. authorship::rebase_authorship::tests::test_prepare_working_log_simple_squash
  2. authorship::rebase_authorship::tests::test_prepare_working_log_squash_multiple_files
  3. authorship::rebase_authorship::tests::test_prepare_working_log_squash_multiple_sessions
  4. authorship::rebase_authorship::tests::test_prepare_working_log_squash_with_main_changes

Error Message

error: unknown option `merge-base=<sha>'
usage: git merge-tree [--write-tree] [<options>] <branch1> <branch2>
   or: git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>

Command Being Executed

git merge-tree --write-tree --merge-base=<commit-sha> -X ours <branch1> <branch2>

Root Cause

The --merge-base option for git merge-tree --write-tree was introduced in Git 2.46.0 (or a version between 2.39.5 and 2.47.0). Debian 12 (Bookworm) ships with Git 2.39.5, which doesn't support this option.

Test Results

Docker Image Debian Version Git Version Test Result
rust:latest Trixie (13) 2.47.3 All tests pass
rust:slim-bookworm Bookworm (12) 2.39.5 4 tests fail

Reproduction Steps

docker run --rm -v $(pwd):/workspace -w /workspace rust:slim-bookworm bash -c "
  apt-get update && apt-get install -y libssl-dev pkg-config git &&
  cargo test -- --test-threads=1
"

Possible Solutions

  1. Update minimum Git version requirement to 2.46.0+ in documentation
  2. Add fallback logic for older Git versions that don't support --merge-base
  3. Use alternative Git commands that are compatible with Git 2.39.5
  4. Update CI/CD to use a Docker image with Git 2.46.0+

The failures occur in src/authorship/rebase_authorship.rs where git merge-tree is invoked with the --merge-base option for handling squash merge scenarios.

Impact

  • Users running on Debian 12 (Bookworm) stable will experience test failures
  • CI/CD pipelines using rust:slim-bookworm will fail
  • Affects production environments using Debian 12 if these code paths are executed

</issue_description>

<agent_instructions>This is an old issue, so it might no longer be relevant, however, if, in your testing, you find that it is, implement a fix and add regression tests.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/git-ai-project/git-ai/pull/474 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 2/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `copilot/fix-git-version-incompatibility` --- ### 📝 Commits (5) - [`88b10fe`](https://github.com/git-ai-project/git-ai/commit/88b10fe7e5bd11eda9a9fcda64dbb59929c53407) Initial plan - [`a9a1ba8`](https://github.com/git-ai-project/git-ai/commit/a9a1ba89f917713c197d2005d506da298289ff12) Add Git version check for merge-tree --merge-base support - [`1334a2e`](https://github.com/git-ai-project/git-ai/commit/1334a2e488e1e85118d852a4abd7f954d1ee3104) Add documentation and format code for merge-tree version check - [`4e3799e`](https://github.com/git-ai-project/git-ai/commit/4e3799efdd9b2bb07a4015e9fdd3e44a15cbdc06) Address code review feedback on version check implementation - [`351238e`](https://github.com/git-ai-project/git-ai/commit/351238ed629d941bc28e29ff4c793855f86f33ab) Revert changes - issue is outdated, function is unused ### 📄 Description After investigation, this PR is being closed because the issue is **completely outdated**. ## Investigation Findings 1. **Tests don't exist**: The issue claims tests `authorship::rebase_authorship::tests::test_prepare_working_log_*` are failing, but these tests don't exist in the codebase. Running `cargo test authorship::rebase_authorship::tests` returns 0 tests. 2. **Function is unused**: The `merge_trees_favor_ours()` function is marked with `#[allow(dead_code)]` and has no callers anywhere in the codebase. 3. **Actual tests pass**: The real tests in `tests/squash_merge.rs` (which have similar names) all pass because they use `git merge --squash` directly via the test framework, not the unused `merge_trees_favor_ours()` function. ## Changes Reverted All changes have been reverted to commit 2bbdf5c. The repository is back to its original state with: - ✅ All 412 library tests passing - ✅ No modifications to `src/git/repository.rs` ## Conclusion The issue was based on incorrect information about failing tests that never existed. Since the function in question is unused and the tests all pass, no changes are needed. This PR and the associated issue should be closed. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Test Failures in `rust:slim-bookworm` (Debian 12) Due to Git Version Incompatibility</issue_title> > <issue_description> > > ### Environment > - **Docker Image:** `rust:slim-bookworm` > - **OS:** Debian 12 (Bookworm) > - **Git Version:** 2.39.5 > - **Rust Version:** 1.90.0 > > ### Issue Description > > Four tests fail when running `cargo test` in the `rust:slim-bookworm` Docker image due to Git version incompatibility. The tests attempt to use the `--merge-base` option with `git merge-tree --write-tree`, which is not supported in Git 2.39.5. > > ### Failed Tests > > 1. `authorship::rebase_authorship::tests::test_prepare_working_log_simple_squash` > 2. `authorship::rebase_authorship::tests::test_prepare_working_log_squash_multiple_files` > 3. `authorship::rebase_authorship::tests::test_prepare_working_log_squash_multiple_sessions` > 4. `authorship::rebase_authorship::tests::test_prepare_working_log_squash_with_main_changes` > > ### Error Message > > ``` > error: unknown option `merge-base=<sha>' > usage: git merge-tree [--write-tree] [<options>] <branch1> <branch2> > or: git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2> > ``` > > ### Command Being Executed > > ```bash > git merge-tree --write-tree --merge-base=<commit-sha> -X ours <branch1> <branch2> > ``` > > ### Root Cause > > The `--merge-base` option for `git merge-tree --write-tree` was introduced in Git 2.46.0 (or a version between 2.39.5 and 2.47.0). Debian 12 (Bookworm) ships with Git 2.39.5, which doesn't support this option. > > ### Test Results > > | Docker Image | Debian Version | Git Version | Test Result | > |-------------|----------------|-------------|-------------| > | `rust:latest` | Trixie (13) | 2.47.3 | ✅ All tests pass | > | `rust:slim-bookworm` | Bookworm (12) | 2.39.5 | ❌ 4 tests fail | > > ### Reproduction Steps > > ```bash > docker run --rm -v $(pwd):/workspace -w /workspace rust:slim-bookworm bash -c " > apt-get update && apt-get install -y libssl-dev pkg-config git && > cargo test -- --test-threads=1 > " > ``` > > ### Possible Solutions > > 1. **Update minimum Git version requirement** to 2.46.0+ in documentation > 2. **Add fallback logic** for older Git versions that don't support `--merge-base` > 3. **Use alternative Git commands** that are compatible with Git 2.39.5 > 4. **Update CI/CD** to use a Docker image with Git 2.46.0+ > > ### Related Code > > The failures occur in `src/authorship/rebase_authorship.rs` where `git merge-tree` is invoked with the `--merge-base` option for handling squash merge scenarios. > > ### Impact > > - Users running on Debian 12 (Bookworm) stable will experience test failures > - CI/CD pipelines using `rust:slim-bookworm` will fail > - Affects production environments using Debian 12 if these code paths are executed > > </issue_description> > > <agent_instructions>This is an old issue, so it might no longer be relevant, however, if, in your testing, you find that it is, implement a fix and add regression tests.</agent_instructions> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes git-ai-project/git-ai#165 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:13:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#501
No description provided.