-
Notifications
You must be signed in to change notification settings - Fork 0
feat(git-shim): warn on reset --soft/--mixed onto a diverged target #462
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
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: getappz/agentflare
Length of output: 25163
🏁 Script executed:
Repository: getappz/agentflare
Length of output: 20883
🏁 Script executed:
Repository: getappz/agentflare
Length of output: 17311
🌐 Web query:
git reset documentation default mixed mode pathspec -- boundary patch form💡 Result:
The git reset command documentation defines multiple invocation forms, each handling different scopes such as entire branches, specific paths, or interactive changes [1][2]. Default Behavior and Mixed Mode When git reset is used without path specifications—specifically in the form git reset [] []—it acts on the current branch head [1][3]. In this form, if the argument is omitted, it defaults to --mixed [1][4]. The --mixed mode updates the index to match the specified commit (defaulting to HEAD) while leaving the working directory unchanged [1][5]. Pathspec Usage When you provide path specifications (pathspec) to git reset, the command operates differently; it does not move the branch head [2][6]. Instead, it updates the staged version of the specified files or directories to match the version from the given commit or tree (which also defaults to HEAD) [7][2]. This essentially unstages changes for the specified paths and is considered the opposite of git add [7][6]. Patch Mode The git reset --patch (or -p) option allows for interactive selection of changes [7][2]. In this mode, Git presents differences between the index and the specified commit or tree (defaulting to HEAD) [6][3]. You can interactively choose hunks to "reset," which reverses the chosen changes in the index [2][3]. Like the pathspec form, this is the opposite of git add --patch and does not affect the working tree or the current branch head [7][2]. Summary of Forms 1. Branch-level reset: git reset [--soft | --mixed | --hard |...] [] (defaults to --mixed HEAD) [1][2]. 2. Path-level reset: git reset [] [--] ... (updates index for specific paths) [2][6]. 3. Interactive reset: git reset --patch [] [--] [...] (selectively unstage changes) [2][3].
Citations:
Handle default mixed resets before the
--boundary.git reset <target>defaults to--mixedand movesHEAD, but lines 313-320 require an explicit mode. The mode check also scans arguments after--, sogit reset <target> -- --softcan produce a warning even though this is a pathspec form. Parse only options before--, treat no explicit mode as--mixed, and exclude pathspec and--patchforms. Update tests at lines 1420-1451 for the implicit mixed case and the--boundary.🤖 Prompt for AI Agents