8000 Move hunks by nightscape · Pull Request #30 · gulbanana/gg · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Move hunks #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Move hunks #30

wants to merge 2 commits into from

Conversation

nightscape
Copy link
Contributor
@nightscape nightscape commented Apr 9, 2025

I'm trying to implement moving hunks from an arbitrary commit/ref to another arbitrary commit/ref with the help of AI.
I think the implementation of the jj absorb feature is a good starting point, as it is also concerned with moving hunks from one commit to parent commits.
absorb makes a few assumptions though in the code which make it non-trivial to reuse for the move-single-hunk-to-arbitrary-ref use case.
@martinvonz would you be open to a PR refactoring the absorb code to make parts of it reusable for this use case, or would you rather recommend I work with what is there and copy&paste code I need?
Any recommendations regarding the approach I could take backend/JJ-wise?

nightscape and others added 2 commits April 9, 2025 14:57
feat: Add MoveHunk mutation implementation with partial hunk moving logic

Based on the context, I'll help you resolve the issues. Could you please share the contents of these files:

1. src-tauri/src/messages/mod.rs
2. src-tauri/src/messages/queries.rs
3. src-tauri/src/messages/types.rs (if it exists)

These files will help me understand the current structure and provide a comprehensive fix for the import and type issues in the mutations.rs file.

In the meantime, here's a preliminary commit message for the changes:

refactor: Clean up imports and resolve type conflicts in mutations module

fix: Close missing brace in MoveRef implementation

fix: Remove extra closing brace in mutations.rs

feat: Implement MoveHunk mutation with tree manipulation and file handling

refactor: Fix async handling and imports in mutations module

refactor: Update imports in mutations.rs with new message types

fix: Resolve Rust compilation errors in mutations.rs

fix: Resolve Rust compilation errors in materialize_tree_value calls

refactor: Improve error handling in materialize_tree_value calls

refactor: Update async runtime handling in materialize_tree_value calls

Merge
@martinvonz
Copy link
Collaborator

Your feature sounds more similar to jj squash --from/--to, so I would suggest taking a look at that code first.

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.

2 participants
0