Re: [PATCH v4 5/5] fetch: reduce duplicate in ref update status lines with placeholder
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 27, 2016, 05:42 UTC
- Message-ID
- <CACsJy8Cq8Jp1yNWS-oBoZNTKqqsSZMM==Y3y1feXdutWSizo9w@mail.gmail.com>
- In-Reply-To
- <CAPig+cT=BAuAbEmS5G1v2yGNczA+-WvW0bBZz_hrLcYi0bpO4g@mail.gmail.com>
On Mon, Jun 27, 2016 at 6:33 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 18 quoted lines
> On Sun, Jun 26, 2016 at 1:58 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote: >> In the "remote -> local" line, if either ref is a substring of the >> other, the common part in the other string is replaced with "$". For >> example >> >> abc -> origin/abc >> refs/pull/123/head -> pull/123 >> >> become >> >> abc -> origin/$ >> refs/$/head -> pull/123 > > Bikeshedding... > > I think I recall in an earlier iteration that you asked for opinions > about '$', but don't recall if there were responses. Have you > considered '*' rather than '$'?
I did. But I remembered that * is used as wildcard in refspec, which is specified on both sides, e.g. refs/heads/*:refs/remotes/foo/* and wondered if it could cause a little confusion when the user sees '*' only on one side here. But I have no strong opinion on '$' or '*' or any other character. So if nobody says anything else, the next re-roll will go with '*'.
> In my brain, at least, '$' is associated so strongly with regex that > "origin/$" is interpreted automatically as anchoring "origin/" at the > end of string, and "refs/$/head" just feels weird.
On the other hand, '$' has been used as the variable expansion symbol in shell, tcl, perl and php (which are probably the same thing since I have a feeling all of them borrow '$' from one source, probably shell). But yeah, '$' at the end could remind people of regexp too.
> On the other hand, given the familiarity of shell globbing, "origin/*" > and "refs/*/head" feel quite natural and intuitive.
-- Duy