-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(Jump List): Use unique name for recent repos #12144
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
Conversation
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.
I see the current handling as a feature, it limits the number of submodules in the jumplist. Half the list will now be like "ICSharp" for me. But maybe better for others.
src/app/GitCommands/UserRepositoryHistory/RepositoryDescriptionProvider.cs
Outdated
Show resolved
Hide resolved
src/app/GitCommands/UserRepositoryHistory/RepositoryDescriptionProvider.cs
Outdated
Show resolved
Hide resolved
@@ -65,6 +77,34 @@ public string Get(string repositoryDir) | |||
return dirInfo.Name; | |||
} | |||
|
|||
public string GetDescriptiveUnique(string repositoryDir) | |||
{ | |||
string unique = GetUnique(repositoryDir); |
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.
I mostly have unique names of my superrepos, with the worktree name (often short like ge_1, ge_2 etc). This is mostly kept here, just with a suffix (I guess I get used to that).
If a supermodule has a description, it should be used for the unique part.
If no description, then the important part is often deeper in the path, I see many that keep structures like gitclones/project1, gitclones/project2. This will then keep the unique part just visible in the tooltip so the main benefit is just being unique.
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.
OK, except the name for submodules. Will use some before approving.
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.
so the main benefit is just being unique.
That is what this PR is about.
If a supermodule has a description, it should be used for the unique part.
This should be applied to RepositoryDescriptionProvider.Get
and not only if there is a description file. Then the application title would benefit from this, too.
I think of "submodule - parentmodule (branch) - Git Extensions".
In the Jump List it would appear as "submodule - parentmodule (D_path_to_parent_subfolder_submodule)".
I would add just one level of super module.
Or else:
Half the list will now be like "ICSharp" for me.
Perhaps we should add submodules to the GE-internal MRU list only, but not to the Jump List.
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.
so the main benefit is just being unique.
That is what this PR is about.
There are many unique "ICSharp" that cannot be differentiated in a simple way as the diff is far right.
Just one "ICSharp" is more a feature for me than in general, not objecting.
If a supermodule has a description, it should be used for the unique part.
This should be applied to
RepositoryDescriptionProvider.Get
and not only if there is a description file. Then the application title would benefit from this, too. I think of "submodule - parentmodule (branch) - Git Extensions". In the Jump List it would appear as "submodule - parentmodule (D_path_to_parent_subfolder_submodule)". I would add just one level of super module.
Yes, that seem fine.
Supermodule instead of parent? (all levels will be too much)
It will not handle (slightly worse even) the the multiple clones, you cannot get it all.
Half the list will now be like "ICSharp" for me.
Perhaps we should add submodules to the GE-internal MRU list only, but not to the Jump List.
Exclude from both if implemented.
I have considered this for some years, but seen it as a setting that would be for primarily myself.
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.
I have considered this for some years, but seen it as a setting that would be for primarily myself.
Interested by that also : I've started to implement it long ago but there are some edge cases on currently opened submodule repo a little hacky to fix 🫤
9fce793
to
f76cc0a
Compare
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.
comment
I like the text as in the title that was just added, mostly descriptive and could be used in addition to this detailed text.
If the path could be seen in the tooltip as for VS Code would be even better but then the .gitext file have to moved.
return shortName.Length == 0 ? unique : $"{shortName} ({unique})"; | ||
} | ||
|
||
public string GetUnique(string repositoryDir) |
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.
Why this as public?
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.
for future use (I have nothing in mind)
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.
suggest to remove from public api
@@ -107,6 +107,7 @@ public void AddToRecent(string workingDir) | |||
|
|||
// sanitise | |||
StringBuilder sb = new(repositoryDescription); | |||
sb.Replace(@":\", "_"); |
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.
discussion:
It would be nize to have / instead of _ in the name, but this is a filename
Similar, I would like to replace \wsl$ with /wsl or so but very minor diff anyway
return shortName.Length == 0 ? unique : $"{shortName} ({unique})"; | ||
} | ||
|
||
public string GetUnique(string repositoryDir) |
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.
suggest to remove from public api
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.
👍
review comment: YAGNI!
Fixes #10845
Proposed changes
WindowsJumpListManager
/RepositoryDescriptionProvider
: Use unique name for recent reposdescriptive name with full path appended
Screenshots
Before
with
repo.gitext
containingD:\Downloads\super\submodule2\repo\
or
D:\Downloads\super\submodule1\repo\
After
with
.git/description
containing:Test methodology
Merge strategy
I agree that the maintainer squash merge this PR (if the commit message is clear).
✒️ I contribute this code under The Developer Certificate of Origin.