Re: [PATCH v4 15/16] branch: use ref-filter printing APIs
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Apr 14, 2016, 19:17 UTC
- Message-ID
- <CAOLa=ZR7rKETM2b34B2Whw7Au-t7iFEkcNAB4ZygeQM=9Lp9zQ@mail.gmail.com>
- In-Reply-To
- <20160413220559.GC8712@sigill.intra.peff.net>
On Thu, Apr 14, 2016 at 3:35 AM, Jeff King <peff@peff.net> wrote:
Show 10 quoted lines
> > The cross-prefix behavior I put into the test is not something I feel > strongly about; it was mostly just restoring the earlier behavior. I do > think shortening everything is fine, too, as long as there's some way to > get the fully qualified ref. E.g., if `git branch` shows %(symref:short) > or %(symref:strip=2), by default, but you can ask for just %(symref) if > you want (which I think is how you have it implemented now, though I > notice that symrefs don't get nearly as many formatting options as > things like %(upstream)). >
That does make sense, I guess then I'll stick to shortening all symref's by default and allowing the user to change this if needed via the '--format' option.
About %(symref) not getting enough formatting options, I don't see anything else in %(upstream) which would be required in %(symref), maybe the 'strip=X' option could be added. But for now I see 'short' to be the only needed option. If anyone feels that something else would be useful, I'd be glad to add it along.
Show 6 quoted lines
> If anyone is machine-parsing git-branch output in the first place, they > are Doing It Wrong. And doubly so if they are relying on some obscure > shortening rules that I don't think were ever carefully designed. So I > think we should be free to change it here to what serves users best. > > -Peff
This is a good reason, since 'git branch' is a porcelain command a change like this shouldn't be a problem.
Junio, I'll re-roll with a small fix to the test written by Jeff soon.
-- Regards, Karthik Nayak