Skip to content

Don't overwrite recent repositories (%appdata%\...\Recent\.gitext) with the same name #10845

@CodeCasterNL

Description

@CodeCasterNL

Feature description

The Good

When you open a repository in Git Extensions on Windows, a .gitext file will be written in %appdata%\GitExtensions\GitExtensions\Recent. The contents of this file is a single line of text, representing the path of the opened repository. This .gitext file will then show up under "Recent" when right-clicking the app's icon, and you can pin repos that way:

context menu for Git Extensions icon on Windows

I like to open my pinned/favorite repositories this way - I also apply this to directories in Explorer, solutions in Visual Studio, files in Word, and so on.

The Bad

These files however will only take the name of the rightmost directory of the path. So if you first open the repository at C:\Dev\Foo\Bar and then later C:\Dev\TotallyOtherRepo\Bar, the Bar.gitext file in the Recent directory will be updated with the latter path.

This means the path the pinned file points to will change, and reopening the pinned repository will open a different repository than pinned.

The Ugly

This is especially confusing with submodules. I have:

  • A library I'm developing under C:\Dev\MyLib
  • An application I'm developing under C:\Dev\MyApp
    • With a submodule to the former, under C:\Dev\MyApp\lib\MyLib

And every time I open the submodule from within MyApp, the MyLib.gitext file will change to the latter path, and my pinned MyLib repo will open the repository in the submodule, instead of the "root" version at C:\Dev\MyLib. This is confusing and has caused me multiple times to start working in the wrong directory.

The Requests

I see multiple solutions:

  1. Me paying more attention to which directory I'm in, but that won't fix pinning.
  2. Me copying the .gitext file, renaming it (for example to MyLib-root or MyLib-lib) to prevent it from being overwritten, pinning that one. (This is my current workflow.)
  3. Git Extensions not overwriting .gitext files when opening submodules.
  4. Git Extensions not overwriting .gitext files whose path still exists, but instead adding a new recent file with an earlier part of the path (lib-MyLib, MyApp-lib-MyLib, MyOtherApp-lib-MyLib), or add a suffix (MyLib (2)).
  5. Create subdirectories within the Recent directory, like Recent\C\Dev\MyLib.gitext.
  6. A combination of the above.

Environment

  • Git Extensions 4.0.2.16100
  • Build 25100ec
  • Git 2.39.1.windows.1
  • Microsoft Windows NT 10.0.22621.0
  • .NET 6.0.15
  • DPI 96dpi (no scaling)
  • Microsoft.WindowsDesktop.App Versions
    Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions