All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] branch doc: remove --set-upstream from synopsis
@ 2017-11-16  7:46 Todd Zullinger
  2017-11-16 10:49 ` Martin Ågren
  2017-11-17  1:18 ` Junio C Hamano
  0 siblings, 2 replies; 7+ messages in thread
From: Todd Zullinger @ 2017-11-16  7:46 UTC (permalink / raw)
  To: git; +Cc: Kaartic Sivaraam, Junio C Hamano, Martin Ågren

Support for the --set-upstream option was removed in 52668846ea
(builtin/branch: stop supporting the "--set-upstream" option,
2017-08-17), after a long deprecation period.

Remove the option from the command synopsis for consistency.  Replace
another reference to it in the description of `--delete` with
`--set-upstream-to`.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
---

I noticed that --set-upstream was still in the synopsis for git branch.  I
don't think it was left there intentionally.  I looked through the thread where
support for the option was removed and didn't notice any comments suggesting
otherwise[1].  With luck, I didn't miss the obvious while reading the thread.

[1] https://public-inbox.org/git/20170807143938.5127-1-kaarticsivaraam91196@gmail.com/

 Documentation/git-branch.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index d6587c5e96..159ca388f1 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -14,7 +14,7 @@ SYNOPSIS
 	[(--merged | --no-merged) [<commit>]]
 	[--contains [<commit]] [--no-contains [<commit>]]
 	[--points-at <object>] [--format=<format>] [<pattern>...]
-'git branch' [--set-upstream | --track | --no-track] [-l] [-f] <branchname> [<start-point>]
+'git branch' [--track | --no-track] [-l] [-f] <branchname> [<start-point>]
 'git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]
 'git branch' --unset-upstream [<branchname>]
 'git branch' (-m | -M) [<oldbranch>] <newbranch>
@@ -86,7 +86,7 @@ OPTIONS
 --delete::
 	Delete a branch. The branch must be fully merged in its
 	upstream branch, or in `HEAD` if no upstream was set with
-	`--track` or `--set-upstream`.
+	`--track` or `--set-upstream-to`.
 
 -D::
 	Shortcut for `--delete --force`.
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] branch doc: remove --set-upstream from synopsis
  2017-11-16  7:46 [PATCH] branch doc: remove --set-upstream from synopsis Todd Zullinger
@ 2017-11-16 10:49 ` Martin Ågren
  2017-11-16 11:10   ` Kaartic Sivaraam
  2017-11-16 17:01   ` Todd Zullinger
  2017-11-17  1:18 ` Junio C Hamano
  1 sibling, 2 replies; 7+ messages in thread
From: Martin Ågren @ 2017-11-16 10:49 UTC (permalink / raw)
  To: Todd Zullinger; +Cc: Git Mailing List, Kaartic Sivaraam, Junio C Hamano

On 16 November 2017 at 08:46, Todd Zullinger <tmz@pobox.com> wrote:
> Support for the --set-upstream option was removed in 52668846ea
> (builtin/branch: stop supporting the "--set-upstream" option,
> 2017-08-17), after a long deprecation period.
>
> Remove the option from the command synopsis for consistency.  Replace
> another reference to it in the description of `--delete` with
> `--set-upstream-to`.
>
> Signed-off-by: Todd Zullinger <tmz@pobox.com>
> ---
>
> I noticed that --set-upstream was still in the synopsis for git branch.  I
> don't think it was left there intentionally.  I looked through the thread where
> support for the option was removed and didn't notice any comments suggesting
> otherwise[1].  With luck, I didn't miss the obvious while reading the thread.
>
> [1] https://public-inbox.org/git/20170807143938.5127-1-kaarticsivaraam91196@gmail.com/

Actually, the first version of the series did remove it from the
synopsis [2]. That hunk was later dropped. Kaartic mentioned it [3] and
I thought out loud about it [4].

I get the same initial thought now as then: It's a bit odd that we pique
the interest of the reader, but that when they try it out or read up on
it, we say "nope, this is not what you are looking for".

> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
> index d6587c5e96..159ca388f1 100644
> --- a/Documentation/git-branch.txt
> +++ b/Documentation/git-branch.txt
> @@ -14,7 +14,7 @@ SYNOPSIS
>         [(--merged | --no-merged) [<commit>]]
>         [--contains [<commit]] [--no-contains [<commit>]]
>         [--points-at <object>] [--format=<format>] [<pattern>...]
> -'git branch' [--set-upstream | --track | --no-track] [-l] [-f] <branchname> [<start-point>]
> +'git branch' [--track | --no-track] [-l] [-f] <branchname> [<start-point>]

Personally, I think this is an improvement.

>  'git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]
>  'git branch' --unset-upstream [<branchname>]
>  'git branch' (-m | -M) [<oldbranch>] <newbranch>
> @@ -86,7 +86,7 @@ OPTIONS
>  --delete::
>         Delete a branch. The branch must be fully merged in its
>         upstream branch, or in `HEAD` if no upstream was set with
> -       `--track` or `--set-upstream`.
> +       `--track` or `--set-upstream-to`.

Good catch.

Martin

[2] https://public-inbox.org/git/20170807143938.5127-2-kaarticsivaraam91196@gmail.com/

[3] https://public-inbox.org/git/20170817025425.6647-2-kaarticsivaraam91196@gmail.com/

[4] https://public-inbox.org/git/CAN0heSquaXk421sR6Ry59C+er8n26nC93=3KG1wD0xNXZkuiGw@mail.gmail.com/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] branch doc: remove --set-upstream from synopsis
  2017-11-16 10:49 ` Martin Ågren
@ 2017-11-16 11:10   ` Kaartic Sivaraam
  2017-11-16 17:01   ` Todd Zullinger
  1 sibling, 0 replies; 7+ messages in thread
From: Kaartic Sivaraam @ 2017-11-16 11:10 UTC (permalink / raw)
  To: Martin Ågren, Todd Zullinger; +Cc: Git Mailing List, Junio C Hamano

On Thursday 16 November 2017 04:19 PM, Martin Ågren wrote:
> On 16 November 2017 at 08:46, Todd Zullinger <tmz@pobox.com> wrote:
>> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
>> index d6587c5e96..159ca388f1 100644
>> --- a/Documentation/git-branch.txt
>> +++ b/Documentation/git-branch.txt
>> @@ -14,7 +14,7 @@ SYNOPSIS
>>          [(--merged | --no-merged) [<commit>]]
>>          [--contains [<commit]] [--no-contains [<commit>]]
>>          [--points-at <object>] [--format=<format>] [<pattern>...]
>> -'git branch' [--set-upstream | --track | --no-track] [-l] [-f] <branchname> [<start-point>]
>> +'git branch' [--track | --no-track] [-l] [-f] <branchname> [<start-point>]
> 
> Personally, I think this is an improvement.
>

I didn't remove it as there wasn't a "strong" consensus that this should 
go off the "Synopsis" at that time. If removing it from the synopsis 
seems to be better than leaving it, then lets do it. Further, I think we 
should make this some kind of "guideline" in this project to remain 
consistent. Something like,


     * If you deprecate an option of a command to an extent that it's not
       usable at all, remove that option from the "Synopsis" of the
       concerned "Documentation".


possibly to "Documentation/SubmittingPatches" or at least keep this as 
some form of undocumented guideline if this might make 
"Documentation/SubmittingPatches" unnecessarily clumsy. I dunno, was 
just thinking out loud.


>>   'git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]
>>   'git branch' --unset-upstream [<branchname>]
>>   'git branch' (-m | -M) [<oldbranch>] <newbranch>
>> @@ -86,7 +86,7 @@ OPTIONS
>>   --delete::
>>          Delete a branch. The branch must be fully merged in its
>>          upstream branch, or in `HEAD` if no upstream was set with
>> -       `--track` or `--set-upstream`.
>> +       `--track` or `--set-upstream-to`.
> 
> Good catch.
> 

Yep. Thanks for catching this.


---
Kaartic

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] branch doc: remove --set-upstream from synopsis
  2017-11-16 10:49 ` Martin Ågren
  2017-11-16 11:10   ` Kaartic Sivaraam
@ 2017-11-16 17:01   ` Todd Zullinger
  1 sibling, 0 replies; 7+ messages in thread
From: Todd Zullinger @ 2017-11-16 17:01 UTC (permalink / raw)
  To: Martin Ågren; +Cc: Git Mailing List, Kaartic Sivaraam, Junio C Hamano

Martin Ågren wrote:
> On 16 November 2017 at 08:46, Todd Zullinger <tmz@pobox.com> wrote:
>> I noticed that --set-upstream was still in the synopsis for git branch.  I 
>> don't think it was left there intentionally.  I looked through the thread where 
>> support for the option was removed and didn't notice any comments suggesting 
>> otherwise[1].  With luck, I didn't miss the obvious while reading the thread.
>>
>> [1] https://public-inbox.org/git/20170807143938.5127-1-kaarticsivaraam91196@gmail.com/
>
> Actually, the first version of the series did remove it from the 
> synopsis [2]. That hunk was later dropped. Kaartic mentioned it [3] and 
> I thought out loud about it [4].

Oh my.  I'll have to hope no prospective employer finds this thread if 
I ever apply for a job as a proofreader.  ;)

Thanks for pointing out the relevant parts of the discussion, of 
course.

> I get the same initial thought now as then: It's a bit odd that we 
> pique the interest of the reader, but that when they try it out or 
> read up on it, we say "nope, this is not what you are looking for".

Indeed.  If we do want to keep the option in the synopsis, it should 
at least be moved to the same entry as --set-upstream-to, since that's 
it's effect now.

I don't think we should do that, but it would at least be accurate 
there.  Using it like it's described in the synopsis now is an error.

# git branch [--set-upstream | --track | --no-track] [-l] [-f] <branchname> [<start-point>]

$ git branch --set-upstream mybranch master
fatal: the '--set-upstream' option is no longer supported. Please use 
'--track' or '--set-upstream-to' instead.

$ git branch --track mybranch master
Branch 'mybranch' set up to track local branch 'master'.

Kaartic Sivaraam wrote:
> I didn't remove it as there wasn't a "strong" consensus that this 
> should go off the "Synopsis" at that time. If removing it from the 
> synopsis seems to be better than leaving it, then lets do it.

Indeed, I'm sorry I missed that you'd removed it earlier in the patch 
history.  I'm obviously in favor of removing it now. :)

> Further, I think we should make this some kind of "guideline" in 
> this project to remain consistent. Something like,
>
>    * If you deprecate an option of a command to an extent that it's not 
>      usable at all, remove that option from the "Synopsis" of the 
>      concerned "Documentation".
>
> possibly to "Documentation/SubmittingPatches" or at least keep this as 
> some form of undocumented guideline if this might make 
> "Documentation/SubmittingPatches" unnecessarily clumsy. I dunno, was 
> just thinking out loud.

Yeah, it's probably tough to cover the many varied situations like 
this to SubmittingPatches.  In general, I would agree with the above 
guideline.  It's best to not steer people toward options which we 
would prefer them not to use.

Where that line falls with regard to documentation can certainly vary 
a lot.  It's often hard for long-time git users to step into the shoes 
of new users who may be reading the documentation for the first time. 
The right balance between enough information and not too much is 
always tricky.

[Incidentally, I ran into this because I had made some changes on a 
master branch of a repository.  Later, I wanted to move them to a 
topic branch so I could do some other comparisons between master and 
upstream.  I wondered if I could setup the remote tracking using git 
branch on the new branch in one step.  The recent branch --copy option 
does this perfectly (and easily).]

Thanks to both of you.

