Skip to content

Skip multi-part usernames in project directory names#62

Open
nmpowell wants to merge 1 commit intosimonw:mainfrom
nmpowell:skip-multi-part-usernames
Open

Skip multi-part usernames in project directory names#62
nmpowell wants to merge 1 commit intosimonw:mainfrom
nmpowell:skip-multi-part-usernames

Conversation

@nmpowell
Copy link

@nmpowell nmpowell commented Jan 31, 2026

Summary

Previously the

Skip the first part if it looks like a username (before common dirs)

resulted in local multi-part usernames like my.name become my-name and subsequently only my was removed by:

if i == 0 and not found_project:
    # Check if next parts contain common dirs
    remaining = [p.lower() for p in parts[i + 1 :]]
    if any(d in remaining for d in skip_dirs):
        continue

Which resulted in unsightly local paths like name-github-some-project which should really be github-some-project.

This PR:

  • Strips the current user's username (with dots converted to dashes) as a prefix when generating display names (and output paths) for local project directories
  • Handles multi-part usernames like first.last that get encoded as first-last- in the directory name
  • Falls back to skipping the first part if a skip_dir exists later, when the username prefix doesn't match
  • Preserves original behavior of skipping all skip_dirs (projects, code, repos, src, dev, work, documents)
  • Added tests for multi-part username prefix stripping

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant