All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Baumann <siprbaum@stud.informatik.uni-erlangen.de>
To: git@vger.kernel.org
Subject: Re: defaults for where to merge from
Date: Wed, 28 Feb 2007 18:31:26 +0100	[thread overview]
Message-ID: <slrneubf3e.54h.siprbaum@xp.machine.xx> (raw)
In-Reply-To: 200702281522.14965.andyparkins@gmail.com

Andy Parkins <andyparkins@gmail.com> schrieb:
> On Wednesday 2007 February 28 14:53, Paolo Bonzini wrote:
>> As can be seen from my other messages, I'm experimenting a little with
>> git and trying to understand how its workflow compares with arch.  Right
>> now, my procedure for branching off a remote archive is:
>>
>>    git checkout -b branchname remote/upstreambranch
>>    git config --add branch.branchname.remote remote
>>    git config --add branch.branchname.merge refs/heads/upstreambranch
>>
>> Is there a reason why "git branch" and "git checkout -b" should not
>> automatically do the two "git-config --add"s when the source branch is
>> remote?
>
> I can see why that would be handy, but I often make short lived branches off a 
> remote; and I wouldn't want my config cluttered up with branch defintions.
>
>> In case the source branch is not remote, would "origin" be a good choice
>> for the "branch.branchname.remote" variable?
>
> No.  That would still reference a remote.  As in:
>
> [remote "origin"]
>         url = git://git.kernel.org/pub/scm/git/git.git
>         fetch = refs/heads/master:refs/remotes/origin/master
> [branch "master"]
>         remote = origin
>         merge = refs/heads/master
>
> The remote = origin tells git to use the [remote "origin"] section.
>
> I think what you want is something that I would like too.  If you specify "." 
> to a git-pull it means to use the local repository not a remote.  It would be 
> great if one could have:
>
> [remote "origin"]
>         url = git://git.kernel.org/pub/scm/git/git.git
>         fetch = refs/heads/master:refs/remotes/origin/master
> [branch "master"]
>         remote = .
>         merge = refs/remotes/origin/master
>
> That way a "git pull" on master wouldn't need to make a remote connection in 
> order to do a merge (which is the way I like it).  However, I remember there 
> was a reason this wouldn't work, but I don't remember what it was :-)
>
>
> Andy

This doesn't work (AIUI). In your example you need to have a remote named ".",
which you havened (and I don't think . is valid for a remote name ).

But this works for me:

[remote "origin"]
        url = host:/path/to/your/repo
        fetch = refs/heads/*:refs/remotes/origin/*

[remote "local"]
        url = .
        fetch = refs/remotes/*:refs/remotes/*	# fetch into itself -> do nothing
						# needed to get the LHS of the fetch

[branch "testbranch"]
        remote = local
        merge = refs/remotes/origin/master	# specifying the LHS of the fetch


When on branch 'testbranch', a	'git pull local' merges
'refs/remotes/origin/master'.

Peter

      parent reply	other threads:[~2007-02-28 17:29 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-28 14:53 defaults for where to merge from Paolo Bonzini
2007-02-28 15:13 ` Johannes Schindelin
2007-02-28 15:22 ` Andy Parkins
2007-02-28 15:30   ` Paolo Bonzini
2007-02-28 15:43     ` Andy Parkins
2007-02-28 15:30   ` Julian Phillips
2007-02-28 15:46     ` Johannes Schindelin
2007-02-28 17:11       ` Paolo Bonzini
2007-02-28 18:06         ` Johannes Schindelin
2007-03-01  7:52           ` [PATCH] defaults for where to merge from (take 2) Paolo Bonzini
2007-02-28 18:45       ` defaults for where to merge from Alex Riesen
2007-02-28 19:56         ` Paolo Bonzini
2007-03-01  0:07           ` Alex Riesen
2007-03-01  1:25             ` Johannes Schindelin
2007-03-01  7:55               ` Alex Riesen
2007-03-01  8:02                 ` Paolo Bonzini
2007-03-01  8:10                   ` Alex Riesen
2007-03-01  8:18                     ` Junio C Hamano
2007-03-02 15:53                       ` J. Bruce Fields
2007-03-01  8:29                     ` Paolo Bonzini
2007-03-01  8:33                       ` Alex Riesen
2007-03-01  8:45                         ` Paolo Bonzini
2007-03-01  8:59                           ` Alex Riesen
2007-03-01  9:37                             ` [PATCH] defaults for where to merge from (take 3) Paolo Bonzini
2007-03-01 10:12                               ` Alex Riesen
2007-03-01 10:17                                 ` Paolo Bonzini
2007-03-01 10:27                                 ` Junio C Hamano
2007-03-01 10:42                                   ` Alex Riesen
2007-03-02  4:49                                     ` Junio C Hamano
2007-03-02  9:05                                       ` Alex Riesen
2007-03-02  9:57                                         ` Junio C Hamano
2007-03-01 10:47                                   ` Alex Riesen
2007-03-01 16:33                                   ` [PATCH] defaults for where to merge from (take 3, inline) Paolo Bonzini
2007-03-01 22:01                                     ` Johannes Schindelin
2007-03-02  8:10                                       ` Paolo Bonzini
2007-03-02  8:50                                         ` [PATCH, 4th version] git-branch: register where to merge from, when branching off a remote branch Paolo Bonzini
2007-03-02  9:52                                           ` Junio C Hamano
2007-03-02  9:55                                             ` Junio C Hamano
2007-03-02 10:32                                             ` Jeff King
2007-03-02 11:15                                               ` Paolo Bonzini
2007-03-02 11:21                                                 ` Jeff King
2007-03-02 11:14                                             ` Paolo Bonzini
2007-03-02 15:54                                               ` Johannes Schindelin
2007-03-02 16:33                                                 ` Paolo Bonzini
2007-03-02 19:06                                                   ` Johannes Schindelin
2007-03-02 11:19                                         ` [PATCH] defaults for where to merge from (take 3, inline) Johannes Schindelin
2007-03-02 14:10                                       ` Jakub Narebski
2007-02-28 17:31   ` Peter Baumann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slrneubf3e.54h.siprbaum@xp.machine.xx \
    --to=siprbaum@stud.informatik.uni-erlangen.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.