Re: [PATCH 2/2] builtin/symbolic-ref.c: add option to output shortened ref
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 27, 2012, 22:28 UTC
- Message-ID
- <7vwr7752s8.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1330380638-9738-1-git-send-email-jk@jk.gs>
Jan Krüger <jk@jk.gs> writes:
> In scripts meant to generate user-consumable output, it can be helpful > to resolve a symbolic ref and output the result in a shortened form, > such as for use in shell prompts. Add a new -s option to allow this.
I think this one (unlike 1/2) makes sense, but a single letter -s feels a bit too vague. Always spelling in long option "--short" so that it matches "%(refname:short)" in for-each-ref might be better, I would think.
Especially given that the expected use case is primarily in scripts not from the command line, being more explicit and easier to read has value over being short and easier to (mis)type.