Re: [PATCH] builtin-branch: highlight current remote branches with an asterisk

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

 



Mark Burton <markb@xxxxxxxxxx> writes:

> Johannes Schindelin <Johannes.Schindelin@xxxxxx> wrote:
>> Let's hope that nobody's scripts rely on a single star in front of the 
>> local HEAD...
>
> I don't know if I have any scripts that rely on a single star in front of
> the local HEAD or not (I'm sure some people must have them), but I do
> think this new feature would be very confusing, especially when used
> with -a.

People use "git branch | sed -ne 's/^\* //p' in their scripts (you can say
"against recommendation" but I think it is a sign that the recommendation
against use of Porcelain in the scripts is not loud enough).  I do not
think anybody greps in "git branch -a", though, for that purpose.

The current "branch -a" output is a mess.  It omits "remotes/" even though
it includes the local ones in the output.  Perhaps with remotes/, the
output may become a bit more readable:

    $ git branch -a
    * master
      next
      pu
    * remotes/dscho/master
    * remotes/origin/master
      remotes/origin/next
      remotes/origin/pu
    * remotes/spearce/master

which may still be too loud with asterisks, but at least there is no
confusion.  Or perhaps like this:

    $ git branch -a
    * master
      next
      pu
      remotes/dscho/HEAD -> master
      remotes/dscho/master
      remotes/origin/HEAD -> master
      remotes/origin/master
      remotes/origin/next
      remotes/origin/pu
      remotes/spearce/HEAD -> master
      remotes/spearce/master

with an obvious twist when there is no mixed output:

    $ git branch -r
      dscho/HEAD -> master
      dscho/master
      origin/HEAD -> master
      origin/master
      origin/next
      origin/pu
      spearce/HEAD -> master
      spearce/master
--
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