* [PATCH] Amend git-push refspec documentation
@ 2008-04-21 3:31 Sam Vilain
2008-04-22 5:48 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Sam Vilain @ 2008-04-21 3:31 UTC (permalink / raw)
To: gitster; +Cc: guillaume, git, Sam Vilain
These paragraphs are a little confusing. Also, make it clearer when
you have to specify the full name for <dst>
Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
---
Documentation/git-push.txt | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 3128170..b3d164e 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -35,14 +35,14 @@ OPTIONS
by the source ref, followed by a colon `:`, followed by
the destination ref.
+
-The <src> side can be an
-arbitrary "SHA1 expression" that can be used as an
-argument to `git-cat-file -t`. E.g. `master~4` (push
-four parents before the current master head).
+The <src> side represents the source branch (or arbitrary
+"SHA1 expression"; see linkgit:git-rev-parse[1]) that you want to
+push. The <dst> side represents the destination location.
+
The local ref that matches <src> is used
-to fast forward the remote ref that matches <dst>. If
-the optional plus `+` is used, the remote ref is updated
+to fast forward the remote ref that matches <dst> (or, if no <dst> was
+specified, the same ref that <src> referred to locally). If
+the optional leading plus `+` is used, the remote ref is updated
even if it does not result in a fast forward update.
+
Note: If no explicit refspec is found, (that is neither
@@ -165,7 +165,8 @@ git push origin master::
Find a ref that matches `master` in the source repository
(most likely, it would find `refs/heads/master`), and update
the same ref (e.g. `refs/heads/master`) in `origin` repository
- with it.
+ with it. If `master` did not exist remotely, it would be
+ created.
git push origin :experimental::
Find a ref that matches `experimental` in the `origin` repository
@@ -179,9 +180,10 @@ git push origin master:satellite/master::
git push origin master:refs/heads/experimental::
Create the branch `experimental` in the `origin` repository
- by copying the current `master` branch. This form is usually
- needed to create a new branch in the remote repository as
- there is no `experimental` branch to match.
+ by copying the current `master` branch. This form is only
+ needed to create a new branch in the remote repository when
+ the local name and the remote name are different; otherwise,
+ the branch name on its own will work.
Author
------
--
1.5.5.1.50.g1d36.dirty
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Amend git-push refspec documentation
2008-04-21 3:31 [PATCH] Amend git-push refspec documentation Sam Vilain
@ 2008-04-22 5:48 ` Junio C Hamano
2008-04-22 8:27 ` Sam Vilain
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2008-04-22 5:48 UTC (permalink / raw)
To: Sam Vilain; +Cc: guillaume, git
Sam Vilain <sam.vilain@catalyst.net.nz> writes:
> These paragraphs are a little confusing. Also, make it clearer when
> you have to specify the full name for <dst>
>
> Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
> ---
> Documentation/git-push.txt | 22 ++++++++++++----------
> 1 files changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
> index 3128170..b3d164e 100644
> --- a/Documentation/git-push.txt
> +++ b/Documentation/git-push.txt
> @@ -35,14 +35,14 @@ OPTIONS
> by the source ref, followed by a colon `:`, followed by
> the destination ref.
> +
> -The <src> side can be an
> -arbitrary "SHA1 expression" that can be used as an
> -argument to `git-cat-file -t`. E.g. `master~4` (push
> -four parents before the current master head).
> +The <src> side represents the source branch (or arbitrary
> +"SHA1 expression"; see linkgit:git-rev-parse[1]) that you want to
> +push. The <dst> side represents the destination location.
> +
Hmm. We lost an example but refer to a more authoritative information,
which is probably Ok.
> The local ref that matches <src> is used
> -to fast forward the remote ref that matches <dst>. If
> -the optional plus `+` is used, the remote ref is updated
> +to fast forward the remote ref that matches <dst> (or, if no <dst> was
> +specified, the same ref that <src> referred to locally). If
> +the optional leading plus `+` is used, the remote ref is updated
> even if it does not result in a fast forward update.
> +
That's an improvement.
> @@ -179,9 +180,10 @@ git push origin master:satellite/master::
>
> git push origin master:refs/heads/experimental::
> Create the branch `experimental` in the `origin` repository
> - by copying the current `master` branch. This form is usually
> - needed to create a new branch in the remote repository as
> - there is no `experimental` branch to match.
> + by copying the current `master` branch. This form is only
> + needed to create a new branch in the remote repository when
> + the local name and the remote name are different; otherwise,
> + the branch name on its own will work.
Note that writing "refs/tags/xprm" instead would allow you to create a
lightweight tag over there.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Amend git-push refspec documentation
2008-04-22 5:48 ` Junio C Hamano
@ 2008-04-22 8:27 ` Sam Vilain
0 siblings, 0 replies; 3+ messages in thread
From: Sam Vilain @ 2008-04-22 8:27 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Junio C Hamano wrote:
>> -The <src> side can be an
>> -arbitrary "SHA1 expression" that can be used as an
>> -argument to `git-cat-file -t`. E.g. `master~4` (push
>> -four parents before the current master head).
>> +The <src> side represents the source branch (or arbitrary
>> +"SHA1 expression"; see linkgit:git-rev-parse[1]) that you want to
>> +push. The <dst> side represents the destination location.
>> +
>
> Hmm. We lost an example but refer to a more authoritative information,
> which is probably Ok.
Well, the example I think was quite confusing to people who have never
seen `master~4` before.
>> @@ -179,9 +180,10 @@ git push origin master:satellite/master::
>>
>> git push origin master:refs/heads/experimental::
>> Create the branch `experimental` in the `origin` repository
>> - by copying the current `master` branch. This form is usually
>> - needed to create a new branch in the remote repository as
>> - there is no `experimental` branch to match.
>> + by copying the current `master` branch. This form is only
>> + needed to create a new branch in the remote repository when
>> + the local name and the remote name are different; otherwise,
>> + the branch name on its own will work.
>
> Note that writing "refs/tags/xprm" instead would allow you to create a
> lightweight tag over there.
True. You could probably replace 'branch' with 'ref' in the two places
it occurs in the last sentence to encompass that meaning, too.
Cheers,
Sam.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-22 8:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-21 3:31 [PATCH] Amend git-push refspec documentation Sam Vilain
2008-04-22 5:48 ` Junio C Hamano
2008-04-22 8:27 ` Sam Vilain
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).