2

Continued to my previous question, I need to use git filter-repo in order to modify the Author name and Comitter name of some of the commits recorded in my repository's log .But I have some troubles about this.

The problem

I have a file named my-mailmap in the directory of my local repository, which is formatted

CorrectName <correct@email.com> <old@email.com>

  • CorrectName is the new name with which I want to replace the name recorded in log
  • correct@email.com is the new email with which I want to replace the old email recorded in log
  • old@email.com is the old email recorded in log

Then, I opened cmd and implemented the command:

git filter-repo --mailmap my-mailmap

And the result is

Cannot read my-mailmap

What is happening? I couldn't find any report of this error message.

Maybe I have some mistakes in syntax of mailmap and I'm trying to find them. I would appreciate if you give me any information.

Other informations

I installed Python and git-filter-repo using Scoop as shown here in my Windows 10 PC.

somia
  • 193
  • 10

1 Answers1

1

I solved the problem on my own.

The problem was that I was just working on a wrong directory which has no my-mailmap file.

I was confused with re-creating a couple of clone copies of the repository for trial and error. After I changed the correct directory and tried the command again, it succeeded.

I'm sorry.

somia
  • 193
  • 10
  • I was about to say that: look at the source: https://github.com/newren/git-filter-repo/blob/aaf1c3375210a9e256ff99b7b340ca7ecac6f72b/git-filter-repo#L285-L286. It means the file is not readable/accessible. – VonC Mar 15 '21 at 08:33
  • I'm sorry. The problem was solved and it was just my stupid mistake. But I'm sure your advice to look into the manual of `git-filter-repo` would help me a lot using it. Thank you for taking time for my question. – somia Mar 15 '21 at 08:43
  • I have the same issue, I did see in the source that the system can't find it (`if not os.access(filename, os.R_OK): raise SystemExit(_("Cannot read %s") % decode(filename))`), but I still cannot figure out what's wrong. I'm in a freshly cloned repo, have the .mailmap file in the root of that repo, where I am as well, and it still can't read it. Tried with sudo, changing the access rights on .mailmap, changing the file name, trying with just "--use-mailmap" - no luck. Interesting, when going with "--use-mailmap", it also gives a trace of an error, but still fails in the same line. – userfuser Jun 16 '22 at 08:07