gitextensions icon indicating copy to clipboard operation
gitextensions copied to clipboard

Cherry pick on a file is not available if Git treated it as copied from another one

Open andry81 opened this issue 8 months ago • 0 comments

Environment

  • Git Extensions 6.0.0.18195
  • Build 2121cd76bc68629d32b038a9d9edd2c10e147969
  • Git 2.50.1.windows.1
  • Microsoft Windows NT 6.3.9600.0
  • .NET 9.0.6
  • DPI 96dpi (no scaling)
  • Portable: False
  • Microsoft.WindowsDesktop.App Versions
    Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

    Microsoft.WindowsDesktop.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

    Microsoft.WindowsDesktop.App 9.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Issue description

If use context menu in the Diff Window on a commit to cherry pick a file. Then there is no any a cherry pick menu item due to a file is a copy (with a modification) from another file (double white paper list icon).

Steps to reproduce

  1. Init a new repo
  2. Add a file 1/test1.txt with content:
    123
    
  3. Commit changes as 1
  4. Add a file 2/test1.txt with a bit different content (a new line changes is required because 123456 won't be treated by the Git as a copy of 123):
    123
    123
    
  5. Commit changes as 2
  6. Tag commit 2 as 2
  7. Reset with hard to commit 1
  8. Select commit 2 and try to cherry pick 2/test1.txt from the Diff window
  9. The cherry pick menu item is absent

But instead the Reset menu item is present. If then try to reset to the Second instead, then the file will appear in the Working Tree as expected. And in the staged area is ready to commit.

But now the Cherry pick menu item is appeared on a commit 2.

If try to cherry pick now, then the file does change and still persist in the staged area. But why it does change if has no difference? May be this is another issue?

Did this work in previous version of GitExtensions?

not tested

Diagnostics

No response

andry81 avatar Aug 19 '25 11:08 andry81