Skip to content
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

FormCreateWorktree: Build potential worktree path using repository path #10290

Conversation

pmiossec
Copy link
Member

instead of the currently checked out worktree
that probably contains information related to the branch checked out

Screenshots

Before

The directory path proposed for the new worktree is based on the current checked out worktree (so the path proposed could be strange if it contains the name of the branch in the path)

image

After

Whatever is the worktree checked out, the path proposed is based on the main git repo path

image

Test methodology

  • manual

Test environment(s)

  • Git Extensions 33.33.33
  • Build 3b780b4 (Dirty)
  • Git 2.38.0.windows.1 (recommended: 2.38.1 or later)
  • Microsoft Windows NT 10.0.19042.0
  • .NET 6.0.10
  • DPI 96dpi (no scaling)

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.

@ghost ghost assigned pmiossec Oct 24, 2022
Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@RussKie RussKie added 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity area: worktree labels Oct 25, 2022
@ghost ghost removed the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Oct 25, 2022
Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sensible! Just nitpicks.

instead of the currently checked out worktree
that probably contains information related to the branch checked out
@pmiossec pmiossec force-pushed the worktree_better_branch_naming_proposition branch from c9115a9 to 1029544 Compare October 28, 2022 21:32
@pmiossec
Copy link
Member Author

done.

{
return string.Join("_", branchName.Split(_invalidCharsInPath, StringSplitOptions.RemoveEmptyEntries)).TrimEnd('.');
}
string NormalizeBranchName(string branchName) => string.Join("_", branchName.Split(_invalidCharsInPath, StringSplitOptions.RemoveEmptyEntries)).TrimEnd('.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have branch normalisation strategies we use in the branch dialog. Should we use the same?
Not asking to do it here, just making an observation.

@RussKie RussKie added this to the vNext milestone Oct 28, 2022
@RussKie RussKie merged commit 9fd9895 into gitextensions:master Nov 16, 2022
@pmiossec pmiossec deleted the worktree_better_branch_naming_proposition branch November 16, 2022 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants