* possible bug when pushing with multiple remote repos.
@ 2010-10-22 9:12 Arnaud Mouiche
2010-10-22 9:32 ` Santi Béjar
0 siblings, 1 reply; 3+ messages in thread
From: Arnaud Mouiche @ 2010-10-22 9:12 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 788 bytes --]
Hi,
I found a behavior which is, at least, different from what "git help
push" seems to declare.
basically:
- if I have 2 remotes : 'origin' and 'remote_B'
- if I checkout with tracking a branch of 'remote_B'
- if I do "git push remote" or "git push" or "git push -repo=remote_B"
then git try to push all my branches of "origin" to remote_B.
I check with latest git 1.7.3.2, and the issue is still here.
strangely:
- git checkout master
- git push => this is OK, and doesn't try to push any remote_B
references to origin.
I found this is particularity error prone as origin/master can be a fast
forward of remote_B/master, and in this case nobody will complains..
(that's what happened to me ;-) )
attached to this mail, a simple script that show the evidence.
regards,
arnaud
[-- Attachment #2: test.sh --]
[-- Type: application/x-shellscript, Size: 2199 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: possible bug when pushing with multiple remote repos.
2010-10-22 9:12 possible bug when pushing with multiple remote repos Arnaud Mouiche
@ 2010-10-22 9:32 ` Santi Béjar
2010-10-22 9:36 ` Santi Béjar
0 siblings, 1 reply; 3+ messages in thread
From: Santi Béjar @ 2010-10-22 9:32 UTC (permalink / raw)
To: Arnaud Mouiche; +Cc: git, Junio C Hamano
On Fri, Oct 22, 2010 at 11:12 AM, Arnaud Mouiche
<arnaud.mouiche@invoxia.com> wrote:
> Hi,
>
> I found a behavior which is, at least, different from what "git help
> push" seems to declare.
> basically:
> - if I have 2 remotes : 'origin' and 'remote_B'
> - if I checkout with tracking a branch of 'remote_B'
> - if I do "git push remote" or "git push" or "git push -repo=remote_B"
> then git try to push all my branches of "origin" to remote_B.
>
> I check with latest git 1.7.3.2, and the issue is still here.
>
> strangely:
> - git checkout master
> - git push => this is OK, and doesn't try to push any remote_B
> references to origin.
>
> I found this is particularity error prone as origin/master can be a fast
> forward of remote_B/master, and in this case nobody will complains..
> (that's what happened to me ;-) )
This is because "git push" pushes matching branches by default if you
don't specify the refspec. From the git push manpage:
<refspec>...
...
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).
It may be worth pointing this out in the description.
(I hope the scissor patch is well formated, and the mua doesn't mangle it)
-----8<-----
Doc: git-push: Specify the default mode in the description
Signed-off-by: Santi Béjar <santi@agolina.net>
---
Documentation/git-push.txt | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index e11660a..9a2a93e 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -23,6 +23,8 @@ 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].
+The default operation mode if no explicit refspec is found is
+to push "matching" branches, see below.
OPTIONS[[OPTIONS]]
------------------
--
1.7.3.rc1.227.gee5c7b
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: possible bug when pushing with multiple remote repos.
2010-10-22 9:32 ` Santi Béjar
@ 2010-10-22 9:36 ` Santi Béjar
0 siblings, 0 replies; 3+ messages in thread
From: Santi Béjar @ 2010-10-22 9:36 UTC (permalink / raw)
To: Arnaud Mouiche; +Cc: git, Junio C Hamano
On Fri, Oct 22, 2010 at 11:32 AM, Santi Béjar <santi@agolina.net> wrote:
> On Fri, Oct 22, 2010 at 11:12 AM, Arnaud Mouiche
> <arnaud.mouiche@invoxia.com> wrote:
>> Hi,
>>
>> I found a behavior which is, at least, different from what "git help
>> push" seems to declare.
>> basically:
>> - if I have 2 remotes : 'origin' and 'remote_B'
>> - if I checkout with tracking a branch of 'remote_B'
>> - if I do "git push remote" or "git push" or "git push -repo=remote_B"
>> then git try to push all my branches of "origin" to remote_B.
>>
>> I check with latest git 1.7.3.2, and the issue is still here.
>>
>> strangely:
>> - git checkout master
>> - git push => this is OK, and doesn't try to push any remote_B
>> references to origin.
>>
>> I found this is particularity error prone as origin/master can be a fast
>> forward of remote_B/master, and in this case nobody will complains..
>> (that's what happened to me ;-) )
>
> This is because "git push" pushes matching branches by default if you
> don't specify the refspec. From the git push manpage:
>
> <refspec>...
> ...
> 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).
>
Ups, I forgot to tell you that you can change the default behavior
with push.default config.
push.default::
Defines the action git push should take if no refspec is given
on the command line, no refspec is configured in the remote, and
no refspec is implied by any of the options given on the command
line. Possible values are:
+
* `nothing` - do not push anything.
* `matching` - push all matching branches.
All branches having the same name in both ends are considered to be
matching. This is the default.
* `tracking` - push the current branch to its upstream branch.
* `current` - push the current branch to a branch of the same name.
HTH,
Santi
> It may be worth pointing this out in the description.
>
> (I hope the scissor patch is well formated, and the mua doesn't mangle it)
> -----8<-----
> Doc: git-push: Specify the default mode in the description
>
> Signed-off-by: Santi Béjar <santi@agolina.net>
> ---
> Documentation/git-push.txt | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
> index e11660a..9a2a93e 100644
> --- a/Documentation/git-push.txt
> +++ b/Documentation/git-push.txt
> @@ -23,6 +23,8 @@ 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].
>
> +The default operation mode if no explicit refspec is found is
> +to push "matching" branches, see below.
>
> OPTIONS[[OPTIONS]]
> ------------------
> --
> 1.7.3.rc1.227.gee5c7b
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-22 9:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-22 9:12 possible bug when pushing with multiple remote repos Arnaud Mouiche
2010-10-22 9:32 ` Santi Béjar
2010-10-22 9:36 ` Santi Béjar
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).