Skip to content

Commit

Permalink
installer/portable: also install a redirector for /bin/sh.exe
Browse files Browse the repository at this point in the history
It was pointed out in git-for-windows/git#208
that SourceTree expects `/bin/sh.exe` to be available. Let's just
install the redirector to make SourceTree happy, too.

This is a companion patch to fd137f7 (installer/portable: copy
redirectors into /bin/{bash,git}.exe, 2015-06-19).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jun 21, 2015
1 parent 053dbd0 commit 2e0d868
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion installer/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ LIST="$(ARCH=$ARCH BITNESS=$BITNESS PACKAGE_VERSIONS_FILE=package-versions.txt \
sh "$SCRIPTDIR"/../make-file-list.sh)" ||
die "Could not generate file list"

printf "; List of files\n%s\n%s\n%s\n%s\n" \
printf "; List of files\n%s\n%s\n%s\n%s\n%s\n" \
"Source: \"$SCRIPTDIR\\package-versions.txt\"; DestDir: {app}\\etc; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore" \
"Source: \"$SCRIPTDIR\\usr\\share\\git\\ReleaseNotes.css\"; DestDir: {app}\\usr\\share\\git; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore" \
"Source: \"cmd\\git.exe\"; DestDir: {app}\\bin; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore" \
"Source: \"mingw$BITNESS\\share\\git\\compat-bash.exe\"; DestName: bash.exe; DestDir: {app}\\bin; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore" \
"Source: \"mingw$BITNESS\\share\\git\\compat-bash.exe\"; DestName: sh.exe; DestDir: {app}\\bin; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore" \
>file-list.iss ||
die "Could not write to file-list.iss"

Expand Down
3 changes: 2 additions & 1 deletion portable/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ mkdir -p "$SCRIPT_PATH/root/bin" ||
die "Could not make bin/ directory"

cp /cmd/git.exe "$SCRIPT_PATH/root/bin/git.exe" &&
cp /mingw$BITNESS/share/git/compat-bash.exe "$SCRIPT_PATH/root/bin/bash.exe" ||
cp /mingw$BITNESS/share/git/compat-bash.exe "$SCRIPT_PATH/root/bin/bash.exe" &&
cp /mingw$BITNESS/share/git/compat-bash.exe "$SCRIPT_PATH/root/bin/sh.exe" ||
die "Could not install bin/ redirectors"

# Make a list of files to include
Expand Down

6 comments on commit 2e0d868

@csware
Copy link

@csware csware commented on 2e0d868 Jun 23, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it harder for TortoiseGit to find the usr/bin directory.

@dscho
Copy link
Member Author

@dscho dscho commented on 2e0d868 Jun 23, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should it need to find the usr\bin directory if it finds the bin directory already?

@csware
Copy link

@csware csware commented on 2e0d868 Jun 23, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usr/bin directory needs to be on the path for (libgit2) hooks. (The wrapper automatically puts the usr/bin directory on the path, but libgit2 doesn't use the git.exe wrapper)

@dscho
Copy link
Member Author

@dscho dscho commented on 2e0d868 Jun 23, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. But why not simply test for mingw64\bin\git.exe, then for mingw32\bin\git.exe, then bin\git.exe?

@csware
Copy link

@csware csware commented on 2e0d868 Jun 23, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because for normal operations we need to use the wrapper ;) Only for the hooks, which are not executed by git.exe but libgit2 we need to have the path set up as the wrapper does (i.e., usr\bin needs to be on the path for the case people call these files in their hooks, like openssl)...

@dscho
Copy link
Member Author

@dscho dscho commented on 2e0d868 Jun 23, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... so why not add bin;usr\bin;mingw64\bin;mingw32\bin to the PATH and be done with it? 😺

Please sign in to comment.