twisted / towncrier

Manage the release notes for your project.

Home Page:https://towncrier.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

issue using check compare-with

aviramha opened this issue · comments

Seems it's adding ... for some reason?
Happens in our CI:

towncrier check --compare-with main

  shell: /usr/bin/bash -e {0}
  env:
    CARGO_NET_GIT_FETCH_WITH_CLI: true
    MIRRORD_TELEMETRY: false
git produced output while failing:
fatal: ambiguous argument 'main...': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Traceback (most recent call last):
  File "/home/runner/.local/bin/towncrier", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python[3](https://github.com/metalbear-co/mirrord/actions/runs/5953502188/job/16147902980?pr=1845#step:4:3)/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 75[4](https://github.com/metalbear-co/mirrord/actions/runs/5953502188/job/16147902980?pr=1845#step:4:4), in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/towncrier/check.py", line 64, in _main
    __main(compare_with, directory, config)
  File "/home/runner/.local/lib/python3.10/site-packages/towncrier/check.py", line 82, in __main
    files_changed = list_changed_files_compared_to_branch(
  File "/home/runner/.local/lib/python3.10/site-packages/towncrier/_git.py", line 31, in list_changed_files_compared_to_branch
    output = check_output(
  File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line [5](https://github.com/metalbear-co/mirrord/actions/runs/5953502188/job/16147902980?pr=1845#step:4:5)2[6](https://github.com/metalbear-co/mirrord/actions/runs/5953502188/job/16147902980?pr=1845#step:4:6), in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'diff', '--name-only', 'main...']' returned non-zero exit status 12[8](https://github.com/metalbear-co/mirrord/actions/runs/5953502188/job/16147902980?pr=1845#step:4:9).

Hi. Thanks for the report.

Does your CI local repo contain the main branch?
Also, does your local repo contain the full branch history in order to compare branches?

https://github.com/twisted/twisted/pull/11917/files#diff-245392b692a50c38ecab4381b118862db514035c10983f3bd4f4b7f1f4be4692L277

Can you share your CI yaml file ?

cheers

Thanks for the help! I assumed partial history is ok. wanted to reduce fetch time :
metalbear-co/mirrord@3c51e80 (#1845)

If you run on GitHub hardware, checkout should be super fast.
And I think that when fetch history is 0, the checkout will also automatically fetch all the extra branches

here it automatically fetches all the branches https://github.com/metalbear-co/mirrord/actions/runs/5954366089/job/16150754068?pr=1845#step:2:547