Jon Seymour <jon.seymour@xxxxxxxxx> writes: > The documentation for git rev-parse --flags currently states: > > Do not output non-flag parameters. > > Therefore, one might expect: > $ git rev-parse --flags HEAD > > to produce no output. > > In fact, it outputs the sha1 hash of HEAD. Perhaps you are missing --no-revs. Linus wrote rev-parse to implement this in a shell script: git log [other-options-and-args] [revision-traversal-options-and-args] which needs to be transformed to: git rev-list [revision-traversal-options-and-args] | git diff-tree --stdin [other-options-and-args] so that it can parse "-p HEAD" with and without "--no-revs" to produce "HEAD" and "-p" respectively. It does so by knowing options that are relevant to rev-list invocation (shown by default, or --revs-only) and everything else (hidden when --no-revs is given). "--flags" is an afterthought that filters out non-flags in other parts; I do not think it applied to the "rev" part (i.e. giving --no-revs at the same time would be a valid workaround if you know you do not want HEAD or any revision traversal argument) in any released version of git. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html