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 <gitster@pobox.com>

Junio C Hamano committed Nov 24, 2023 at 12:10 UTC d44b517137ab0d869c81bd532163c3e3e85481e6
3 files changed +7 -7
builtin/checkout.c
+1 -1
@@ -1627,7 +1627,7 @@ static struct option *add_common_switch_branch_options(
1627 parse_opt_tracking_mode),
1628 OPT__FORCE(&opts->force, N_("force checkout (throw away local modifications)"),
1629 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")),
1631 OPT_BOOL_F(0, "overwrite-ignore", &opts->overwrite_ignore,
1632 N_("update ignored files (default)"),
1633 PARSE_OPT_NOCOMPLETE),
builtin/worktree.c
+3 -3
@@ -49,14 +49,14 @@
49 _("No possible source branch, inferring '--orphan'")
50
51 #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" \
53 "(branch with no commits) for this repository, you can do so\n" \
54 "using the --orphan flag:\n" \
55 "\n" \
56 " git worktree add --orphan -b %s %s\n")
57
58 #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" \
60 "(branch with no commits) for this repository, you can do so\n" \
61 "using the --orphan flag:\n" \
62 "\n" \
@@ -784,7 +784,7 @@ static int add(int ac, const char **av, const char *prefix)
784 N_("create a new branch")),
785 OPT_STRING('B', NULL, &new_branch_force, N_("branch"),
786 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")),
788 OPT_BOOL('d', "detach", &opts.detach, N_("detach HEAD at named commit")),
789 OPT_BOOL(0, "checkout", &opts.checkout, N_("populate the new working tree")),
790 OPT_BOOL(0, "lock", &keep_locked, N_("keep the new working tree locked")),
t/t2400-worktree-add.sh
+3 -3
@@ -415,7 +415,7 @@ test_wt_add_orphan_hint () {
415 git -C repo switch --orphan noref &&
416 test_must_fail git -C repo worktree add $opts foobar/ 2>actual &&
417 ! 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 &&
419 if [ $use_branch -eq 1 ]
420 then
421 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
436 (cd repo && test_commit commit) &&
437 test_must_fail git -C repo worktree add --quiet foobar_branch foobar/ 2>actual &&
438 ! 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
440 '
441
442 test_expect_success 'local clone from linked checkout' '
@@ -709,7 +709,7 @@ test_expect_success 'git worktree --no-guess-remote option overrides config' '
709 test_dwim_orphan () {
710 local info_text="No possible source branch, inferring '--orphan'" &&
711 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" &&
713 local invalid_ref_regex="^fatal: invalid reference: " &&
714 local bad_combo_regex="^fatal: '[-a-z]*' and '[-a-z]*' cannot be used together" &&
715