Skip to content

feat: add resolve cmd#1236

Draft
Rudxain wants to merge 3 commits into
tj:mainfrom
Rudxain:feat-resolve
Draft

feat: add resolve cmd#1236
Rudxain wants to merge 3 commits into
tj:mainfrom
Rudxain:feat-resolve

Conversation

@Rudxain
Copy link
Copy Markdown
Contributor

@Rudxain Rudxain commented Mar 4, 2026

closes #1234

Note

I'll push -f only while in draft state, to add missing docs

@Rudxain Rudxain mentioned this pull request Mar 4, 2026
@Rudxain Rudxain force-pushed the feat-resolve branch 4 times, most recently from 0d3a852 to 2f8c5f6 Compare March 4, 2026 05:52
Comment thread bin/git-resolve
Copy link
Copy Markdown
Collaborator

@hyperupcall hyperupcall left a comment

Choose a reason for hiding this comment

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

Thank you for the pull request - just a few general questions, assuming all maintainers agree on adding this feature: #1234 (comment)

  • Is it required to ignore files outside the working directory to "avoid overload"? In my opinion this is unintuitive and I don't think it causes overload: the command should behave the same no matter where the user is in the git repository.
  • I assume the git diff --check ensures that no files with conflict markers are committed. However, it looks like it also checks if there are whitespace errors. I worry that for some user-supplied files, a "whitespace error" (false positive) will always be activated, is there some way to avoid this?

Code comments:

  • I don't think many other bash programs in this repository set IFS to $' \t', so I would prefer if this file would be consistent with that.
  • Would removing the git continue at the bottom avoid the potential pitfall that you mention? I think it would be better to not run git continue in general and let the user do it when they are ready.

@Rudxain
Copy link
Copy Markdown
Contributor Author

Rudxain commented May 17, 2026

Is it required to ignore files outside the working directory [...]

Not really, it's a preventive measure in case there are too many conflicted files. It ensures EDITOR doesn't use too much memory and reduces cognitive load for the user. I believe it's a sensible default since the user can easily change their CWD (and if CWD = worktree-root, then no files are ignored), but I agree that consistency is important as well.

git diff --check [...] also checks if there are whitespace errors. I worry that for some user-supplied files, a "whitespace error" (false positive) will always be activated, is there some way to avoid this?

I have the same concern. I haven't tested, but this command should work as alternative:

git -c core.whitespace='' diff --check

I don't think many other bash programs in this repository set IFS to $' \t', so I would prefer if this file would be consistent with that.
d
I agree, but it has an effect on xargs -0r $(git var GIT_EDITOR) as I removed \n just in case, but it doesn't seem necessary.

Would removing the git continue at the bottom avoid the potential pitfall that you mention?

IIRC, yes

I think it would be better to not run git continue in general and let the user do it when they are ready

I agree. I can remove it now. It can be re-added in the future if a workaround for rerere is found

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.

add resolve command

2 participants