As Fredrik points out the current interface of has_extension() is
potentially confusing. Its parameters include both a nul-terminated
string and a length-limited string.
This patch drops the length argument, requiring two nul-terminated
strings; all callsites are updated. I checked that all of them indeed
provide nul-terminated strings. Filenames need to be nul-terminated
anyway if they are to be passed to open() etc. The performance penalty
of the additional strlen() is negligible compared to the system calls
which inevitably surround has_extension() calls.
Additionally, change has_extension() to use size_t inside instead of
int, as that is the exact type strlen() returns and memcmp() expects.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
With this option, the changed words are shown inline. For example,
if a file containing "This is foo" is changed to "This is bar", the diff
will now show "This is " in plain text, "foo" in red, and "bar" in green.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
A small howto on how to setup GIT over HTTP transport protocol by
setting up WebDAV access on apache2.
[jc: minimum ispell fixes applied]
Signed-off-by: Rutger Nijlunsing <git@tux.tmfweb.nl>
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Convert git-verify-pack to a builtin command. Also rename ac to argc
and av to argv for consistancy.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
* 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
Plug memory leak in verify_one_pack() by freeing the struct packed_git
we got from add_packed_git(). Also rename g to pack and pull an
assignment out of an if statement while we're at it.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Get rid of that while loop which was apparently used as a way to avoid
goto's (why?). It's easy now because there is only one break left at
the end of it. Also make the comment clearer.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-verify-pack can be called with a filename without .idx extension.
add_packed_git() on the other hand depends on its presence. So
instead of trying to call it with whatever the user gave us check for
that extension and add it if it's missing.
That means that you can't name your index file "blah" and your pack
file ".pack" anymore ("git-verify-pack blah" currently works in that
case). I think this regression is a good change. ;-)
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Use strlcpy() to copy the filename into a buffer and complain if it
doesn't fit. Also move the path buffer into verify_one_pack(); it is
used only there. Now we can const'ify the first argument of this
function.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
The little helper has_extension() documents through its name what we are
trying to do and makes sure we don't forget the underrun check.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Commit 9919f41 meant to make git-diff A...B to (usually) mean
"git-diff `git-merge-base A B` B", but it got the parameters wrong
and ended up showing "git-diff `git-merge-base A B` A" by mistake.
Signed-off-by: Junio C Hamano <junkio@cox.net>
WebDAV on Debian unstable cannot handle renames on WebDAV from
file.ext to newfile (without ext) when newfile* already
exists. Normally, git creates a file like 'objects/xx/sha1.token',
which is renamed to 'objects/xx/sha1' when transferred completely.
Just use '_' instead of '.' so WebDAV doesn't see it as an extension
change.
Signed-off-by: Rutger Nijlunsing <git@tux.tmfweb.nl>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
The internal representation of the result is counted string
(i.e. char *buf and ulong size), which is fine for writing out
to regular file, but throwing the buf at symlink(2) was a
no-no.
Reported by Willy Tarreau.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Add support for --with-openssl=PATH and --without-openssl,
--with-curl=PATH and --without-curl, --with-expat=PATH and
--without-expat ./configure options, each setting or unsetting
appropriate NO_PACKAGE and if called with argument also PACKAGEDIR
(of which only CURLDIR is documented in Makefile)
All above options are supported as override to autodetection; more to
come in the same style (override to autodetection), so moved the bulk
of comments for site configuration down.
Needs review by someone well versed in autoconf and m4.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Combine option descriptions in git-init-db(1). Reflect the changes to
additionally allow all users to read the created git repository.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
When configure is interrupted in the middle it leaves
config.mak.append behind. Add it to .gitignore and make sure
$(MAKE) clean removes it.
Also earlier .gitignore listed config.mak.in which is a tracked
file. Fix it.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Move detected NO_STH and NEED_STH variables, which we always output,
either setting or unsetting (setting to empty string) to config.mak.in
and use setting appropriately named variables and doing AC_SUBST
instead of adding them via GIT_CONF_APPEND_LINE macro and
config.mak.append temporary file.
Variables which might and might not be set are still added via
config.mak.append; this include all STH_PATH variables.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Instead of looping over the entries and writing out, use a
separate loop after all entries have been written out to check
how many entries are racily clean. Make sure that the newly
created index file gets the right timestamp when we check by
flushing the buffered data by ce_write().
Signed-off-by: Junio C Hamano <junkio@cox.net>
Unset NO_PYTHON for --with-python without arguments, and when
PYTHON_PATH is set. Do not check for PYTHON_PATH if it is set
via --with-python=PYTHON_PATH. Prefer "python" over version
specific names such as "python2.4".
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Error out on --without-shell/--with-shell=no and
--without-perl/--with-perl=no instead of just warning
and continuing.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
While at it fill git version information in configure.ac
configure target needs autoconf, of course.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
The semantics are equivalent to pushing from the root; we just try harder to
find the .git directory.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
When an ancient "git" that does not understand "describe"
command is on the $PATH, "git describe" emitted a Usage message
without exiting non-zero status (which is a mistake we cannot
fix retroactively). Catch this case to make sure we do not try
using phoney multi-line string as a version number.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Until now blame just used the commit/tree/tags/etc style of
highlight-able table rows, which have alternating light/dark rows that
flash when mouse pointer passes over them. This is very annoying in
blame, since the text is static and it interferes with the
per-revision block highlighting.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
In git_commit() the hash base of $from_id is $parent, not
$hash:
- If status is "D", then action blob for $from_id wants
$parent, not $hash. History needs $parent too.
- If status is "R", then action blob for $from_id wants
$parent, not $hash.
Similarly in git_commitdiff() the hash base of $from_id is
$hash_parent, not $hash.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Immediately after a bulk checkout, most of the paths in the
working tree would have the same timestamp as the index file,
and this would force ce_match_stat() to take slow path for all
of them. When writing an index file out, if many of the paths
have very new (read: the same timestamp as the index file being
written out) timestamp, we are better off delaying the return
from the command, to make sure that later command to touch the
working tree files will leave newer timestamps than recorded in
the index, thereby avoiding to take the slow path.
Signed-off-by: Junio C Hamano <junkio@cox.net>
When configure detects some NO_XXX or NEEDS_XXX is unneeded, unset
this variable (actually set it to empty string). This allow
autodetection to override the default set in Makefile.
[jc: while at it fixed a thinko in IPv6 detection.]
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
There were some places where $project was used even if it was not
defined.
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>