Skip to content

passing git args to filter output failed? #1097

Description

@butterl

Is it possiable to passing args like refs/tags/TAG01 ..HEAD --no-merges to filter the out put commit ?

repo = Repo(path)
for commit in repo.iter_commits(rev='refs/tags/TAG1.0..HEAD --no-merges'))
    print(commit)

the error show like this

  File "/home/ubuntu/.local/lib/python3.8/site-packages/git/objects/commit.py", line 277, in _iter_from_process_or_stream
    finalize_process(proc_or_stream)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/git/util.py", line 329, in finalize_process
    proc.wait(**kwargs)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/git/cmd.py", line 408, in wait
    raise GitCommandError(self.args, status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git rev-list refs/tags/TAG01..HEAD --no-merges --
  stderr: 'fatal: bad revision 'refs/tags/TAG01..HEAD --no-merges'

the cmd git rev-list refs/tags/TAG01..HEAD --no-merges -- seems work fine in cmdline run

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions