Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Apr 15, 2014

  1. dscho

    Merge pull request #16 from johnstevenson/winexec2

    Memory-leak fix and code formatting in winexec.c

Mar 29, 2014

  1. John Stevenson


    Signed-off-by: johnstevenson <>
  2. John Stevenson

    Frees the orig variable in the path_split function

    Signed-off-by: johnstevenson <>

Mar 28, 2014

  1. John Stevenson

    Provide a Windows-specific implementation of exec_program_v()

    Building in Visual Studio 2010 causes clients to hang if they
    read stdout (Far Manager, for example). This does not happen for
    MinGW builds, so this rough hack uses Win32 handles for
    redirection, rather than C file-descriptors.
    [JES: formatted source code a little bit, moved around a little
    bit, simplified integration of the Windows-specific code.]
    Signed-off-by: johnstevenson <>
    Signed-off-by: Johannes Schindelin <>
    authored dscho committed

Mar 26, 2014

  1. dscho

    Merge pull request #15 from msysgit/far-manager

    Detach Git Bash
    Tested by @johnstevenson.

Mar 24, 2014

  1. dscho

    Detach Git Bash

    When called from the Windows Explorer, we must not wait for the
    stdout/stderr of Git Bash.
    A recent change made for FarManager makes Git Cheetah capture
    stderr/stdout even when we are not interested in it, to avoid cluttering
    FarManager's precious console. Due to this workaround, Git Bash makes the
    Explorer -- Git Cheetah's primary intended consumer -- hang.
    Since Git Bash does not output anything to the calling console, let's just
    force the detached mode by avoiding the FarManager workaround *just* for
    Git Bash.
    Thanks to John Stevenson for catching a bug in an earlier version of this
    Signed-off-by: Johannes Schindelin <>

Mar 14, 2014

  1. dscho

    Merge pull request #14 from kblees/kb/redirect-output-to-null

    Fix menu commands blocking the file manager process

Mar 05, 2014

  1. Karsten Blees

    exec.c: redirect unwanted command output to /dev/null

    Git-Cheetah redirects and reads stdout / stderr of forked commands only if
    it needs to. Otherwise this output simply goes to stdout / stderr of the
    calling file manager process. This is OK for GUI-based file managers (e.g.
    Windows Explorer), as there is no console.
    For text-based file managers (e.g. Far Manager) this is a problem, as such
    unwanted console output messes up the UI.
    Redirect stdout / stderr of forked commands to /dev/null if Git-Cheetah
    doesn't need it.
    Signed-off-by: Karsten Blees <>
  2. Karsten Blees

    Revert "always read stdout and stderr from forked commands"

    This reverts commit f743394.
    Most Git-Cheetah commands are expected to launch an independent process,
    without blocking the calling file manager application.
    Signed-off-by: Karsten Blees <>

Jan 03, 2014

  1. dscho

    Merge pull request #11 from msysgit/hv/read_output_from_tools

    always read stdout and stderr from forked commands
    This fixes #2

Nov 11, 2013

  1. dscho

    Merge pull request #8 from johnstevenson/vs-pain

    Reduce pain points with Visual Studio
  2. John Stevenson

    Reduce pain points with Visual Studio

    There are plenty of hoops to jump through before you can build
    and debug using Visual Studio. Even more if you then want to
    contribute any changes back.
    This pain can be alleviated by providing a single project file
    (suitable for Visual Studio 2010 upwards), removing the use of
    make in the build process and bypassing the version info mechanism.
    Maintainability over different versions is aided by the code being
    in a single project file with most properties being controlled by
    external property sheets.
    Signed-off-by: johnstevenson <>
  3. dscho

    Merge pull request #7 from johnstevenson/registry-path-fix

    Registry path fix

Nov 09, 2013

  1. John Stevenson

    Fix find_msysgit_in_path() when PATH is in cmd folder rather than bin

    msysgit_in_path() expects the PATH to git.exe to be in "../bin/""
    whereas Git for Windows uses "../cmd/". This results in the
    PathToMsys registry value being set to "../cmd/git.exe" which means
    that git_path() will always fail.
    This only happens when the dll is outside the git-cheetah folder, as
    can be the case when you are debugging.
    Signed-off-by: johnstevenson <>

