git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: push.default documented in "man git-push"?

From
David Glasser <glasser@davidglasser.net>
Date
Oct 2, 2012, 19:00 UTC
Message-ID
<CAN7QDoLD+igYqVCgtKQsnW7f1Ntpk-RyaP8cn24cBrMjOO6NEg@mail.gmail.com>
In-Reply-To
<7vbogk90zk.fsf@alter.siamese.dyndns.org>

Thanks Junio! Note that I think the word is usually spelled "controlled" not "controled".

On Tue, Oct 2, 2012 at 11:34 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 111 quoted lines
> Ramkumar Ramachandra <artagnon@gmail.com> writes:
>
>> David Glasser wrote:
>>> Thanks Rankumar! There's also the reference in the "git push origin"
>>> example and the "This is the default operation mode if no explicit
>>> refspec is found".
>>
>> Sorry;  here's a revised patch.
>>
>> --8<--
>
> FYI: the above is not a scissors line.
>
>> From: Ramkumar Ramachandra <artagnon@gmail.com>
>> Date: Tue, 2 Oct 2012 21:06:05 +0530
>> Subject: [PATCH] Documentation: mention `push.default` in git-push.txt
>>
>> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
>> ---
>>  Documentation/git-push.txt | 8 +++++---
>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
>> index cb97cc1..e1e9aca 100644
>> --- a/Documentation/git-push.txt
>> +++ b/Documentation/git-push.txt
>> @@ -37,7 +37,8 @@ OPTIONS[[OPTIONS]]
>>         `+`, followed by the source ref <src>, followed
>>         by a colon `:`, followed by the destination ref <dst>.
>>         It is used to specify with what <src> object the <dst> ref
>> -       in the remote repository is to be updated.
>> +       in the remote repository is to be updated.  If not specified,
>> +       the configuration variable `push.default` is used.
>
> I think this is way suboptimal; it is begging users to do this
>
>         [push]
>                 default = frotz:xyzzy
>
> by making it sound as if push.default gives a default for <refs>.
>
>> @@ -65,7 +66,8 @@ directs git to push "matching" branches: for every
>> branch that
>>  the local side, the remote side is updated if a branch of the same name
>>  already exists on the remote side.  This is the default operation mode
>>  if no explicit refspec is found (that is neither on the command line
>> -nor in any Push line of the corresponding remotes file---see below).
>> +nor in any Push line of the corresponding remotes file, or `push.default`
>> +---see below).
>
> Likewise.  The added part should not be inside the parentheses,
> which is about what the value used for refspec.  `push.default` is
> about what happens when there is _no_ refspec.
>
> I'll queue this instead.  Thanks.
>
> -- >8 --
> From: Ramkumar Ramachandra <artagnon@gmail.com>
> Date: Tue, 2 Oct 2012 21:08:00 +0530
> Subject: [PATCH] Documentation: mention `push.default` in git-push.txt
>
> It already is listed in the "git config" documentation, but people
> interested in pushing would first look at "git push" documentation.
>
> Noticed-by: David Glasser
> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
> Acked-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
> Fixed-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  Documentation/git-push.txt | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
> index cb97cc1..70b18bc 100644
> --- a/Documentation/git-push.txt
> +++ b/Documentation/git-push.txt
> @@ -37,7 +37,9 @@ OPTIONS[[OPTIONS]]
>         `+`, followed by the source ref <src>, followed
>         by a colon `:`, followed by the destination ref <dst>.
>         It is used to specify with what <src> object the <dst> ref
> -       in the remote repository is to be updated.
> +       in the remote repository is to be updated.  If not specified,
> +       the behavior of the command is controled by the `push.default`
> +       configuration variable.
>  +
>  The <src> is often the name of the branch you would want to push, but
>  it can be any arbitrary "SHA-1 expression", such as `master~4` or
> @@ -65,7 +67,8 @@ directs git to push "matching" branches: for every branch that exists on
>  the local side, the remote side is updated if a branch of the same name
>  already exists on the remote side.  This is the default operation mode
>  if no explicit refspec is found (that is neither on the command line
> -nor in any Push line of the corresponding remotes file---see below).
> +nor in any Push line of the corresponding remotes file---see below) and
> +no `push.default` configuration variable is set.
>
>  --all::
>         Instead of naming each ref to push, specifies that all
> @@ -357,7 +360,8 @@ Examples
>         `git push origin :`.
>  +
>  The default behavior of this command when no <refspec> is given can be
> -configured by setting the `push` option of the remote.
> +configured by setting the `push` option of the remote, or the `push.default`
> +configuration variable.
>  +
>  For example, to default to pushing only the current branch to `origin`
>  use `git config remote.origin.push HEAD`.  Any valid <refspec> (like
> --
> 1.8.0.rc0.45.g7ce8dc5
>
-- 
glasser@davidglasser.net | langtonlabs.org | flickr.com/photos/glasser/
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 35 in “push.default documented in "man git-push"?”
  1. David GlasserOct 2, 2012
  2. Ramkumar RamachandraOct 2, 2012
  3. David GlasserOct 2, 2012
  4. Ramkumar RamachandraOct 2, 2012
  5. Matthieu MoyOct 2, 2012
  6. Ramkumar RamachandraOct 2, 2012
  7. Junio C HamanoOct 2, 2012
  8. Matthieu MoyOct 2, 2012
  9. Junio C HamanoOct 2, 2012
  10. David GlasserOct 2, 2012
  11. Junio C HamanoOct 2, 2012
  12. Matthieu MoyOct 3, 2012
  13. Ramkumar RamachandraOct 3, 2012
  14. Nguyen Thai Ngoc DuyOct 3, 2012
  15. Ramkumar RamachandraOct 3, 2012
  16. Nguyen Thai Ngoc DuyOct 3, 2012
  17. Ramkumar RamachandraOct 3, 2012
  18. Nguyen Thai Ngoc DuyOct 3, 2012
  19. Junio C HamanoOct 3, 2012
  20. Jeff KingOct 3, 2012
  21. Junio C HamanoOct 8, 2012
  22. Ramkumar RamachandraOct 7, 2012
  23. Junio C HamanoOct 7, 2012
  24. Ramkumar RamachandraOct 8, 2012
  25. Nguyen Thai Ngoc DuyOct 8, 2012
  26. Junio C HamanoOct 3, 2012
  27. Nguyen Thai Ngoc DuyOct 4, 2012
  28. Junio C HamanoOct 4, 2012
  29. Nguyen Thai Ngoc DuyOct 5, 2012
  30. Junio C HamanoOct 5, 2012
  31. Nguyen Thai Ngoc DuyOct 11, 2012
  32. Matthieu MoyOct 11, 2012
  33. Nguyen Thai Ngoc DuyOct 11, 2012
  34. Junio C HamanoOct 11, 2012
  35. Peter KreftingOct 3, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.