I happened to be looking at these yesterday and got annoyed by the tangled logic. No bug-fixes, but the result is less repetitive and has fewer magic numbers. [1/3]: rev-parse: use skip_prefix when parsing options [2/3]: rev-parse: add helper for parsing "--foo/--foo=" [3/3]: rev-parse: simplify parsing of ref options builtin/rev-parse.c | 109 +++++++++++++++++++++++++++------------------------- 1 file changed, 57 insertions(+), 52 deletions(-) -Peff