Add untabify subroutine and use it. It also fixes git_diff_print
which used to get the tabstop wrong.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
We used to find the first match of the pattern and then if the
match is not for the entire word, declared that the whole line
does not match.
But that is wrong. The command "git grep -w -e mmap" should
find that a line "foo_mmap bar mmap baz" matches, by tring the
second instance of pattern "mmap" on the same line.
Problems an earlier round of "fix" had were pointed out by Morten
Welinder, which have been incorporated in the t7002 tests.
Signed-off-by: Junio C Hamano <junkio@cox.net>
The function pull() in fetch.c calls write_ref_sha1(), which may
need committer identity to update the ref-log, so they need to
call setup_ident() before calling git_config() function.
Acked-by: Shawn Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Unlike git-commit, git-format-patch was not picking up and using the
user.email config variable for the email part of the committer info.
I was forced to use the GIT_COMMITTER_EMAIL environment variable to
override the default <user@localhost.localdomain>. The fix was to
simply move the call to setup_ident() to come before the git_config()
call.
Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git_tree() will now conditionally display "blame"
depending on how "gitweb.blame" variable is configured
using "git-repo-config".
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
NEEDS_SSL_WITH_CRYPTO means you cannot just say "-lcrypto" to
use SHA1 stuff, but need to say "-lcrypto -lssl".
Signed-off-by: Junio C Hamano <junkio@cox.net>
Copy description of new build configuration variables from the
commentary in the top Makefile, namely NO_FINK and NO_DARWIN_PORTS
configuration variables, putting them in site configuration section.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Add custom test for checking whether formatted IO functions
(printf/scanf et.al.) support 'size specifiers' introduced by C99,
namely ll, hh, j, z, t. (representing long long int, char, intmax_t,
size_t, ptrdiff_t).
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
We used to test if a pointer was NULL, and if it was, try to access it.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Free the root tree object buffer when we're done, plugging a minor leak
in generate_tar(). Note: we cannot simply free(tree.buf) because this
pointer is modified by tree_entry() calls in traverse_tree().
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
As Matthias Kestenholz noted, the flag does not quite mean
"needs prefix" -- it is more like "run setup_git_directory()
before running this command", so rename it to avoid future
confusion.
While we are at it, rewrite the definition of options to make it
obvious that we are talking about flag bits by using standard (1<<n)
notation.
Signed-off-by: Junio C Hamano <junkio@cox.net>
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>
This hopefully finishes the clean-up Ramsay started with recent
commit 15e593e4d3 and commit
8cdf33643d.
Signed-off-by: Junio C Hamano <junkio@cox.net>
The only change in behaviour should be having a "usage: " prefix
on the output string rather than "fatal: ", and an exit code of
129 rather than 128.
Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Most usage strings, such as for command xxx, start with "git-xxx".
This updates the rebels to conform to the general pattern.
(The git wrapper is an exception to this, of course ...)
Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
We ended up merging too many stuff after -rc2, so here is
another round of release candidate. Non bugfixes will be
queued to "next" from now on until a real 1.4.2 happens.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Earlier we deliberately showed only blob1's name because showing
both names labeled the output as a renaming patch. Now the output
routine (namely, diff.c::resolve_rename_copy()) is taught not to
use pathname comparison to tell if a filepair is a rename, we can
safely do this change.
Signed-off-by: Junio C Hamano <junkio@cox.net>
The final output from diff used to compare pathnames between
preimage and postimage to tell if the filepair is a rename/copy.
By explicitly marking the filepair created by diffcore_rename(),
the output routine, resolve_rename_copy(), does not have to do
so anymore. This helps feeding a filepair that has different
pathnames in one and two elements to the diff machinery (most
notably, comparing two blobs).
Signed-off-by: Junio C Hamano <junkio@cox.net>
We still have too few of them, but we have to start from somewhere.
The general rule is to make tests easy to debug when run with -v (notice
use of seemingly useless echo everywhere in the new tests).
Signed-off-by: Junio C Hamano <junkio@cox.net>
Recent changes to built-ins broke committing from subdirectory,
because the unused parameter "prefix" shadowed a global variable.
Spotted by Jeff King.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This was introduced by mistake when revision.c::add_pending_object()
was modified to use object-array instead of object-list.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This patch adds support for setting either PYTHON_PATH or NO_PYTHON to
autoconf generated ./configure script via --with-python=PATH (sets
PYTHON_PATH) or --without-python (sets NO_PYTHON). Autodetect
PYTHON_PATH via AC_PATH_PROGS.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Move site configuration section, i.e. --with-PACKAGE[=ARG] and
--without-PACKAGE, --enable-FEATURE[=ARG] and --disable-FEATURE
options to the beginning of configure.ac file, just after definitions
of macros.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This patch adds support for setting SHELL_PATH and PERL_PATH to
autoconf generated ./configure script via --with-shell=PATH and
--with-perl=PATH options.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>