On 2021-07-08 at 15:03:16, Jiang Xin wrote: > From: Jiang Xin > > Options and revisions can be seperated by the option "--end-of-options" > by introducing commit 19e8789b23 (revision: allow --end-of-options to > end option parsing, 2019-08-06). The following command will show > revisions which have changes on file "bar" on a branch named "--foo": > > git rev-list --oneline --end-of-options --foo -- bar > > If we want to see revisions between two revisions (rev1 and rev2), we > can use the following command: > > git rev-list --oneline --end-of-options rev1..rev2 -- > > We know that "rev1..rev2" is a shorthand for "rev2 --not rev1", but > we can not use the longer expression with option "--not" after the > "--end-of-options" option. This is because the parser will not consume > revision pseudo options after seeing "--end-of-option". > > Allow parsing revision pseudo options after "--end-of-options", the > following command is valid: > > git rev-list --oneline --end-of-options rev2 --not rev2 -- I don't think we want to do this. The goal of --end-of-options is to prevent parsing all future items as options, so if someone specifies a revision starting with a dash, we don't end up with it being interpreted as an option. Removing this constraint could end up resulting in potential security issues, which this option was introduced to protect against. If you want to specify this form, you can write this: git rev-list --oneline refs/heads/rev2 --not refs/heads/rev1 -- brian m. carlson (he/him or they/them) Toronto, Ontario, CA