prati0100 / git-gui

Tcl/Tk based UI for Git. I am currently acting as the project's maintainer.
160 stars 87 forks source link

missing options #58

Closed dsnz closed 3 years ago

dsnz commented 3 years ago

Hello, I'm using git-gui on Windows (right-click context menu -> Git GUI Here). After moving my git setup to a new Windows system, and configuring all git options and ensuring git (bash) works fine, I started to use git-gui but to my surprise it does not function properly in remote operations. I checked the options menu and saw that it's missing user name etc. so somehow it is not getting the whole git config parameters (the global parameters definitely) or it got them initially (in first experiments) and did not update afterwards. However when starting git-gui from bash everything is okay.

My questions

  1. are git-gui options saved somewhere and where ?
  2. does git-gui need specific environment variables set before run (my windows system is corporate with preset environment variables that I guess conflict with git setup where I have set my environment variables in bash's profile) or alternatively can I use a command line option to set where is the global git config file ? (something like GIT_GUI_HOME= ... for example)
  3. where is a documentation with all git-gui options (as seen in options menu) and command line options ?

Thank you !

prati0100 commented 3 years ago

+ @PhilipOakley, who knows more about Windows than I do.

Hello, I'm using git-gui on Windows (right-click context menu -> Git GUI Here). After moving my git setup to a new Windows system, and configuring all git options and ensuring git (bash) works fine, I started to use git-gui but to my surprise it does not function properly in remote operations. I checked the options menu and saw that it's missing user name etc. so somehow it is not getting the whole git config parameters (the global parameters definitely) or it got them initially (in first experiments) and did not update afterwards. However when starting git-gui from bash everything is okay.

My questions

  1. are git-gui options saved somewhere and where ?

The global options are saved in whatever your default .gitconfig file is. On Linux and other Unix-like systems, that is $HOME/.gitconfig. I assume it is something similar on Windows. The local options are saved in .git/config. Git Gui does not directly read the config file. It uses git config or git config --global to do those tasks. So if git config works in your environment, so should Git Gui.

  1. does git-gui need specific environment variables set before run (my windows system is corporate with preset environment variables that I guess conflict with git setup where I have set my environment variables in bash's profile) or alternatively can I use a command line option to set where is the global git config file ? (something like GIT_GUI_HOME= ... for example)

Like I mentioned before, you need to make sure git config [--global] works properly with your environment. That is where we get the configs from. I think the most important environment variable to look at is $HOME.

  1. where is a documentation with all git-gui options (as seen in options menu) and command line options ?

Unfortunately, there is none. See #8. Patches welcome :-)

dsnz commented 3 years ago

Thank you. The information was enough to find a workaround.

However I wonder if there are command line options for git-gui.exe and if you would be kind to mention the most important, or at least kindly point me to the appropriate source file for Windows in github.

(I came to this github repo from the web page about git-gui for WIndows so I guess I am at the right place :) )

prati0100 commented 3 years ago

You can take a look at the man page: https://git-scm.com/docs/git-gui/. It is rather sparse on information though. It lists the subcommands and some of their options. There are some other options like --trace for debugging and some options for citool, but they are in source code mostly, and not documented.

Most of the configuration is not done via command line options. The preferred method is via git config. And some options come through environment variables. But again, those are scattered throughout the codebase and there is no cohesive documentation for those. Most of the git config options are available in the options dialog but there are some that aren't listed in the dialog. You can only find out about them when reading the source. The bulk of the options are present in the options menu though.

So yeah, things are scattered all over the place.

(I came to this github repo from the web page about git-gui for WIndows so I guess I am at the right place :) )

Yes, this is the "official" Git Gui repo. Commits from here end up in Git for Windows eventually, though they go through the main Git repo maintained by Junio first.

dsnz commented 3 years ago

Thank you :)

PhilipOakley commented 3 years ago
  • @PhilipOakley, who knows more about Windows than I do.

Just catching up on old emails..

a) on windows you can have multiple Git and Git-Gui installations, especially if you have a mixed environment (personal, corporate, developer, historic, etc). In this case use the Help menu with About Git Gui. at the bottom (may need to stretch the window) you will see paths for the git wrapper, git exec dire and the git-gui lib. Check these in the different invocations of the gui. image

b) on windows you can also have different config locations for the different git exe's, especially if they were installed with different rights. In some cases there was an extra config directory to conform to some Microsoft policy - I think that's gone now, but you may still have that version installed.

c) from the Repository menu select the Git Bash option, and then use pwd -W to locate where the current path is, in Windows format, and possibly cd / && pwd -W to locate where the 'unix' root directory is presumed to be for this particular bash/gui pair (again different for each install!).

d) having started the bash from the gui (and checked git version, and switched to the relevant repo directory) use git config --list --show-origin --show-scope to see all your configs and where they are located. Look out for oddball values.

Hope that helps for any future debugging.