Re: [PATCH] branch: optionally setup branch.*.merge from upstream local branches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Feb 18, 2008 7:14 AM, Johannes Schindelin <Johannes.Schindelin@xxxxxx> 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.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux