Commit Graph

22 Commits

Author SHA1 Message Date
Steffen Prohaska
4d2a9e8f60 refactor help.c to git_install_prefix() and make_native_separator()
git_install_prefix() returns the install prefix of msysgit. For
all other architectures it returns "". The path returned contains
slashes.

make_native_separator() takes a unix path (slashes) and converts
the separators in place. On Windows slashes are converted to
backslashes.

All the code was available in help.c and is now moved to path.c.

The new function will be used to located the templates and /etc/gitconfig.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-10-27 11:08:20 +02:00
Steffen Prohaska
ded3d5f496 help (msysgit): add comment about assumption on _pgmptr 2007-10-04 07:45:31 +02:00
Steffen Prohaska
fc98ff0830 help (msysgit): beautify message telling user that HTML will be display
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-10-02 23:02:11 +02:00
Steffen Prohaska
65230e232c help (msysgit): fix locating html help for paths with spaces
Derive the git installation dir from the executable path
and directly use the Win32 API to open the HTML file. This
avoids the mingw layer and command line escaping problems,
which caused the previous implementation to fail if spaces
were contained in the path to git.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-10-02 23:01:05 +02:00
Steffen Prohaska
803d403a73 help (msysgit): print message telling the user that browser is launched
git doesn't wait until the browser is launched but returns
immediatly. A user may feel more comfortable if he knows
that eventually the help will appear.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-10-01 07:27:20 +02:00
Steffen Prohaska
57bab054a9 help (msysgit): teach git help to open html from /doc/git/html/
Html pages will be opened using the default Windows application
configured for html. This code path is taken for msysgit (mingw).

It is assumed that html pages are installed at /doc/git/html.
This needs to be ensured by the msysgit superproject to make this
patch useful. html pages should be cloned from git.git's main
repo. This is the easiest way to get up-to-date documentation,
without requiring the complete tool chain to generate them
locally.

If html pages are not yet there, you can use the following
commands to get them:

    mkdir -p /doc/git/html
    cd /doc/git/html/
    git init
    git config remote.origin.url git://git.kernel.org/pub/scm/git/git.git
    git config remote.origin.fetch refs/heads/html:refs/remotes/origin/html
    git fetch
    git checkout --track -b html origin/html

and update the html documentation with

    git pull

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-08-12 16:08:57 -07:00
Johannes Sixt
91a4c3a6dd Merge commit '952c8c56380734d45bddf369fe478895672c5a3a' 2007-07-21 16:51:27 +02:00
Junio C Hamano
a6080a0a44 War on whitespace
This uses "git-apply --whitespace=strip" to fix whitespace errors that have
crept in to our source files over time.  There are a few files that need
to have trailing whitespaces (most notably, test vectors).  The results
still passes the test, and build result in Documentation/ area is unchanged.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-07 00:04:01 -07:00
Johannes Sixt
d34a3a1a61 Merge commit 'v1.5.1' 2007-04-06 16:29:46 +02:00
James Bowes
c6e0caa384 use xrealloc in help.c
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-27 16:57:57 -07:00
James Bowes
3301521a25 use xmalloc in git.c and help.c
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-25 18:00:23 -07:00
Johannes Sixt
d5f1c1bbc0 Merge with git://repo.or.cz/git.git#master 2007-02-27 16:15:36 +01:00
Junio C Hamano
cc44c7655f Mechanical conversion to use prefixcmp()
This mechanically converts strncmp() to use prefixcmp(), but only when
the parameters match specific patterns, so that they can be verified
easily.  Leftover from this will be fixed in a separate step, including
idiotic conversions like

    if (!strncmp("foo", arg, 3))

  =>

    if (!(-prefixcmp(arg, "foo")))

This was done by using this script in px.perl

   #!/usr/bin/perl -i.bak -p
   if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) {
           s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|;
   }
   if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) {
           s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|;
   }

and running:

   $ git grep -l strncmp -- '*.c' | xargs perl px.perl

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-20 22:03:15 -08:00
Johannes Sixt
e1ee0c0e20 Merge v1.5.0. 2007-02-15 12:19:52 +01:00
Ren,bi(B Scharfe
4f75b115d7 Avoid ugly linewrap in git help
Some of the short help texts that are shown e.g. when running 'git'
without any parameters wrap on a 80-column terminal.  They are just
one character over the line.  This patch avoids it by decreasing the
number of spaces around the preceding command name from four to
three (on both sides for symmetry).

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-11 12:42:01 -08:00
Johannes Sixt
14cd939112 Make git compile under MinGW.
These changes are courtesy Johannes Schindelin.
2007-01-19 16:21:41 +01:00
Junio C Hamano
85023577a8 simplify inclusion of system header files.
This is a mechanical clean-up of the way *.c files include
system header files.

 (1) sources under compat/, platform sha-1 implementations, and
     xdelta code are exempt from the following rules;

 (2) the first #include must be "git-compat-util.h" or one of
     our own header file that includes it first (e.g. config.h,
     builtin.h, pkt-line.h);

 (3) system headers that are included in "git-compat-util.h"
     need not be included in individual C source files.

 (4) "git-compat-util.h" does not have to include subsystem
     specific header files (e.g. expat.h).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 09:51:35 -08:00
Jonas Fonseca
2d7320d0b0 Use xmalloc instead of malloc
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-31 16:24:39 -07:00
David Rientjes
96f1e58f52 remove unnecessary initializations
[jc: I needed to hand merge the changes to the updated codebase,
 so the result needs to be checked.]

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 21:22:20 -07:00
Junio C Hamano
bb266cb118 Merge branch 'mk/rename' 2006-08-12 19:13:31 -07:00
Junio C Hamano
44e1d764d0 Merge branch 'master' into mk/rename
* master:
  git-verify-pack: no need to count errors
  git-verify-pack: buffer overrun paranoia
  git-verify-pack: free pack after use and a cleanup
  git-verify-pack: get rid of while loop
  git-verify-pack: insist on .idx extension
  git-verify-pack: more careful path handling
  git-verify-pack: show usage when no pack was specified
  Add has_extension()
  builtin-apply: remove unused increment
  Fix git-diff A...B
  combine-diff: use color
  git-apply: applying a patch to make a symlink shorter.
  allow diff.renamelimit to be set regardless of -M/-C
  make --find-copies-harder imply -C
  find_unique_abbrev() with len=0 should not abbreviate
  check return value from diff_setup_done()
  Fix tutorial-2.html
  Documentation: git-status takes the same options as git-commit
  Update git-init-db(1) and documentation of core.sharedRepository
2006-08-10 14:17:49 -07:00
Junio C Hamano
f754fa9c54 builtins: Makefile clean-up
This cleans up the build procedure for built-in commands by:

 - generating mostly redundant definition of BUILT_INS from
   BUILTIN_OBJS in the Makefile,
 - renaming a few files to make the above possible, and
 - sorting the built-in command table in git.c.

It might be a good idea to binary search (or perfect hash) the built-in
command table, but that can be done later when somebody feels like.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-04 01:51:04 -07:00