git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jay Soffian" <jaysoffian@gmail.com>
To: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH] branch: optionally setup branch.*.merge from upstream local branches
Date: Mon, 18 Feb 2008 07:40:45 -0500	[thread overview]
Message-ID: <76718490802180440o3041b1ffh4764199e2aeaa52b@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.1.00.0802181209210.30505@racer.site>

On Feb 18, 2008 7:14 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

> On Mon, 18 Feb 2008, Jay Soffian wrote:
>
> > +enum branch_track {
> > +     BRANCH_TRACK_FALSE = 0,
> > +     BRANCH_TRACK_TRUE = 1,
>
> BRANCH_TRACK_REMOTES would be a better name here.  And you do not need the
> "= 1" and "= 2".

I was just following along. Plenty of enum examples in the current code
do this. Am I missing something subtle about when assigning explicit
values should be done?

> >
> > -static int branch_track = 1;
> > +static enum branch_track branch_track = BRANCH_TRACK_FALSE;
>
> That is a clear regression.

Perhaps. It's consistent with builtin-checkout.c though (which was
initializing it to 0). Who to believe?

> > @@ -77,6 +77,10 @@ static int git_branch_config(const char *var, const char *value)
> >               return 0;
> >       }
> >       if (!strcmp(var, "branch.autosetupmerge")) {
> > +             if (value && !strcasecmp(value, "always")) {
> > +                     branch_track = BRANCH_TRACK_ALWAYS;
> > +                     return 0;
> > +             }
> >               branch_track = git_config_bool(var, value);
> >               return 0;
> >       }
>
> You have this in builtin-branch.c and builtin-checkout.c.  Duplicated
> code.  IMHO it is time to move this into the git_default_config() function
> (with "branch_track" being renamed to "git_branch_track", and moved to
> environment.c).

Mkay, builtin-checkout.c author didn't do it, so...

> Personally, I have no problem with typing "git merge <branch>" in your
> workflow.  I would even avoid saying "git pull" for obviously-local
> branches, because I would have forgotten which branch it tracked
> originally.

Um, well, apply this patch, set branch.autosetupmerge=always and then
branch.*.merge will tell you which branch it tracked originally. :-)

Aside, then how do you figure out the upstream branch is if you've
forgotten?

j.

  reply	other threads:[~2008-02-18 12:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-18 12:04 [PATCH] branch: optionally setup branch.*.merge from upstream local branches Jay Soffian
2008-02-18 12:14 ` Johannes Schindelin
2008-02-18 12:40   ` Jay Soffian [this message]
2008-02-18 13:24     ` Johannes Schindelin
  -- strict thread matches above, loose matches on Subject: below --
2008-02-18 13:24 Jay Soffian
2008-02-18 13:29 ` Johannes Schindelin
2008-02-18 19:00   ` Mike Hommey
2008-02-18 13:53 Jay Soffian
2008-02-18 14:05 ` Johannes Schindelin
2008-02-18 14:38   ` Jay Soffian
2008-02-18 18:47 ` Johannes Schindelin
2008-02-18 20:59 ` Junio C Hamano
2008-02-19  2:07 Jay Soffian
2008-02-19  2:19 ` Jay Soffian
2008-02-19 10:55   ` Johannes Schindelin
2008-02-19 13:42     ` Jay Soffian
2008-02-19 13:59     ` Jay Soffian
2008-02-19 14:01       ` Johannes Schindelin
2008-02-19  5:52 ` Junio C Hamano
2008-02-19 13:40   ` Jay Soffian
2008-02-19  7:44 ` Alex Riesen
2008-02-19 13:49   ` Jay Soffian
2008-02-19 13:53     ` Johannes Schindelin
2008-02-20  0:13     ` Alex Riesen
2008-02-20  0:48       ` Junio C Hamano
2008-02-20  0:55         ` Junio C Hamano

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=76718490802180440o3041b1ffh4764199e2aeaa52b@mail.gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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;
as well as URLs for NNTP newsgroup(s).