On Tue, Aug 27, 2019 at 1:43 AM Sergey Organov <sorganov@xxxxxxxxx> wrote: > > Eric Wong <e@xxxxxxxxx> writes: > > > [...] > > > AFAIK, filter-branch is not causing support headaches for any > > git developers today. With so many commands in git, it's > > unlikely newbies will ever get around to discover it :) > > So I think think we should be in any rush to remove it. > > Nah, discovering it is simple. Just Google for "git change author". That > eventually leads to a script that uses "git filter-branch --env-filter" > to get the job done, and I'm afraid it is spread all over the world. > > See, e.g.: > > https://help.github.com/en/articles/changing-author-info Side note: Is the goal to "fix names and email addresses in this repository"? If so, this guide fails: it doesn't update tagger names or email addresses. Indeed, filter-branch doesn't provide a way to do that. (Not to mention other problems like not updating references to commit hashes in commit messages when it busy rewriting everything.) > > But I agree that filter-branch isn't useful and certainly > > shouldn't be encouraged/promoted. > > Well, is there more suitable way to change author for a (large) set of > commits then? I would say yes, use git filter-repo (note that this thread started with me proposing filter-repo for inclusion in git.git -- and getting suggestions that we should remove stuff instead of adding more stuff). I'm biased, but I think it's much better at this particular job as well: You can create a mailmap file and pass it to the --mailmap option to git-filter-repo. Or, if you prefer (perhaps you don't like git's mailmap format as used by shortlog and now log, or perhaps you really want to be able to do regex replacement or something), you can use the --name-callback or --email-callback to work on those fields more directly. Or, if you prefer (e.g. you want to handle author vs. committer vs. tagger differently), you can use the --commit-callback and --tag-callback filters. As an added bonus, filter-repo will also perform the rewrite far faster than filter-branch (and rewrite commit hashes in commit messages as alluded to above). > > Yet there's probably still users which ARE happy with it, that > > will never hit the edge cases and problems it poses; and will > > never read release notes. And said users are probably getting > > git from a slow-moving distro, so it'd be a disservice to them > > if they lost a tool they depend on without any warning. > > Personally, I'm far from happy with it, but I have no clue how to > substitute it in the job above. Anybody? The start of this thread where I proposed git filter-repo for inclusion in git[1] had links to documentation and comparisons to other tools and such. You may find those links helpful; if not, let me know what needs to be fixed in the documentation. Elijah [1] https://public-inbox.org/git/CABPp-BEr8LVM+yWTbi76hAq7Moe1hyp2xqxXfgVV4_teh_9skA@xxxxxxxxxxxxxx/