Re: [PATCH 2/2 v2] run-command (Windows): Run dashless "git <cmd>" (solves part of problem with system_path)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Jul 29, 2008, at 7:24 AM, Shawn O. Pearce wrote:

Steffen Prohaska <prohaska@xxxxxx> wrote:
We prefer running the dashless form, so we should use it in MinGW's
start_command(), too.
...
- We have non-builtins that are implemented in C, e.g. fast-import.c.
  These non-builtins will still compute wrong paths.

This feels wrong to me.  fast-import probably won't be adversly
impacted by not being able to read /etc/gitconfig, unless the user
has set something like core.deltaBaseCacheLimit and is doing an
incremental import.  But other non-builtins may be impacted.

It feels like we're fixing this in the wrong place.  If the issue
is we don't find our installation directory correctly, we should
find our installation directory correctly, not work around it by
calling builtins through the git wrapper.

For builtins it is not a work around but a real solution.  The
solution however needs to be tested without builtins installed
in libexec/git-core.   Note that Unix runs builtins using the
git wrapper too (see execv_git_cmd), so the patch makes the MinGW
port behaving more like the Unix version.

My patch however does not solve the problem for non-builtins, so I agree
that we are not fixing the real problem.

Maybe we could do the following:

 - Add a switch RELOCATABLE_PREFIX to the Makefile.

 - If RELOCATABLE_PREFIX is defined, system paths will not be
   interpreted as is, but a prefix will be computed at runtime.  For
   example, if git is installed in /some/patch/bin/git, then
   system_path("/etc") will return "/some/path/etc".

 - As Dscho proposed, system_path() needs to be intelligent enough
   to find the prefix for executables located either in bindir or in
   gitexecdir.

Adding a switch to the Makefile would make the relocation magic
explicit, instead of relying on relative paths.  This has also the
advantage that we can just use the default paths for gitexecdir,
template_dir, ... , instead of overriding them in MINGW section of the
Makefile.  We only would set RELOCATABLE_PREFIX there.  Actually some
more work is needed because prefix is used for defining system paths and
also for defining the installation directory.  Maybe we could add
installprefix to explicitly distinguish between the two purposes.

        Steffen


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux