Re: [PATCH] branch doc: remove --set-upstream from synopsis

2017-11-16 Thread Junio C Hamano
Todd Zullinger  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).


Re: [PATCH] branch doc: remove --set-upstream from synopsis

2017-11-16 Thread Todd Zullinger

Junio C Hamano wrote:

Todd Zullinger  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 
---


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



Re: [PATCH] branch doc: remove --set-upstream from synopsis

2017-11-16 Thread Junio C Hamano
Todd Zullinger  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 
> ---

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.


Re: [PATCH] branch doc: remove --set-upstream from synopsis

2017-11-16 Thread Todd Zullinger

Martin Ågren wrote:

On 16 November 2017 at 08:46, Todd Zullinger  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-kaarticsivaraam91...@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]  
[]

$ 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.



Re: [PATCH] branch doc: remove --set-upstream from synopsis

2017-11-16 Thread Kaartic Sivaraam

On Thursday 16 November 2017 04:19 PM, Martin Ågren wrote:

On 16 November 2017 at 08:46, Todd Zullinger  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) []]
 [--contains []]
 [--points-at ] [--format=] [...]
-'git branch' [--set-upstream | --track | --no-track] [-l] [-f]  
[]
+'git branch' [--track | --no-track] [-l] [-f]  []


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= | -u ) []
  'git branch' --unset-upstream []
  'git branch' (-m | -M) [] 
@@ -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


Re: [PATCH] branch doc: remove --set-upstream from synopsis

2017-11-16 Thread Martin Ågren
On 16 November 2017 at 08:46, Todd Zullinger  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 
> ---
>
> 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-kaarticsivaraam91...@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) []]
> [--contains []]
> [--points-at ] [--format=] [...]
> -'git branch' [--set-upstream | --track | --no-track] [-l] [-f]  
> []
> +'git branch' [--track | --no-track] [-l] [-f]  []

Personally, I think this is an improvement.

>  'git branch' (--set-upstream-to= | -u ) []
>  'git branch' --unset-upstream []
>  'git branch' (-m | -M) [] 
> @@ -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-kaarticsivaraam91...@gmail.com/

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

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