Merge branch 'js/info-man-path'
authorJunio C Hamano <gitster@pobox.com>
Fri, 6 May 2011 18:00:46 +0000 (11:00 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 May 2011 18:00:46 +0000 (11:00 -0700)
* js/info-man-path:
Documentation: clarify meaning of --html-path, --man-path, and --info-path
git: add --info-path and --man-path options

Conflicts:
Makefile

1  2 
Documentation/git.txt
Makefile
git.c
diff --combined Documentation/git.txt
index 78420b133ad2ff0b28aa3e0b5ac7a8d36a625703,5295315fe72920b9e4d988ad93744b2b66a0a012..f1292fc6ce63be015a3c40e8fb04ebdb6acacf70
@@@ -9,7 -9,7 +9,7 @@@ git - the stupid content tracke
  SYNOPSIS
  --------
  [verse]
- 'git' [--version] [--exec-path[=<path>]] [--html-path]
+ 'git' [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
      [-p|--paginate|--no-pager] [--no-replace-objects]
      [--bare] [--git-dir=<path>] [--work-tree=<path>]
      [-c <name>=<value>]
@@@ -44,10 -44,9 +44,10 @@@ unreleased) version of git, that is ava
  branch of the `git.git` repository.
  Documentation for older releases are available here:
  
 -* link:v1.7.5/git.html[documentation for release 1.7.5]
 +* link:v1.7.5.1/git.html[documentation for release 1.7.5.1]
  
  * release notes for
 +  link:RelNotes/1.7.5.1.txt[1.7.5.1],
    link:RelNotes/1.7.5.txt[1.7.5].
  
  * link:v1.7.4.5/git.html[documentation for release 1.7.4.5]
@@@ -288,8 -287,16 +288,16 @@@ help ...`
        the current setting and then exit.
  
  --html-path::
-       Print the path to wherever your git HTML documentation is installed
-       and exit.
+       Print the path, without trailing slash, where git's HTML
+       documentation is installed and exit.
+ --man-path::
+       Print the manpath (see `man(1)`) for the man pages for
+       this version of git and exit.
+ --info-path::
+       Print the path where the Info files documenting this
+       version of git are installed and exit.
  
  -p::
  --paginate::
diff --combined Makefile
index 3a1fe20ff2219efc778d1d7c415c2ca9e8263ccd,322c59b7618f449be361b9d8e77cea99f8405995..ef57c1c9b40de62d58d192f1f65f65e9e9f19dd8
+++ b/Makefile
@@@ -323,7 -323,9 +323,7 @@@ GCOV = gco
  
  export TCL_PATH TCLTK_PATH
  
 -# sparse is architecture-neutral, which means that we need to tell it
 -# explicitly what architecture to check for. Fix this up for yours..
 -SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 +SPARSE_FLAGS =
  
  
  
@@@ -368,6 -370,7 +368,6 @@@ SCRIPT_SH += git-merge-resolve.s
  SCRIPT_SH += git-mergetool.sh
  SCRIPT_SH += git-pull.sh
  SCRIPT_SH += git-quiltimport.sh
 -SCRIPT_SH += git-rebase--interactive.sh
  SCRIPT_SH += git-rebase.sh
  SCRIPT_SH += git-repack.sh
  SCRIPT_SH += git-request-pull.sh
@@@ -377,9 -380,6 +377,9 @@@ SCRIPT_SH += git-web--browse.s
  
  SCRIPT_LIB += git-mergetool--lib
  SCRIPT_LIB += git-parse-remote
 +SCRIPT_LIB += git-rebase--am
 +SCRIPT_LIB += git-rebase--interactive
 +SCRIPT_LIB += git-rebase--merge
  SCRIPT_LIB += git-sh-setup
  
  SCRIPT_PERL += git-add--interactive.perl
@@@ -527,7 -527,6 +527,7 @@@ LIB_H += list-objects.
  LIB_H += ll-merge.h
  LIB_H += log-tree.h
  LIB_H += mailmap.h
 +LIB_H += merge-file.h
  LIB_H += merge-recursive.h
  LIB_H += notes.h
  LIB_H += notes-cache.h
@@@ -925,7 -924,6 +925,7 @@@ ifeq ($(uname_O),Cygwin
        X = .exe
        COMPAT_OBJS += compat/cygwin.o
        UNRELIABLE_FSTAT = UnfortunatelyYes
 +      SPARSE_FLAGS = -isystem /usr/include/w32api -Wno-one-bit-signed-bitfield
  endif
  ifeq ($(uname_S),FreeBSD)
        NEEDS_LIBICONV = YesPlease
@@@ -1179,7 -1177,6 +1179,7 @@@ ifneq (,$(findstring MINGW,$(uname_S))
        EXTLIBS += -lws2_32
        PTHREAD_LIBS =
        X = .exe
 +      SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
  ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
        htmldir=doc/git/html/
        prefix =
@@@ -1583,7 -1580,6 +1583,7 @@@ ifndef 
        QUIET_LNCP     = @echo '   ' LN/CP $@;
        QUIET_XGETTEXT = @echo '   ' XGETTEXT $@;
        QUIET_GCOV     = @echo '   ' GCOV $@;
 +      QUIET_SP       = @echo '   ' SP $<;
        QUIET_SUBDIR0  = +@subdir=
        QUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
                         $(MAKE) $(PRINT_DIR) -C $$subdir
@@@ -1679,17 -1675,19 +1679,19 @@@ strip: $(PROGRAMS) git$
        $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
  
  git.o: common-cmds.h
 -git.s git.o: EXTRA_CPPFLAGS = -DGIT_VERSION='"$(GIT_VERSION)"' \
 +git.sp git.s git.o: EXTRA_CPPFLAGS = -DGIT_VERSION='"$(GIT_VERSION)"' \
-       '-DGIT_HTML_PATH="$(htmldir_SQ)"'
+       '-DGIT_HTML_PATH="$(htmldir_SQ)"' \
+       '-DGIT_MAN_PATH="$(mandir_SQ)"' \
+       '-DGIT_INFO_PATH="$(infodir_SQ)"'
  
  git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
                $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
  
 -help.o: common-cmds.h
 +help.sp help.o: common-cmds.h
  
 -builtin/help.o: common-cmds.h
 -builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
 +builtin/help.sp builtin/help.o: common-cmds.h
 +builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
        '-DGIT_HTML_PATH="$(htmldir_SQ)"' \
        '-DGIT_MAN_PATH="$(mandir_SQ)"' \
        '-DGIT_INFO_PATH="$(infodir_SQ)"'
@@@ -1975,34 -1973,30 +1977,34 @@@ $(VCSSVN_OBJS) $(VCSSVN_TEST_OBJS): $(L
  test-svn-fe.o: vcs-svn/svndump.h
  endif
  
 -exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
 +exec_cmd.sp exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
        '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
        '-DBINDIR="$(bindir_relative_SQ)"' \
        '-DPREFIX="$(prefix_SQ)"'
  
 -builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \
 +builtin/init-db.sp builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \
        -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
  
 -config.s config.o: EXTRA_CPPFLAGS = -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
 +config.sp config.s config.o: EXTRA_CPPFLAGS = \
 +      -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
  
 -attr.s attr.o: EXTRA_CPPFLAGS = -DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"'
 +attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \
 +      -DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"'
  
 -http.s http.o: EXTRA_CPPFLAGS = -DGIT_HTTP_USER_AGENT='"git/$(GIT_VERSION)"'
 +http.sp http.s http.o: EXTRA_CPPFLAGS = \
 +      -DGIT_HTTP_USER_AGENT='"git/$(GIT_VERSION)"'
  
  ifdef NO_EXPAT
 -http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
 +http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
  endif
  
  ifdef NO_REGEX
 -compat/regex/regex.o: EXTRA_CPPFLAGS = -DGAWK -DNO_MBSUPPORT
 +compat/regex/regex.sp compat/regex/regex.o: EXTRA_CPPFLAGS = \
 +      -DGAWK -DNO_MBSUPPORT
  endif
  
  ifdef USE_NED_ALLOCATOR
 -compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
 +compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
        -DNDEBUG -DOVERRIDE_STRDUP -DREPLACE_SYSTEM_ALLOCATOR
  endif
  
@@@ -2168,20 -2162,13 +2170,20 @@@ test-%$X: test-%.o $(GITLIBS
  check-sha1:: test-sha1$X
        ./test-sha1.sh
  
 +SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))
 +
 +$(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
 +      $(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \
 +              $(SPARSE_FLAGS) $<
 +
 +.PHONY: sparse $(SP_OBJ)
 +sparse: $(SP_OBJ)
 +
  check: common-cmds.h
 -      if sparse; \
 +      @if sparse; \
        then \
 -              for i in $(patsubst %.o, %.c, $(GIT_OBJS)); \
 -              do \
 -                      sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
 -              done; \
 +              echo 2>&1 "Use 'make sparse' instead"; \
 +              $(MAKE) --no-print-directory sparse; \
        else \
                echo 2>&1 "Did you mean 'make test'?"; \
                exit 1; \
diff --combined git.c
index ed899512f9c4220f7d7a2b9e28e1a0eb23c06b8c,60a9403771879da0e39a456055e22844905aac68..a5ef3c69ff58434e521d2c42f1b2fa275b872828
--- 1/git.c
--- 2/git.c
+++ b/git.c
@@@ -6,7 -6,7 +6,7 @@@
  #include "run-command.h"
  
  const char git_usage_string[] =
-       "git [--version] [--exec-path[=<path>]] [--html-path]\n"
+       "git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
        "           [-p|--paginate|--no-pager] [--no-replace-objects]\n"
        "           [--bare] [--git-dir=<path>] [--work-tree=<path>]\n"
        "           [-c name=value] [--help]\n"
@@@ -95,6 -95,12 +95,12 @@@ static int handle_options(const char **
                } else if (!strcmp(cmd, "--html-path")) {
                        puts(system_path(GIT_HTML_PATH));
                        exit(0);
+               } else if (!strcmp(cmd, "--man-path")) {
+                       puts(system_path(GIT_MAN_PATH));
+                       exit(0);
+               } else if (!strcmp(cmd, "--info-path")) {
+                       puts(system_path(GIT_INFO_PATH));
+                       exit(0);
                } else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) {
                        use_pager = 1;
                } else if (!strcmp(cmd, "--no-pager")) {
@@@ -179,8 -185,6 +185,8 @@@ static int handle_alias(int *argcp, con
                if (alias_string[0] == '!') {
                        const char **alias_argv;
                        int argc = *argcp, i;
 +                      struct strbuf sb = STRBUF_INIT;
 +                      const char *env[2];
  
                        commit_pager_choice();
  
                                alias_argv[i] = (*argv)[i];
                        alias_argv[argc] = NULL;
  
 -                      ret = run_command_v_opt(alias_argv, RUN_USING_SHELL);
 +                      strbuf_addstr(&sb, "GIT_PREFIX=");
 +                      if (subdir)
 +                              strbuf_addstr(&sb, subdir);
 +                      env[0] = sb.buf;
 +                      env[1] = NULL;
 +                      ret = run_command_v_opt_cd_env(alias_argv, RUN_USING_SHELL, NULL, env);
 +                      strbuf_release(&sb);
                        if (ret >= 0)   /* normal exit */
                                exit(ret);