-- 
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Whenever I feel blue, I start breathing again.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] branch doc: remove --set-upstream from synopsis
  2017-11-16  7:46 [PATCH] branch doc: remove --set-upstream from synopsis Todd Zullinger
  2017-11-16 10:49 ` Martin Ågren
@ 2017-11-17  1:18 ` Junio C Hamano
  2017-11-17  1:36   ` Todd Zullinger
  1 sibling, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2017-11-17  1:18 UTC (permalink / raw)
  To: Todd Zullinger; +Cc: git, Kaartic Sivaraam, Martin Ågren

Todd Zullinger <tmz@pobox.com> writes:

> Support for the --set-upstream option was removed in 52668846ea
> (builtin/branch: stop supporting the "--set-upstream" option,
> 2017-08-17), after a long deprecation period.
>
> Remove the option from the command synopsis for consistency.  Replace
> another reference to it in the description of `--delete` with
> `--set-upstream-to`.
>
> Signed-off-by: Todd Zullinger <tmz@pobox.com>
> ---

Makes sense.  Even though we internally still carry (and have to
carry) code to notice and explicitly reject "--set-upstream", I do
not think that we need to suggest its presence to the end user.

The option parsing code marks it with the PARSE_OPT_HIDDEN bit
correctly and it would make sense to make the synopsis section
follow suit.

Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] branch doc: remove --set-upstream from synopsis
  2017-11-17  1:18 ` Junio C Hamano
@ 2017-11-17  1:36   ` Todd Zullinger
  2017-11-17  3:02     ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Todd Zullinger @ 2017-11-17  1:36 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Kaartic Sivaraam, Martin Ågren

Junio C Hamano wrote:
> Todd Zullinger <tmz@pobox.com> writes:
>> Support for the --set-upstream option was removed in 52668846ea
>> (builtin/branch: stop supporting the "--set-upstream" option,
>> 2017-08-17), after a long deprecation period.
>>
>> Remove the option from the command synopsis for consistency.  Replace
>> another reference to it in the description of `--delete` with
>> `--set-upstream-to`.
>>
>> Signed-off-by: Todd Zullinger <tmz@pobox.com>
>> ---
>
> Makes sense.  Even though we internally still carry (and have to
> carry) code to notice and explicitly reject "--set-upstream", I do
> not think that we need to suggest its presence to the end user.
>
> The option parsing code marks it with the PARSE_OPT_HIDDEN bit
> correctly and it would make sense to make the synopsis section
> follow suit.

Seeing that the error output when using it tells the user to "use
'--track' or '--set-upstream-to' instead," should we perhaps also
remove the --set-upstream entry entirely?  That's reads:

    --set-upstream::
            As this option had confusing syntax, it is no longer supported.
            Please use `--track` or `--set-upstream-to` instead.

I don't have a strong opinion either way, but perhaps the error
message is all that's needed now?  Only users who have a long memory
or are reading old documentation will call --set-upstream.  I can
imagine someone coming along in a few months suggesting to remove the
remaining reference to --set-upstream from the git branch
documentation for consistency.

-- 
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...more people are driven insane through religious hysteria than by
drinking alcohol.
    -- W.C. Fields


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] branch doc: remove --set-upstream from synopsis
  2017-11-17  1:36   ` Todd Zullinger
@ 2017-11-17  3:02     ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2017-11-17  3:02 UTC (permalink / raw)
  To: Todd Zullinger; +Cc: git, Kaartic Sivaraam, Martin Ågren

Todd Zullinger <tmz@pobox.com> writes:

> Seeing that the error output when using it tells the user to "use
> '--track' or '--set-upstream-to' instead," should we perhaps also
> remove the --set-upstream entry entirely?  That's reads:
>
>    --set-upstream::
>            As this option had confusing syntax, it is no longer supported.
>            Please use `--track` or `--set-upstream-to` instead.
>
> I don't have a strong opinion either way, but perhaps the error
> message is all that's needed now?  Only users who have a long memory
> or are reading old documentation will call --set-upstream.  I can
> imagine someone coming along in a few months suggesting to remove the
> remaining reference to --set-upstream from the git branch
> documentation for consistency.

Perhaps.  But that must happen after we can safely remove the hidden
option that is there only to issue an error message.  I suspect that
we may not quite ready yet (the entry is there to ensure that an
"branch --set-upstream $rest" coming from an existing script and
trained fingers does not silently use --set-upstream-to thanks to
the helpful parse-options UI).

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-17  3:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-16  7:46 [PATCH] branch doc: remove --set-upstream from synopsis Todd Zullinger
2017-11-16 10:49 ` Martin Ågren
2017-11-16 11:10   ` Kaartic Sivaraam
2017-11-16 17:01   ` Todd Zullinger
2017-11-17  1:18 ` Junio C Hamano
2017-11-17  1:36   ` Todd Zullinger
2017-11-17  3:02     ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.