* [PATCH] git-push.txt: mention about remote.*.push when no refspec is given
@ 2013-03-06 12:44 Nguyễn Thái Ngọc Duy
2013-03-06 18:09 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2013-03-06 12:44 UTC (permalink / raw)
To: git; +Cc: Nguyễn Thái Ngọc Duy
remote.*.push is considered before push.default, but there's no
mention about that, except a bit in the examples. The description
of push.default does say something about this, but it would be easier
to find out if it's described here.
The first paragraph describing refspec format is moved down, so that
the new first paragraph is about unspsecified refspec and the
remaining paragraphs refspec format.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
Documentation/git-push.txt | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 1398025..20bf2f5 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -33,13 +33,16 @@ OPTIONS[[OPTIONS]]
of a remote (see the section <<REMOTES,REMOTES>> below).
<refspec>...::
- The format of a <refspec> parameter is an optional plus
- `+`, 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. If not specified,
- the behavior of the command is controlled by the `push.default`
- configuration variable.
+ Specify how how refs are pushed. If not specified and
+ configuration variable `remote.<remote>.push` is set, the
+ variable is used as default refspec. If not specified and the
+ variable is not set, the behavior of the command is controlled
+ by the `push.default` configuration variable.
++
+The format of a <refspec> parameter is an optional plus `+`, 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.
+
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
--
1.8.1.2.536.gf441e6d
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] git-push.txt: mention about remote.*.push when no refspec is given
2013-03-06 12:44 [PATCH] git-push.txt: mention about remote.*.push when no refspec is given Nguyễn Thái Ngọc Duy
@ 2013-03-06 18:09 ` Junio C Hamano
2013-03-08 10:58 ` Duy Nguyen
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2013-03-06 18:09 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> remote.*.push is considered before push.default, but there's no
> mention about that, except a bit in the examples. The description
> of push.default does say something about this, but it would be easier
> to find out if it's described here.
>
> The first paragraph describing refspec format is moved down, so that
> the new first paragraph is about unspsecified refspec and the
> remaining paragraphs refspec format.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> Documentation/git-push.txt | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
> index 1398025..20bf2f5 100644
> --- a/Documentation/git-push.txt
> +++ b/Documentation/git-push.txt
> @@ -33,13 +33,16 @@ OPTIONS[[OPTIONS]]
> of a remote (see the section <<REMOTES,REMOTES>> below).
>
> <refspec>...::
> - The format of a <refspec> parameter is an optional plus
> - `+`, 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. If not specified,
> - the behavior of the command is controlled by the `push.default`
> - configuration variable.
> + Specify how how refs are pushed. If not specified and
> + configuration variable `remote.<remote>.push` is set, the
> + variable is used as default refspec. If not specified and the
> + variable is not set, the behavior of the command is controlled
> + by the `push.default` configuration variable.
> ++
> +The format of a <refspec> parameter is an optional plus `+`, 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.
I agree that saying what it is, what it does or what it is for
upfront (i.e. "Specifies what are pushed") before how it is spelled
is an improvement. I however think describing "If not specified"
here was a mistake, and you are making it worse by burying the
description of what happens when <refspec>... are missing in the
middle of the description for <refspec>...
I would rather see this done in the direction the attached "how
about doing it this way" patch illustrates. The way how "where" and
"what" are determined when the command line does not specify is the
proparty of the entire command, not of an individual parameter.
Documentation/git-push.txt | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 1398025..31dad19 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -23,6 +23,17 @@ You can make interesting things happen to a repository
every time you push into it, by setting up 'hooks' there. See
documentation for linkgit:git-receive-pack[1].
+When the user does not specify where to push with
+<repository> argument, branch.*.remote configuration for the current
+branch is consulted to determine where to push. If the
+configuration is missing, it defaults to 'origin'.
+
+When the user does not specify what to push with
+<refspec>... arguments or --all/--mirror/--tags options, the command finds
+the default <refspec> by consulting remote.*.push configuration, and
+if it is not found, honors push.default configuration to decide what
+to push (See gitlink:git-config[1] for the meaning of push.default).
+
OPTIONS[[OPTIONS]]
------------------
@@ -33,13 +44,10 @@ OPTIONS[[OPTIONS]]
of a remote (see the section <<REMOTES,REMOTES>> below).
<refspec>...::
+ Specify what destination ref to update with what source object.
The format of a <refspec> parameter is an optional plus
- `+`, followed by the source ref <src>, followed
+ `+`, followed by the source object <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. If not specified,
- the behavior of the command is controlled 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
@@ -66,10 +74,7 @@ the remote repository.
The special refspec `:` (or `+:` to allow non-fast-forward updates)
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) and
-no `push.default` configuration variable is set.
+already exists on the remote side.
--all::
Instead of naming each ref to push, specifies that all
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] git-push.txt: mention about remote.*.push when no refspec is given
2013-03-06 18:09 ` Junio C Hamano
@ 2013-03-08 10:58 ` Duy Nguyen
2013-03-08 17:59 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Duy Nguyen @ 2013-03-08 10:58 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Thu, Mar 7, 2013 at 1:09 AM, Junio C Hamano <gitster@pobox.com> wrote:
> I agree that saying what it is, what it does or what it is for
> upfront (i.e. "Specifies what are pushed") before how it is spelled
> is an improvement. I however think describing "If not specified"
> here was a mistake, and you are making it worse by burying the
> description of what happens when <refspec>... are missing in the
> middle of the description for <refspec>...
>
> I would rather see this done in the direction the attached "how
> about doing it this way" patch illustrates. The way how "where" and
> "what" are determined when the command line does not specify is the
> proparty of the entire command, not of an individual parameter.
I agree your patch looks better than mine. Put it on 'pu', perhaps?
--
Duy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] git-push.txt: mention about remote.*.push when no refspec is given
2013-03-08 10:58 ` Duy Nguyen
@ 2013-03-08 17:59 ` Junio C Hamano
0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2013-03-08 17:59 UTC (permalink / raw)
To: Duy Nguyen; +Cc: git
Duy Nguyen <pclouds@gmail.com> writes:
> On Thu, Mar 7, 2013 at 1:09 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> I agree that saying what it is, what it does or what it is for
>> upfront (i.e. "Specifies what are pushed") before how it is spelled
>> is an improvement. I however think describing "If not specified"
>> here was a mistake, and you are making it worse by burying the
>> description of what happens when <refspec>... are missing in the
>> middle of the description for <refspec>...
>>
>> I would rather see this done in the direction the attached "how
>> about doing it this way" patch illustrates. The way how "where" and
>> "what" are determined when the command line does not specify is the
>> proparty of the entire command, not of an individual parameter.
>
> I agree your patch looks better than mine. Put it on 'pu', perhaps?
Heh, that's not my itch ;-)
-- >8 --
Subject: [PATCH] Documentation/git-push: clarify the description of defaults
We describe what gets pushed by default when the command line does
not give any <refspec> under the bullet point of <refspec>.
It is a bit unfriendly to expect users to read on <refspec> when
they are not giving any in the first place. "What gets pushed" is
determined by taking many factors (<refspec> argument being only one
of them) into account, and is a property of the entire command, not
an individual argument. Also we do not describe "Where the push
goes" when the command line does not say.
Give the description on "what gets pushed to where" upfront before
explaining individual arguments and options.
Also update the description of <refspec> to say what it is, what it
is used for, before explaining what shape it takes.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/git-push.txt | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 8b637d3..3b41e72 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -23,6 +23,17 @@ You can make interesting things happen to a repository
every time you push into it, by setting up 'hooks' there. See
documentation for linkgit:git-receive-pack[1].
+When the command line does not specify where to push with the
+`<repository>` argument, `branch.*.remote` configuration for the
+current branch is consulted to determine where to push. If the
+configuration is missing, it defaults to 'origin'.
+
+When the command line does not specify what to push with `<refspec>...`
+arguments or `--all`, `--mirror`, `--tags` options, the command finds
+the default `<refspec>` by consulting `remote.*.push` configuration,
+and if it is not found, honors `push.default` configuration to decide
+what to push (See gitlink:git-config[1] for the meaning of `push.default`).
+
OPTIONS[[OPTIONS]]
------------------
@@ -33,13 +44,10 @@ OPTIONS[[OPTIONS]]
of a remote (see the section <<REMOTES,REMOTES>> below).
<refspec>...::
+ Specify what destination ref to update with what source object.
The format of a <refspec> parameter is an optional plus
- `+`, followed by the source ref <src>, followed
+ `+`, followed by the source object <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. If not specified,
- the behavior of the command is controlled 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,10 +73,7 @@ the remote repository.
The special refspec `:` (or `+:` to allow non-fast-forward updates)
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) and
-no `push.default` configuration variable is set.
+already exists on the remote side.
--all::
Instead of naming each ref to push, specifies that all
--
1.8.2-rc3-243-g6506aa2
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-08 17:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-06 12:44 [PATCH] git-push.txt: mention about remote.*.push when no refspec is given Nguyễn Thái Ngọc Duy
2013-03-06 18:09 ` Junio C Hamano
2013-03-08 10:58 ` Duy Nguyen
2013-03-08 17:59 ` Junio C Hamano
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 NNTP newsgroup(s).