git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 6 in “Support specific color for a specific remote branches”
  1. Support specific color for a specific remote branchesAviv Eyal, Aug 8, 2011
  2. Junio C HamanoAug 8, 2011
  3. Jeff KingAug 8, 2011
  4. Junio C HamanoAug 8, 2011
  5. Jeff KingAug 10, 2011
  6. Aviv EyalAug 9, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.