From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Git Mailing list <git@vger.kernel.org>
Subject: some apparent inaccuracies in "man git-worktree"
Date: Tue, 14 Nov 2017 03:43:48 -0500 (EST) [thread overview]
Message-ID: <alpine.LFD.2.21.1711140324580.12112@localhost.localdomain> (raw)
more annoying pedantry (but you're used to that by now, right?) ...
from "man git-worktree", there seem to be some inaccuracies in the
SYNOPSIS regarding the "add" subcommand:
git worktree add \
[-f] [--detach] [--checkout] [--lock] [-b <new-branch>] <path> [<branch>]
first, there's no mention of "-B" in that SYNOPSIS, even though it's
explained further down the man page.
next, the SYNOPSIS seems misleading as it doesn't make clear that
the options -b, -B and --detach are mutually exclusive, which is made
clear in the worktree.c source:
if (!!opts.detach + !!opts.new_branch + !!new_branch_force > 1)
die(_("-b, -B, and --detach are mutually exclusive"));
and, to some extent, further down the man page:
"If <branch> is omitted and neither -b nor -B nor --detach used,
then, as a convenience, a new branch based at HEAD is created
automatically, as if -b $(basename <path>) was specified."
finally (and maybe i'm just not reading carefully enough), it's not
clear what happens if you add a worktree at a given commit without
specifying *any* of -b, -B or --detach. the obvious result should be a
new worktree checked out at a detached HEAD and, interestingly, if i
do that, then from the main tree, i see:
$ git worktree list
/home/rpjday/k/git 516fb7f2e73d [master]
/home/rpjday/k/temp c470abd4fde4 (detached HEAD)
$
but from within the worktree, if i ask for the status, i see only:
$ git status
Not currently on any branch.
nothing to commit, working tree clean
$
where i would normally have expected to see "detached HEAD", is there
a reason that's not displayed?
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
next reply other threads:[~2017-11-14 8:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-14 8:43 Robert P. J. Day [this message]
2017-11-14 18:33 ` some apparent inaccuracies in "man git-worktree" Eric Sunshine
2017-11-14 20:10 ` Robert P. J. Day
2017-11-21 19:44 ` Jonathan Nieder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.21.1711140324580.12112@localhost.localdomain \
--to=rpjday@crashcourse.ca \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).