Re: [RFC] Porting builtin/branch.c to use the printing options of ref-filter.{c,h}

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

 



Karthik Nayak <karthik.188@xxxxxxxxx> writes:

> It's more than just colors. The whole format changes.
>
> $ git branch -a
> For local:
> "%(if)%(HEAD)%(then)%(HEAD) %(color:green)%(refname:short)%(else)
> %(refname:short)%(end)"
> For remote:
> "  remotes/%(color:red)%(refname:short)%(color:reset)%(if)%(symref)%(then)
> -> %(symref:short)%(end)"

I think both versions are not so different. You have %(if) on one format
strings that would be disabled by construction on the second. For
example, adding %(if)%(HEAD)%(then)%(HEAD) at the start of the
format-string for remotes would be a no-op, right?

And in case a local branch is a symref, "git branch" displays "-> ..."
both for local and for remotes. You just normally don't have local
symref branches other than HEAD, but I tried:

$ git checkout -b branch
$ cat .git/HEAD > .git/refs/heads/symref
$ git branch -a
* branch
  master
  symref -> branch

The only remaining difference I see are the "remotes/" prefix and
colors.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
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]