Skip to content

Adapt Perl commands to upcoming changes in MSYS2? Or drop Perl from Git for Windows? #5393

Open
1 of 1 issue completed

Description

@dscho

As I documented in msys2/MSYS2-packages#5177 (comment), Perl will soon be reporting cygwin instead of msys when asking $^O for the operating system, and Git for Windows will have to adjust a couple of lines:

Git for Windows' installers already skip cvsexportcommit (among other remote helpers targeting the long-forgotten source code management tools CVS and Arch, remote helpers that upstream Git continues to carry probably only for the sole reason that it would take work to remove them, especially the tedious sort of work that is convincing the core Git developers on the Git mailing list, where even one single person using a feature might well prevent said feature from being deprecated as long as said user is a big name in the Linux world). Therefore my current thinking is that dropping cvsexportcommit (along with the rest of the CVS/Arch stuff) from Git for Windows is a better course of action than actually patching the code.

Likewise, gitweb is excluded from Git for Windows for a long time already: git-for-windows/build-extra@c20f0d6 excluded it, i.e. v2.19.0.

As for git svn: This serves as a fine opportunity to drop git svn support from Git for Windows in favor of redirecting existing users to MSYS2 (after we made sure that this is a viable option).

While we're already on the train of thought to deprecate parts of Git for Windows that require a lot of work for little gain, let's also have a long and hard look at Perl itself. The last two major version upgrades of Perl required me to spend quite a lot of time, and the most recent one failed somewhere, forcing me to postpone the upgrade, with Perl v5.40.1 swooping in before I could even take a look at the problems with v5.40.0. I am spending even more time upgrading MSYS2's own perl package to v5.42.1 after "unshadowing" Git for Windows' own copy of the perl package.

Therefore, I could imagine that a bold (and potentially correct) move would be to replace docx2txt with a trivial non-scripted version and also drop support for git send-email from Git for Windows, which would allow Git for Windows to stop shipping (and thus, building) Perl altogether. We would then redirect existing users to use regular MSYS2 with mingw-w64-git-send-email instead, similar to how we already redirected git svn users that way.

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. PhilipOakley commented on Feb 4, 2025

    @PhilipOakley

    I could imagine that a bold (and potentially correct) move would be to also drop support for git send-email from Git for Windows, which would allow Git for Windows to stop shipping (and thus, building) Perl altogether:

    I appreciate I haven't contributed for a while, but I did (and hopefully will) use git send-email (and git format-patch) to contribute to the Git List. What other convenience methods would be recommended if Perl was dropped?

    I can see the maintenance benefit of dropping all that other clutter but, as noted, ..

    upstream Git continues to carry probably only for the sole reason that it would take work to remove them, especially the tedious sort of work that is convincing the core Git developers on the Git mailing list, where even one single person using a feature might well prevent said feature from being deprecated..

    git send-email being that usage for me 😃 .

  2. dscho commented on Feb 4, 2025

    @dscho
    MemberAuthor

    I did (and hopefully will) use git send-email

    Is there a Perl version you can easily download? You'd likely have to put in some effort to make Git.pm/git-send-email.perl truly cross-platform, as there are most likely "All The World Looks Like Unix" assumptions baked in all over the place, if I know Git's source code well.

    Or maybe you can switch to using regular MSYS2 (I do hope that we're already in a place that is relatively close to MSYS2 being able to consume mingw-w64-git updates from Git for Windows, and if you promise not to bother me with any problems but resolve them yourself, I even encourage you to download and install the Pacman packages from the git-artifacts run's pkg-x86_64 artifacts).

    What other convenience methods would be recommended if Perl was dropped?

    GitGitGadget. Although I have to admit that that project probably needs more engagement from the community, especially development-wise, if it is to be viable for the long term.

    even one single person using a feature might well prevent said feature from being deprecated..

    git send-email being that usage for me 😃 .

    I hate to be the one to tell you @PhilipOakley, but you're not a big name in the Linux world, and therefore they wouldn't keep the tool around just for you.

    As it were, though, git send-email is used heavily by the core Git developers (kind of required, really, due to their choice of running a project without proper project management tools and instead doing everything on a mailing list, including code patch review). So there is no need to fear git send-email losing support in the Git project.

    As for Git for Windows, that's a different story. I am totally willing to abandon support for that if that is the only tool requiring a full Perl and then some modules.

  3. becm commented on Feb 21, 2025

    @becm

    Removal of Perl will also impact/kill docx2txt and git request-pull functionality.

    • usr/bin/docx2txt is a compact wrapper for docx2txt.pl and
    • mingw64/libexec/git-core/git-request-pull has hidden inline Perl code and call to apply some filter.

    There is also a direct reference to docx2txt.pl in usr/bin/astextplain which needs to then be removed.

  4. dscho commented on Feb 21, 2025

    @dscho
    MemberAuthor
    • usr/bin/docx2txt is a compact wrapper for docx2txt.pl and

    Yup, that has been mentioned here already. We'll either need to drop it, or find an alternative, or rewrite it (which shouldn't be all that hard).

    • mingw64/libexec/git-core/git-request-pull has hidden inline Perl code and call to apply some filter.

    Good find! It sure does.

    Seeing as that command is in Git primarily for the benefit of the Linux kernel project (a lot of things seem to be in Git solely for the Linux kernel project, as if it was still a child project...), I could imagine that dropping that script at least from Git for Windows should be no big deal at all.

    In the unlikely even that this command should still be needed, those who need it could easily reimplement it in pure C.

  5. mbs-c commented on Mar 13, 2026

    @mbs-c
  6. dscho commented on Mar 13, 2026

    @dscho
    Author
  7. mbs-c commented on Mar 13, 2026

    @mbs-c
  8. dscho commented on Mar 13, 2026

    @dscho
    Author
  9. dscho commented on Mar 30, 2026

    @dscho
    MemberAuthor

    I just updated the issue description with a checklist of what would need to be done to drop Perl from Git for Windows. Basically, the two remaining items would be:

    1. Rewrite docx2txt.pl as a native .exe. It hasn't changed since 2014, is still at v1.4 from https://sourceforge.net/projects/docx2txt/, and unfortunately lacks any test suite. But I'm confident that this can be done relatively easily, by porting it with AI assistance. It's licensed under the GPLv3, which would be retained across the port. The most involved part would most likely be creating a test suite because docx2txt does not have any of that.
    2. git send-email. This is too involved to rewrite in any other language, and it really is heavy on dependencies because it needs to talk to remote mail servers with a variety of encryption/authentication schemes, all of which are implemented by Perl modules. The best idea I have so far is to redirect existing git send-email users to MSYS2 with mingw-w64-git-send-email, just like we redirect the existing git svn users away from Git for Windows already.

    Thoughts?

  10. dscho commented on Mar 31, 2026

    @dscho
    MemberAuthor
    1. Rewrite docx2txt.pl as a native .exe. It hasn't changed since 2014, is still at v1.4 from https://sourceforge.net/projects/docx2txt/, and unfortunately lacks any test suite. But I'm confident that this can be done relatively easily, by porting it with AI assistance. It's licensed under the GPLv3, which would be retained across the port. The most involved part would most likely be creating a test suite because docx2txt does not have any of that.

    Here is my attempt: https://github.com/dscho/docx2txt-rs (leaning heavily on Claude Opus 4.6 to do most of the typing).

  11. dscho commented on Apr 14, 2026

    @dscho
    MemberAuthor

    Here is my attempt: https://github.com/dscho/docx2txt-rs (leaning heavily on Claude Opus 4.6 to do most of the typing).

    So now that mingw-w64-docx2txt-rs is a thing, I looked at what is still left in Git for Windows that does use Perl.

    The command I ran to find the last users of Perl
    $ cd /c/Program\ Files/Git &&
      find -xdev -type f -exec grep -lw perl {} \; 2>&1 |
      grep -ve '\.\(adoc\|exe\|vim\|txt\|sample\|template\|html\|md\|tutor\|1\)$' -e '/\(LICENSE\|NEWS\|changelog\)$' \
        -e '^\./\(mingw64\|usr\)/\(lib\|share\)/perl5' -e '^\.\/usr/bin/core_perl'
    ./etc/docx2txt.config
    ./etc/profile.d/perlbin.csh
    ./etc/profile.d/perlbin.sh
    ./mingw64/bin/c_rehash
    ./mingw64/etc/ssl/misc/CA.pl
    ./mingw64/etc/ssl/misc/tsget
    ./mingw64/etc/ssl/misc/tsget.pl
    ./mingw64/libexec/git-core/git-instaweb
    ./mingw64/libexec/git-core/git-send-email
    ./mingw64/share/bash-completion/completions/git
    ./mingw64/share/git/completion/git-completion.bash
    ./usr/bin/c_rehash
    ./usr/bin/docx2txt
    ./usr/bin/docx2txt.pl
    ./usr/bin/msys-perl5_42.dll
    ./usr/bin/msys-svn_swig_perl-1-0.dll
    ./usr/bin/vendor_perl/binhex.pl
    ./usr/bin/vendor_perl/debinhex.pl
    ./usr/bin/vendor_perl/lwp-download
    ./usr/bin/vendor_perl/lwp-dump
    ./usr/bin/vendor_perl/lwp-mirror
    ./usr/bin/vendor_perl/lwp-request
    ./usr/share/fish/vendor_conf.d/perlbin.fish
    ./usr/share/misc/magic.mgc
    ./usr/share/nano/perl.nanorc
    ./usr/share/vim/vim92/doc/tags
    ./usr/share/vim/vim92/doc/vim2html.pl
    ./usr/share/vim/vim92/tools/efm_filter.pl
    ./usr/share/vim/vim92/tools/efm_perl.pl
    ./usr/share/vim/vim92/tools/pltags.pl
    ./usr/share/vim/vim92/tools/shtags.pl
    ./usr/ssl/misc/CA.pl
    ./usr/ssl/misc/tsget
    ./usr/ssl/misc/tsget.pl

    Let's categorize the results:

    • ./mingw64/libexec/git-core/git-send-email is the only thing I'd consider legitimately useful for Git for Windows users, and I already outlined the plan to redirect the very few git send-email users to use MSYS2 directly.

    • ./mingw64/libexec/git-core/git-instaweb is a left-over; it should have been excluded it from Git for Windows when we dropped gitweb in git-for-windows/build-extra@c20f0d6.

    • ./usr/share/misc/magic.mgc comes from the file magic file. It does not use Perl, it characterizes Perl code.

    • ./mingw64/share/bash-completion/completions/git and ./mingw64/share/git/completion/git-completion.bash are the tab-completion scripts, both of which contain the string --perl-regexp to be able to tab-complete that option; None of them actually call Perl.

    And the rest isn't much to write home about, it's basically the docx2txt thing (for which we now have a Perl-less alternative we can use), and some OpenSSL scripts that aren't really useful because they would a) require administrator privileges to write their output, and b) their output would be overwritten every time Git for Windows is updated, anyway.

    docx2txt stuff (superseded by docx2txt-rs)
    ./etc/docx2txt.config
    ./usr/bin/docx2txt
    ./usr/bin/docx2txt.pl
    
    vim/nano stuff<
    ./usr/share/nano/perl.nanorc
    ./usr/share/vim/vim92/doc/tags
    ./usr/share/vim/vim92/doc/vim2html.pl
    ./usr/share/vim/vim92/tools/efm_filter.pl
    ./usr/share/vim/vim92/tools/efm_perl.pl
    ./usr/share/vim/vim92/tools/pltags.pl
    ./usr/share/vim/vim92/tools/shtags.pl
    
    OpenSSL stuff
    ./mingw64/bin/c_rehash
    ./mingw64/etc/ssl/misc/CA.pl
    ./mingw64/etc/ssl/misc/tsget
    ./mingw64/etc/ssl/misc/tsget.pl
    ./usr/bin/c_rehash
    ./usr/ssl/misc/CA.pl
    ./usr/ssl/misc/tsget
    ./usr/ssl/misc/tsget.pl
    
    Left-over Perl/Subversion stuff (not caught by the regular expression)
    ./etc/profile.d/perlbin.csh
    ./etc/profile.d/perlbin.sh
    ./usr/bin/msys-perl5_42.dll
    ./usr/bin/msys-svn_swig_perl-1-0.dll
    ./usr/bin/vendor_perl/binhex.pl
    ./usr/bin/vendor_perl/debinhex.pl
    ./usr/bin/vendor_perl/lwp-download
    ./usr/bin/vendor_perl/lwp-dump
    ./usr/bin/vendor_perl/lwp-mirror
    ./usr/bin/vendor_perl/lwp-request
    ./usr/share/fish/vendor_conf.d/perlbin.fish
    
  12. dscho commented on Jun 5, 2026

    @dscho
    MemberAuthor

    Here is my attempt: https://github.com/dscho/docx2txt-rs (leaning heavily on Claude Opus 4.6 to do most of the typing).

    So now that mingw-w64-docx2txt-rs is a thing, I looked at what is still left in Git for Windows that does use Perl.

    And git-for-windows/build-extra#708 is my attempt to migrate to that Rust version of docx2txt.

  13. xxl007xxl1-ai commented on Jul 28, 2026

    @xxl007xxl1-ai
  14. dscho commented on Nov 5, 2026

    @dscho
    MemberAuthor

    This was done by the MSYS2 project for us: msys2/MSYS2-packages#6920

  15. dscho commented on Nov 5, 2026

    @dscho
    MemberAuthor

    This was done by the MSYS2 project for us: msys2/MSYS2-packages#6920

    This needed git-for-windows/build-extra#767 as a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions