Skip to content

Commit d44b517

Browse files
committed
orphan/unborn: fix use of 'orphan' in end-user facing messages
"orphan branch" is not even grammatical ("orphaned branch" is), and we have been using "unborn branch" to mean the state where the HEAD points at a branch that does not yet exist. Update end-user facing messages to correct them. There are cases other random words are used (e.g., "unparented branch") but now we have a glossary entry, use the term "unborn branch" consistently. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 49dc156 commit d44b517

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,7 @@ static struct option *add_common_switch_branch_options(
16271627
parse_opt_tracking_mode),
16281628
OPT__FORCE(&opts->force, N_("force checkout (throw away local modifications)"),
16291629
PARSE_OPT_NOCOMPLETE),
1630-
OPT_STRING(0, "orphan", &opts->new_orphan_branch, N_("new-branch"), N_("new unparented branch")),
1630+
OPT_STRING(0, "orphan", &opts->new_orphan_branch, N_("new-branch"), N_("new unborn branch")),
16311631
OPT_BOOL_F(0, "overwrite-ignore", &opts->overwrite_ignore,
16321632
N_("update ignored files (default)"),
16331633
PARSE_OPT_NOCOMPLETE),

builtin/worktree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@
4949
_("No possible source branch, inferring '--orphan'")
5050

5151
#define WORKTREE_ADD_ORPHAN_WITH_DASH_B_HINT_TEXT \
52-
_("If you meant to create a worktree containing a new orphan branch\n" \
52+
_("If you meant to create a worktree containing a new unborn branch\n" \
5353
"(branch with no commits) for this repository, you can do so\n" \
5454
"using the --orphan flag:\n" \
5555
"\n" \
5656
" git worktree add --orphan -b %s %s\n")
5757

5858
#define WORKTREE_ADD_ORPHAN_NO_DASH_B_HINT_TEXT \
59-
_("If you meant to create a worktree containing a new orphan branch\n" \
59+
_("If you meant to create a worktree containing a new unborn branch\n" \
6060
"(branch with no commits) for this repository, you can do so\n" \
6161
"using the --orphan flag:\n" \
6262
"\n" \
@@ -784,7 +784,7 @@ static int add(int ac, const char **av, const char *prefix)
784784
N_("create a new branch")),
785785
OPT_STRING('B', NULL, &new_branch_force, N_("branch"),
786786
N_("create or reset a branch")),
787-
OPT_BOOL(0, "orphan", &opts.orphan, N_("create unborn/orphaned branch")),
787+
OPT_BOOL(0, "orphan", &opts.orphan, N_("create unborn branch")),
788788
OPT_BOOL('d', "detach", &opts.detach, N_("detach HEAD at named commit")),
789789
OPT_BOOL(0, "checkout", &opts.checkout, N_("populate the new working tree")),
790790
OPT_BOOL(0, "lock", &keep_locked, N_("keep the new working tree locked")),

t/t2400-worktree-add.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ test_wt_add_orphan_hint () {
415415
git -C repo switch --orphan noref &&
416416
test_must_fail git -C repo worktree add $opts foobar/ 2>actual &&
417417
! grep "error: unknown switch" actual &&
418-
grep "hint: If you meant to create a worktree containing a new orphan branch" actual &&
418+
grep "hint: If you meant to create a worktree containing a new unborn branch" actual &&
419419
if [ $use_branch -eq 1 ]
420420
then
421421
grep -E "^hint: +git worktree add --orphan -b [^ ]+ [^ ]+$" actual
@@ -436,7 +436,7 @@ test_expect_success "'worktree add' doesn't show orphan hint in bad/orphan HEAD
436436
(cd repo && test_commit commit) &&
437437
test_must_fail git -C repo worktree add --quiet foobar_branch foobar/ 2>actual &&
438438
! grep "error: unknown switch" actual &&
439-
! grep "hint: If you meant to create a worktree containing a new orphan branch" actual
439+
! grep "hint: If you meant to create a worktree containing a new unborn branch" actual
440440
'
441441

442442
test_expect_success 'local clone from linked checkout' '
@@ -709,7 +709,7 @@ test_expect_success 'git worktree --no-guess-remote option overrides config' '
709709
test_dwim_orphan () {
710710
local info_text="No possible source branch, inferring '--orphan'" &&
711711
local fetch_error_text="fatal: No local or remote refs exist despite at least one remote" &&
712-
local orphan_hint="hint: If you meant to create a worktree containing a new orphan branch" &&
712+
local orphan_hint="hint: If you meant to create a worktree containing a new unborn branch" &&
713713
local invalid_ref_regex="^fatal: invalid reference: " &&
714714
local bad_combo_regex="^fatal: '[-a-z]*' and '[-a-z]*' cannot be used together" &&
715715

0 commit comments

Comments
 (0)