Skip to content

--end-of-options marker

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3revision: allow --end-of-options to end option parsingrevision.c t/t6000-rev-list-misc.sh+15 -10 replies
2/3parse-options: allow --end-of-options as a synonym for "--"parse-options.c t/t0040-parse-options.sh t/t4202-log.sh+16 -10 replies
3/3gitcli: document --end-of-optionsDocumentation/gitcli.txt+6 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] --end-of-options marker

It's hard for scripted uses of rev-list, etc, to avoid option injection from untrusted arguments, because revision arguments must come before any "--" separator. I.e.:

git rev-list "$revision" -- "$path"

might mistake "$revision" for an option (with rev-list, that would make it an error, but something like git-log would default to HEAD).

This series provides an alternative to "--" to stop option parsing without indicating that further arguments are pathspecs.

  [1/3]: revision: allow --end-of-options to end option parsing
  [2/3]: parse-options: allow --end-of-options as a synonym for "--"
  [3/3]: gitcli: document --end-of-options
 Documentation/gitcli.txt | 6 ++++++
 parse-options.c          | 3 ++-
 revision.c               | 8 +++++++-
 t/t0040-parse-options.sh | 7 +++++++
 t/t4202-log.sh           | 7 +++++++
 t/t6000-rev-list-misc.sh | 8 ++++++++
 6 files changed, 37 insertions(+), 2 deletions(-)