modular / modular/stack-pr

Feature Request: Auto detect default branch

Open
#24 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
Python
Stars
569
Forks
43
PR merge metrics
No merged PRs in 30d

Description

The default branch is currently assumed to be main. I am aware of the flags to override the branches, but it would also be helpful if the tool automatically could detect the default branch.

See eg https://stackoverflow.com/questions/28666357/how-to-get-default-git-branch

I.e. using the result from git symbolic-ref --short refs/remotes/origin/HEAD

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating where the tool assumes the default branch is main and review the branch override flags. Use the issue's suggested git symbolic-ref --short refs/remotes/origin/HEAD command as the detection reference; the work is done when the detected default branch is used without preventing explicit overrides.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.