Nov 02, 2013

  1. John Stevenson

    Prevent duplicate menus being created by explorer

    On Vista duplicated Git menu entries are added when you right-click a
    folder in the Folders pane.
    This is because the Shell calls the handler for the Directory\Background
    progid first (with a folder pidl), then calls it again for the other
    entries with a data object. So the trick is to check if the Git menu has
    already been written.
    One way you can do this is by using InsertMenuItem on all menu entries
    and adding a unique identifier (your module handle, for example) to the
    dwItemData member of the item structure. Then in the QueryContextMenu
    function you can check if any menu item has this value and act
    [JES: moved hInst back into the Explorer-specific part]
    Signed-off-by: johnstevenson <>
    Signed-off-by: Johannes Schindelin <>
    authored dscho committed

Jun 18, 2013

  1. dscho

    Merge pull request #4 from kblees/kb/really-dont-cache-environment-va…

    This fixes environment issues (too aggressive caching)
    Signed-off-by: Johannes Schindelin <>

Jun 17, 2013

  1. Karsten Blees

    really don't cache environment variables

    As of c67941 "don't cache environment variables, fix non-ASCII environment
    variables", git-cheetah fails to show context menu items unless the git
    installation directory is in the PATH.
    This is due to mingw_spawnvpe_cwd using getenv("PATH") internally, which is
    the state of the PATH variable as cached by MSVCRT on startup.
    To allow for environment changes in the hosting exporer process, we shall
    not use any cached variant of the environment.
    Reimplement mingw_getenv to access the Win32 environment directly (instead
    of MSVCRT's cached version).
    Update fork_process to use the improved non-caching getenv instead of the
    more complex Win32 function.
    Also add a minimal setenv implementation and use it in fork_process, so
    that we don't mix POSIX and Win32 APIs.
    Reported-by: Peter Oberndorfer <>
    Signed-off-by: Karsten Blees <>

Feb 26, 2013

  1. dscho

    Add a convenience goal 'checkinstall'

    The checkinstall(8) tool is a very convenient tool to install packages
    from source, integrating into the current system's default package
    However, it does a slightly lousy job at determining package name
    and version from the directory name 'git-cheetah': it tries to use
    'git' as package name and 'cheetah' as version number (which fails
    on Debian, because Debian requires version numbers to start with
    a digit). So help it a little by adding a goal that automatically
    determines correct default values.
    Signed-off-by: Johannes Schindelin <>
  2. dscho

    Use GTK 3 for Nautilus

    Signed-off-by: Johannes Schindelin <>
  3. dscho

    Fix a compiler warning

    Signed-off-by: Johannes Schindelin <>

Feb 23, 2013

  1. Merge remote-tracking branch 'kblees/kb/dont-cache-environment-variab…


Feb 22, 2013

  1. Karsten Blees

    don't cache environment variables, fix non-ASCII environment variables

    GitCheetah caches environment variables when spawning the first child
    process. Thus, updates to the hosting explorer process's environment are
    not reflected in subsequently spawned child processes.
    Note: if and when explorer updates its environment variables from the
    registry seems to depend on the Windows version.
    Additionally, non-ASCII environment variables are mangled in child
    processes, as GetEnvironmentStringsA returns OEM-encoded strings, but
    CreateProcessA expects ANSI.
    Remove the copying / caching of the entire environment. When spawning
    child processes, just tweak the PATH variable temporarily.
    Reading a single environment variable (GetEnvironmentVariableA) instead of
    the entire environment (GetEnvironmentStringsA) implicitly fixes non-ASCII
    Signed-off-by: Karsten Blees <>

Jan 13, 2013

  1. always read stdout and stderr from forked commands

    When not doing so such output would be forwarded to a program using
    this plugin. Normally in Windows GUI programs there is no console so
    this did not disturb anyone.
    Far Manager is a console program that also uses shell extensions for
    which this was reported.
    Fix this by always reading the output into a strbuf. Since we are
    tracing the ouput later on anyway the output does not get lost.
    Signed-off-by: Heiko Voigt <>

Nov 16, 2012

  1. dscho

    Merge pull request #1 from msysgit/hv/correct_return_type

    use correct return type macros of dll interface

May 03, 2012

  1. use correct return type macros of dll interface

    In commit d1ad8f1 Pat Thoyts corrected the return type macros of the dlls
    interface. This was a good change so we add it here again.

May 02, 2012

  1. fix a crash when active_menu is NULL

    On windows when right clicking on an item in a search result that was
    moved to the trash the active_menu is NULL for some reason.
    It is likely that build_cheetah_menu() has failed somewhere in the
    callchain and thus left the active_menu invalid.
    With this patch invoking the menu on such items does still not work but
    the explorer does not crash anymore.
    Signed-off-by: Heiko Voigt <>
  2. use correct buffer size for vsnprintf in debug_git

    This fixes a bug when debug_git is omitting some output that was
    formatted by %i (or %x) at the end of the string.
    It seems that when the final '\0' does not fit into the length given the
    last format was omitted on mingw. Now the debug output works as
    Signed-off-by: Heiko Voigt <>

Mar 22, 2012

  1. allow debug strings larger than 1024 characters

    On Windows vsnprintf returns -1 if the printed string is longer than the
    target size. This is different from Linux where the number of characters
    that would have been written if the target was large enough are returned.
    Lets find out the target size first by printing into a string of zero
    length. Interestingly this returns the number of characters to be written
    on Windows.
    This fixes a crash when the branchlist of repository is longer than 1024
    Signed-off-by: Heiko Voigt <>
  2. disable debug output for default compile

    Writing debug output to the log file will now only be
    enabled when you compile with the variable DEBUG defined.
      make DEBUG=1
    Signed-off-by: Heiko Voigt <>
  3. Revert "Support registry entries specific to some versions of Windows."

    This reverts commit d1ad8f1.
    As it turns out this change disables the context menu when right
    clicking on folder icons.
    Signed-off-by: Heiko Voigt <>

Feb 10, 2012

  1. Add object clean target to makefile

    This is useful to compile 32 and 64 bit versions of cheetah.
    Signed-off-by: Heiko Voigt <>
    authored sschuberth committed
  2. Teach explorer makefile to use 64bit windres in case of cross compile

    Signed-off-by: Heiko Voigt <>
    authored sschuberth committed

Jan 30, 2012

  1. Pat Thoyts

    Support registry entries specific to some versions of Windows.

    The handling of the various registry classes is different between Windows
    XP and Windows 7. On XP we need to register the context menu handler for
    Directory, Directory\Background and Folders. But on Windows 7 (and likely
    also Vista) this strategy results in duplication of the menu entries in
    the explorer context menu. To deal with this a version field has been added
    to specify the windows major version and the minimum minor version level
    for which a registration entry should be active. So to only register
    something on Windows XP the version field is set to 0x0500, while to
    have an entry only register on Vista and Windows 7 set to 0x0600.
    This has been tested on XP and Windows 7 but not on Vista.
    To fix the build symbols for the versioning macros the build target is set
    to Windows 2000 and above.
    Signed-off-by: Pat Thoyts <>

Oct 10, 2011

  1. fix syntax error for macro substituting a function call

    In commit 68c0c6 the macro substitution to make close_process a noop on
    non-windows platforms was changed to avoid a compiler warning. This
    accidentially lead to a compilation error.
  2. Reset inheritable flag of debug log file git_shell_ext_debug.txt

    FILE * handles opened by _wfopen are inherited to child processes
    by default.
    This behavior can be changed by adding "N" as mode to _wfopen.
    But msvcrt used by GCC does not implement/honor this.
    So just reset the inheritable flag after opening the file.
    This replaces d61e9f6 do not inherit handles into child processes
    Signed-off-by: Peter Oberndorfer <>
    authored Heiko Voigt committed
Something went wrong with that request. Please try again.