Skip to content

Error on "path-rename foo:" #714

@cweiske

Description

@cweiske

I wanted to move the contents of the "OUYA-ODK" directory to the top level dir (getting rid of "OUYA-ODK" in the paths entirely), but that gives an error:

cweiske@frm:~/dev/ouya/odk-src$ git filter-repo --path-rename OUYA-ODK: --force
Schwerwiegend: Empty path component found in input
fast-import: dumping crash report to .git/fast_import_crash_201290
Traceback (most recent call last):
  File "/usr/bin/git-filter-repo", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib/python3/dist-packages/git_filter_repo.py", line 4975, in main
    filter.run()
    ~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/git_filter_repo.py", line 4894, in run
    self._parser.run(self._input, self._output)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/git_filter_repo.py", line 1527, in run
    self._parse_commit()
    ~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/git_filter_repo.py", line 1378, in _parse_commit
    self._commit_callback(commit, aux_info)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/git_filter_repo.py", line 4127, in _tweak_commit
    self._insert_into_stream(commit)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/usr/lib/python3/dist-packages/git_filter_repo.py", line 4867, in _insert_into_stream
    self._parser.insert(obj)
    ~~~~~~~~~~~~~~~~~~~^^^^^
  File "/usr/lib/python3/dist-packages/git_filter_repo.py", line 1505, in insert
    obj.dump(self._output)
    ~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/git_filter_repo.py", line 820, in dump
    change.dump(file_)
    ~~~~~~~~~~~^^^^^^^
  File "/usr/lib/python3/dist-packages/git_filter_repo.py", line 723, in dump
    file_.write(b'M %s %s %s\n' % (self.mode, self.blob_id, quoted_filename))
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [Errno 32] Broken pipe
Exception ignored in: <_io.BufferedWriter name=5>
BrokenPipeError: [Errno 32] Broken pipe

I also tried

  • --path-rename OUYA-ODK:/ (error: both have to have a trailing slash)
  • --path-rename OUYA-ODK/:/ (error: target may not begin with a slash)
  • --path-rename OUYA-ODK:. (error: invalid path component .)

After that I looked at the man page again and found that I should use --subdirectory-filter.
But I think that --rename-path foo: should not crash. It could even suggest using subdirectory-filter instead.

This happens with 2.47.0-2 (Debian 13)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions