git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Steven Penny <svnpenn@gmail.com>
To: git@vger.kernel.org
Subject: Change Native Windows shell
Date: Thu, 4 Jun 2020 18:33:16 -0500	[thread overview]
Message-ID: <CAAXzdLXt4+-34+OhS=Jn=-VeORN3Y2jMzzg9+bhyn88aN4hm0A@mail.gmail.com> (raw)

The Git pager is set up by the function `setup_pager` [1]. `setup_pager` calls
`prepare_pager_args` [2]. `prepare_pager_args` sets `use_shell` [3]. Then
`setup_pager` calls `start_command` [4]. Then, since `use_shell` has been
defined, `prepare_shell_cmd` is called [5]. Finally, regardless of operating
system, `sh` is called [6]:

    #ifndef GIT_WINDOWS_NATIVE
                    argv_array_push(out, SHELL_PATH);
    #else
                    argv_array_push(out, "sh");
    #endif
                    argv_array_push(out, "-c");

The issue is, that it is possible to build a fully static native Windows
Git [7]. A Git like this can run on a stock Windows system, with no requirement
on MSYS2 or Cygwin. So it doesnt make sense for Git to be calling `sh`, when a
user may not have or need `sh` on their system. I think that on Native Windows
builds, that the Pager should be called directly, or if a shell must be used,
then make it `cmd.exe` or `powershell.exe`.

1. https://github.com/git/git/blob/20514004/pager.c#L106
2. https://github.com/git/git/blob/20514004/pager.c#L127
3. https://github.com/git/git/blob/20514004/pager.c#L101
4. https://github.com/git/git/blob/20514004/pager.c#L130
5. https://github.com/git/git/blob/20514004/run-command.c#L928
6. https://github.com/git/git/blob/20514004/run-command.c#L272-L277
7. https://github.com/nu8/gulf/blob/e9ea5c0b/chapter-2/program.sh

             reply	other threads:[~2020-06-04 23:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 23:33 Steven Penny [this message]
2020-06-05  0:00 ` Change Native Windows shell brian m. carlson
2020-06-05  4:21   ` Steven Penny
2020-06-05  4:39     ` Jonathan Nieder
2020-06-08 17:39     ` Johannes Schindelin
2020-06-08 23:14       ` Steven Penny
2020-06-09  6:12         ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAXzdLXt4+-34+OhS=Jn=-VeORN3Y2jMzzg9+bhyn88aN4hm0A@mail.gmail.com' \
    --to=svnpenn@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).