fix(init): the existing-repo error points at "finish", which also refuses this case #842

Open
opened 2026-10-20 16:50:40 +00:00 by hexajon · 0 comments
Owner

What happens

I run madtea init in a local repo that already has commits but no remote. The error is: directory already has commits - use 'madtea finish' to complete work. That remedy does not fit. finish completes a feature branch into a remote that already exists, and under ADR 0006 finish refuses the default branch of a non-empty repo. So the pointed-at command refuses this case too. The caller is sent in a circle.

Why it matters

The real path to make an existing-history repo remote is to create the remote repo, wire origin, and push. The error names none of that.

Fix

Make the existing-repo error name the real next step: create the remote and push the existing history. The message should state a path that actually attaches a remote to existing history, and it should not point at finish, which refuses this case.

Acceptance criteria

  • madtea init in a non-empty repo with no remote no longer names finish as the remedy.
  • The error names a path that creates the remote and pushes the existing history.
  • A test pins the new error text.
  • ADR 0006 (finish refuses the default branch of a non-empty repo), #371 (madt_init discoverability, closed), and the companion request to support gh's repo create --source flags.
## What happens I run `madtea init` in a local repo that already has commits but no remote. The error is: `directory already has commits - use 'madtea finish' to complete work`. That remedy does not fit. `finish` completes a feature branch into a remote that already exists, and under ADR 0006 `finish` refuses the default branch of a non-empty repo. So the pointed-at command refuses this case too. The caller is sent in a circle. ## Why it matters The real path to make an existing-history repo remote is to create the remote repo, wire `origin`, and push. The error names none of that. ## Fix Make the existing-repo error name the real next step: create the remote and push the existing history. The message should state a path that actually attaches a remote to existing history, and it should not point at `finish`, which refuses this case. ## Acceptance criteria - `madtea init` in a non-empty repo with no remote no longer names `finish` as the remedy. - The error names a path that creates the remote and pushes the existing history. - A test pins the new error text. ## Related - ADR 0006 (finish refuses the default branch of a non-empty repo), #371 (`madt_init` discoverability, closed), and the companion request to support gh's `repo create --source` flags.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea#842
No description provided.