git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Martin <git@mfriebe.de>
Cc: Git List <git@vger.kernel.org>
Subject: Re* Contradicting man page for git branch copy
Date: Sat, 23 Oct 2021 16:57:30 -0700	[thread overview]
Message-ID: <xmqq5ytn8fbp.fsf@gitster.g> (raw)
In-Reply-To: <7a600f7e-e3a7-edac-056c-9639ff01e471@mfriebe.de> (Martin's message of "Sat, 23 Oct 2021 17:25:16 +0200")

Martin <git@mfriebe.de> writes:

> The man page says
>
> 1) Under "Description"
> https://git-scm.com/docs/git-branch#_description
>> The |-c| and |-C| options have the exact same semantics as |-m| and
>> |-M|, except instead of the branch being renamed, it will be copied
>> to a new name, along with its config and reflog.
>
> But on the option itself
> https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--c
>>
>> -c
>> --copy
>>
>>     Copy a branch and the corresponding reflog.
>>
>
> The latter does not mention the config.
>
> So does it copy the config or not ?

Thanks for a report.  

I hope that builtin/branch.c::copy_or_rename_branch() is a
relatively easy read.

----- >8 --------- >8 --------- >8 --------- >8 -----
Subject: branch (doc): -m/-c copies config and reflog

The description section for the command mentions config and reflog
are moved or copied by these options, but the description for these
options did not.  Make them match.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/git-branch.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git i/Documentation/git-branch.txt w/Documentation/git-branch.txt
index 5449767121..8af42eff89 100644
--- i/Documentation/git-branch.txt
+++ w/Documentation/git-branch.txt
@@ -125,14 +125,14 @@ OPTIONS
 
 -m::
 --move::
-	Move/rename a branch and the corresponding reflog.
+	Move/rename a branch, together with its config and reflog.
 
 -M::
 	Shortcut for `--move --force`.
 
 -c::
 --copy::
-	Copy a branch and the corresponding reflog.
+	Copy a branch, together with its config and reflog.
 
 -C::
 	Shortcut for `--copy --force`.



      reply	other threads:[~2021-10-23 23:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-23 15:25 Contradicting man page for git branch copy Martin
2021-10-23 23:57 ` Junio C Hamano [this message]

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=xmqq5ytn8fbp.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@mfriebe.de \
    --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).