Skip to content

Improve HOMEDRIVE/HOMEPATH configuration. #764

@kwah-gh

Description

@kwah-gh

Setup

Git-2.8.3-64-bit.exe

$git version
git version 2.8.3.windows.1

64-bit Windows 7 SP1

Defaults used upon setup (only destination folder is different).

Environment settings on our company PCs are such that %HOMEDRIVE%%HOMEPATH% points to shared Linux user home.

Details

After setting up newer version of Git for Windows (previously used Git-1.9.5-preview20150319.exe) see the following:

Upon start of Git Bash it looks like it does not process correctly Git for Win configuration files.

I recon it discovers profile/bash config files in %HOMEDRIVE%%HOMEPATH% (in a shared Linux home as mentioned in the previous section) and proper bash configuration on local system is never picked up. This results in all convenience features gone:

  • No colors in terminal
  • No command helpers
  • No branch in command line prompt
  • ...

Workaround

In Git4Win setup destination /etc/profile we add (just before # Define default printer" line):

# Fix [start]: do not use $HOMEDRIVE$HOMEPATH as HOME
if [ -z "$USERNAME" ]; then
  LOGNAME="`id -un`"
else
  LOGNAME="$USERNAME"
fi
HOME="/home/$LOGNAME"
# Fix [end]

We had to use similar workaround in Git-1.9.5-preview20150319

Question

Is it possible to have structural out of the box solution, which will take into account aforementioned use case? Namely, detect HOMEDRIVE + HOMEPATH pointing to location with profile/shell configuration files out of Git4Win setup tree and make use of Git4Win configuration instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions