From: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: Default remote branch for local branch
Date: Mon, 3 Apr 2006 15:57:35 +0200 [thread overview]
Message-ID: <200604031557.35660.Josef.Weidendorfer@gmx.de> (raw)
In-Reply-To: <7vr74ff4oy.fsf@assigned-by-dhcp.cox.net>
On Monday 03 April 2006 10:23, Junio C Hamano wrote:
> Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:
>
> > On Sunday 02 April 2006 23:40, you wrote:
> >> > Let me try to understand this: the general idea is that
> >> >
> >> > pull.origin = [<refspec> of] <remote> for <branch>
> >> >
> >> > specifies the default action of git-pull if we are on <branch>, ie.
> >> > a "git pull" then runs "git pull <remote> [<refspec>]".
> >>
> >> Not quite.
> >>
> >> It will be (if this were a serious proposal -- I am not
> >> absolutely convinced this is a good idea) more like "git fetch
> >> <remote>" followed by "git-merge HEAD the-refspec-named-there".
> >
> > So it is not really a <refspec>, but a <localbranch> which has to
> > appear in the .git/remotes file on the right side of a refspec on
> > a Pull line.
>
> No, I meant <refspec> not <localbranch> here, because I do not
> want to force people to have tracking local branch.
Oh, ok. I just had to look up the manual regarding refspecs when
pulling/fetching again: "<ref>" is the same as "<ref>:" and does
not create/use any local branch.
> > All I wanted to remark is, that, with
> >
> > URL: <remote-URL>
> > Pull: refs/head/master:refs/head/remote1
> > Pull: refs/head/other:refs/head/remote2
> >
> > the config
> >
> > pull.origin = <remote> for refs/head/my-devel-for-remote2
> >
> > which does not use the [<refspec> of] part, always is bogus:
> > We get remote1 merged into my-devel-for-remote2 on a git-pull,
> > which is not what we want.
>
> I think we are on the same page, if you just think of not having
> [<refspec> of] a short-hand for naming the first Pull: line.
Yes, I understand this. But I do not think that such an optional
shortcut is useful for config files entries. It complicates parsing/editors,
and seems to make it more confusing. Despite, I agree that such optional
shortcuts are nice for porcelain command lines.
As I see the use of "<refspec> of <remote>", I still think that specifying
a local branch is useful, too. So what about
pull.origin = (<refspec> of <remote> | <localbranch>) for <branch>
instead? We can distinguish the two cases by looking for the "of".
When the <refspec> is of the form <src>:<dst> (where <dst> is the local
branch), we probably want to sanity check against .git/remotes/.
> > Optionally, branching <new> off from <old> could add <new> as
> > topic branch of <old>: Thus, if you are on <old> and do git-pull,
> > you get <new> merged in.
>
> I agree with Andreas on this part.
Yup. If we want to support topic branches with defaults, we should use
another config option. And now, I am not convinced about the usefulness
of this any more.
> Not if you made the [<refspec> of] part <localbranch>. Then
> this configuration for default merge source per local branch
> feature is available only to people who are willing to use
> tracking branches.
Yes, I understand this now.
> I just wanted to mention that it would be handy to be able to
> take snapshots of tracking branch heads, but it does not really
> matter whether they are "your" local development branches or
> tracking branches. Just a nightly or on-demand
>
> d="$GIT_DIR/refs/snapshot/`date '+%Y-%m-%d'`" &&
> mkdir "$GIT_DIR/refs/snapshot/$d" &&
> tar Ccf "$GIT_DIR/refs/" - heads |
> tar Cxf "$d"
Wow. For this, versioning of the /refs directory as subproject
would be good ;-)
Josef
next prev parent reply other threads:[~2006-04-03 13:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-01 1:48 Default remote branch for local branch Pavel Roskin
2006-04-01 3:05 ` Junio C Hamano
2006-04-01 4:18 ` Pavel Roskin
2006-04-02 16:17 ` Josef Weidendorfer
2006-04-02 21:40 ` Junio C Hamano
2006-04-02 23:28 ` Josef Weidendorfer
2006-04-03 7:56 ` Andreas Ericsson
2006-04-03 9:38 ` Josef Weidendorfer
2006-04-03 10:03 ` Andreas Ericsson
2006-04-03 8:23 ` Junio C Hamano
2006-04-03 13:57 ` Josef Weidendorfer [this message]
2006-04-14 16:16 ` Petr Baudis
2006-04-14 18:26 ` Josef Weidendorfer
2006-04-01 5:38 ` Jakub Narebski
2006-04-01 19:57 ` Jakub Narebski
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=200604031557.35660.Josef.Weidendorfer@gmx.de \
--to=josef.weidendorfer@gmx.de \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox