gitextensions / gitextensions

Git Extensions is a standalone UI tool for managing git repositories. It also integrates with Windows Explorer and Microsoft Visual Studio (2015/2017/2019).
https://gitextensions.github.io/
Other
7.75k stars 2.08k forks source link

[NBug] git checkout-index: backend/src/S... #10470

Open AndreyRavkov opened 1 year ago

AndreyRavkov commented 1 year ago

Environment

Issue description

Exit code: 1 Command: C:\Program Files\Git\bin\git.exe Arguments: checkout-index --index --force -- "backend/src/Services/Quote/Validation/Rules/Common/Inactive/ListPriceExceededInRenewalRule.cs" "backend/tests/Services.Tests/Quote/Validation/Rules/Common/ListPriceExceededInRenewalRuleTests.cs" Working directory: D:_projects\mf\

GitExtUtils.ExternalOperationException: git checkout-index: backend/src/Services/Quote/Validation/Rules/Common/Inactive/ListPriceExceededInRenewalRule.cs is not in the cache
 ---> System.Exception: git checkout-index: backend/src/Services/Quote/Validation/Rules/Common/Inactive/ListPriceExceededInRenewalRule.cs is not in the cache
   --- End of inner exception stack trace ---
   at GitCommands.ExecutableExtensions.GetOutputAsync(IExecutable executable, ArgumentString arguments, Byte[] input, Encoding outputEncoding, CommandCache cache, Boolean stripAnsiEscapeCodes)
   at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
   at GitCommands.ExecutableExtensions.GetBatchOutput(IExecutable executable, ICollection`1 batchArguments, Byte[] input, Encoding outputEncoding, CommandCache cache, Boolean stripAnsiEscapeCodes)
   at GitCommands.GitModule.ResetFiles(IReadOnlyList`1 files)
   at GitUI.CommandsDialogs.FormCommit.ResetSoftClick(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)

git cherry-pick merge wih remove file revert changes

Steps to reproduce

git cherry-pick choose to merge with removed file revert changes

Did this work in previous version of GitExtensions?

No response

Diagnostics

No response

duplicates-detector-bot[bot] commented 1 year ago

Potential duplicates:

gerhardol commented 1 year ago

Similar to #10423, could be set as a duplicate. git-checkout-index cannot be used for files with certain statuses. Before 4.0 the Git error was just hidden, the popup is added in 4.0. Just ignore it for now.

RussKie commented 1 year ago

@mstv was #10556 targeting this as well?

@AndreyRavkov can you please try one of the latest 4.0 build and see if your issue is fixed? E.g., this one https://ci.appveyor.com/project/gitextensions/gitextensions/builds/45820457/artifacts.

gerhardol commented 1 year ago

@mstv was #10556 targeting this as well?

No This is in FormCommit

ghost commented 1 year ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 14 days. It will be closed if no further activity occurs.

ghost commented 1 year ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 14 days. It will be closed if no further activity occurs.

gerhardol commented 1 year ago

Stage/unstage to reset for now. Upcoming 4.1 handles reset in some more situations but not conflicts when files are removed or added.

To handle this some internal datastructures need to be changed (so worktree and index status know each other). This is not planned, the focus is to get 4.1 released right now.

RussKie commented 1 year ago

@gerhardol do you have any plans for this?

duplicates-detector-bot[bot] commented 1 year ago

Potential duplicates:

duplicates-detector-bot[bot] commented 1 year ago

Potential duplicates:

gerhardol commented 1 year ago

do you have any plans for this?

Not right now.

The likely most common situations of a generic "reset" are handled. The direct use of the Reset form (Reset current branch to here) should follow Git and not be too smart. There are some other generic reset cases that could be handled, but they could lead to more situations like #11216 so the behavior is not obvious. The output at Git errors are improved in next version. Let us implement what is seen as problems, or present the scenario to the users somehow.

RussKie commented 1 year ago

do you have any plans for this?

Not right now.

I'm punting it out of v4.2 then.