All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <johannes.sixt@telecom.at>
To: git@vger.kernel.org
Cc: Steffen Prohaska <prohaska@zib.de>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 11/11] Allow ETC_GITCONFIG to be a relative path.
Date: Thu, 15 Nov 2007 22:43:10 +0100	[thread overview]
Message-ID: <200711152243.10229.johannes.sixt@telecom.at> (raw)
In-Reply-To: <E652EC54-9F94-444F-AF94-2FA990355A78@zib.de>

On Thursday 15 November 2007 21:10, Steffen Prohaska wrote:
> On Nov 15, 2007, at 7:31 PM, Johannes Sixt wrote:
> > On Thursday 15 November 2007 07:53, Steffen Prohaska wrote:
> >> Now I'm wondering if we could make path relocation a bit more
> >> explicit.  How about doing something like.
> >>
> >> 	system_wide = relocate_path(ETC_GITCONFIG);
> >>
> >> and relocate_path(const char *) would expand a format
> >> string in path.  At this point I see only a single %s
> >> that would be expanded with the install prefix.  If
> >> ETC_GITCONFIG is "%s/etc/gitconfig" relocate path will return
> >> "C:/msysgit/bin/etc/gitconfig" for my above example.  It is
> >> basically a printf with the install prefix path.
> >
> > I don't see the problem that you are trying to solve.
>
> Path relocation would be more explicit:
> 1) Paths that need to be relocated are filtered through
>     relocate_path().  That's easy to understand.
> 2) All the code prefixing the path is in relocate_path().
>     This avoids code duplication.
> 3) Path that should be relocated contain "%s" in the Makefile.
>     This indicates that some string expansion may take place.
>
> (1) and (2) would be useful even if you do not agree with (3).
> The code in PATCH 9/11 and PATCH 11/11 looks very similar.
> If the prefixing code went into a separate function, we'd
> have less code.  Also, relocate_path() could be useful at
> other places.  For example, I'd use it to locate the HTML
> documentation relative to the installation directory.

How is %s/foo different from ../foo? There are only 2 paths that need to be 
relocatable. Your proposal is over-engineering, IMHO.

-- Hannes

  reply	other threads:[~2007-11-15 21:43 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-13 20:04 [PATCH 0/11] Miscellaneous MinGW port fallout Johannes Sixt
2007-11-13 20:04 ` [PATCH 01/11] t5300-pack-object.sh: Split the big verify-pack test into smaller parts Johannes Sixt
2007-11-13 20:04   ` [PATCH 02/11] t7501-commit.sh: Not all seds understand option -i Johannes Sixt
2007-11-13 20:04     ` [PATCH 03/11] t5302-pack-index: Skip tests of 64-bit offsets if necessary Johannes Sixt
2007-11-13 20:04       ` [PATCH 04/11] Skip t3902-quoted.sh if the file system does not support funny names Johannes Sixt
2007-11-13 20:05         ` [PATCH 05/11] Use is_absolute_path() in sha1_file.c Johannes Sixt
2007-11-13 20:05           ` [PATCH 06/11] Move #include <sys/select.h> and <sys/ioctl.h> to git-compat-util.h Johannes Sixt
2007-11-13 20:05             ` [PATCH 07/11] builtin run_command: do not exit with -1 Johannes Sixt
2007-11-13 20:05               ` [PATCH 08/11] Close files opened by lock_file() before unlinking Johannes Sixt
2007-11-13 20:05                 ` [PATCH 09/11] Allow a relative builtin template directory Johannes Sixt
2007-11-13 20:05                   ` [PATCH 10/11] Introduce git_etc_gitconfig() that encapsulates access of ETC_GITCONFIG Johannes Sixt
2007-11-13 20:05                     ` [PATCH 11/11] Allow ETC_GITCONFIG to be a relative path Johannes Sixt
2007-11-15  6:53                       ` Steffen Prohaska
2007-11-15 18:31                         ` Johannes Sixt
2007-11-15 20:10                           ` Steffen Prohaska
2007-11-15 21:43                             ` Johannes Sixt [this message]
2007-11-15 22:24                               ` Steffen Prohaska
2007-11-13 21:22                     ` [PATCH 10/11] Introduce git_etc_gitconfig() that encapsulates access of ETC_GITCONFIG Johannes Schindelin
2007-11-13 21:35                       ` Johannes Sixt
2007-11-13 21:43                         ` Johannes Schindelin
2007-11-13 21:05                 ` [PATCH 08/11] Close files opened by lock_file() before unlinking Johannes Schindelin
2007-11-13 21:39           ` [PATCH 05/11] Use is_absolute_path() in sha1_file.c Johannes Schindelin
2007-11-13 21:43             ` Johannes Sixt
2007-11-13 21:48               ` Johannes Schindelin
2007-11-14 21:57               ` Robin Rosenberg
2007-11-13 20:10 ` [PATCH 0/11] Miscellaneous MinGW port fallout Johannes Sixt
2007-11-13 21:10   ` Junio C Hamano
2007-11-13 21:32     ` Johannes Sixt
2007-11-13 21:46       ` Johannes Schindelin
2007-11-13 21:54         ` Johannes Sixt
2007-11-13 22:22         ` Junio C Hamano
2007-11-14 11:02 ` Junio C Hamano
2007-11-14 14:50   ` Johannes Schindelin
2007-11-14 20:13     ` Junio C Hamano
2007-11-14 20:45       ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200711152243.10229.johannes.sixt@telecom.at \
    --to=johannes.sixt@telecom.at \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=prohaska@zib.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.