Re: [PATCHv2 03/10] refs.c: Refactor code for mapping between shorthand names and full refnames
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 14, 2013, 17:50 UTC
- Message-ID
- <7vobcdjvsh.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CALKQrgcDBMPeXPzTnpGyeosipR6Ln_zLh4Q_i1A7-eFUnTnBcA@mail.gmail.com>
Johan Herland <johan@herland.net> writes:
> I think I like "refs/peers/%1/heads/%*" better than > "refs/peers/%1/heads/%2", since the latter sort of makes me wonder > whether the 3rd, 4th, etc. components would be discarded.
Makes sense.
> I am not sure why we would want "refs/remotes/%1/%2" instead of > "refs/remote/%*".
The former way makes it easier to see what "refs/peers/%1/heads/%2" means, I think, but otherwise aren't they equivalent? I do not see a strong reason to favor one over the other.
> remote-tracking branch "baz" from remote "foo/bar", but we might say > that's ok, because (a) multi-level remote names are so rare, and (b) > the simple workaround of explicitly saying > "refs/peers/foo/bar/heads/baz" would always be available in any case.
Sounds sensible.
And if you limit things that way, "%1" again starts to make sense, as you are representing "the first path component" with it.