Re: [PATCH] Support specific color for a specific remote branches
- From
Jeff King <peff@peff.net>
- Date
- Aug 8, 2011, 20:52 UTC
- Message-ID
- <20110808205214.GG18294@sigill.intra.peff.net>
- In-Reply-To
- <7v8vr3zsh1.fsf@alter.siamese.dyndns.org>
On Mon, Aug 08, 2011 at 11:08:26AM -0700, Junio C Hamano wrote:
Show 20 quoted lines
> > + return 0;
> > +}
> > +
> > +static char *git_branch_get_custom_color_remote(const char *name)
> > +{
> > + int name_len;
> > + char* repo_name;
> > + struct string_list_item *custom;
> > + name_len = strchr(name, '/') - name;
>
> Who said a remote name is terminated with (and cannot contain) a slash?
>
> Shouldn't this code be consulting the configuration file to learn the
> remote mapping, e.g.
>
> [remote "frotz"]
> fetch = +refs/heads/*:refs/remotes/nitfol/*
>
> so that remote branches from "frotz" remote, that happen to be stored
> under refs/remotes/nitfol/ hierarchy, are painted in the correct color?This seems related to the recent thread about showing branches only for a specific remote:
http://article.gmane.org/gmane.comp.version-control.git/178668
Maybe the two should share code.
Right now, "git branch -r" means "show everything under refs/remotes instead of refs/heads". This would be easy to implement if it instead meant "show all refs created by the RHS of a fetch refspec in a configured remote". The two are equivalent in the default config, but the latter may make more sense in a complex case.
-Peff