Commit Graph

6003 Commits

Author SHA1 Message Date
Rene Scharfe
5bb1cda5f7 drop length argument of has_extension
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>
2006-08-11 16:06:34 -07:00
Junio C Hamano
ca9e3b124f Merge branch 'rn/push-dav'
* rn/push-dav:
  http-push: Make WebDAV work with (broken?) default apache2 WebDAV module
2006-08-10 23:13:50 -07:00
Johannes Schindelin
f59a59e22f Add the --color-words option to the diff options family
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>
2006-08-10 15:28:57 -07:00
Rutger Nijlunsing
65cdb5f165 Add Documentation/howto/setup-git-server-over-http.txt
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>
2006-08-10 15:07:11 -07:00
Jakub Narebski
26298b5f7b gitweb: Whitespace cleanup - tabs are for indent, spaces are for align
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-10 14:30:28 -07:00
Rene Scharfe
2e3ed670eb git-verify-pack: make builtin
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>
2006-08-10 14:19:06 -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
Rene Scharfe
0eaf22f4c4 git-verify-pack: no need to count errors
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-10 14:16:02 -07:00
Rene Scharfe
f711ab5470 git-verify-pack: buffer overrun paranoia
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-10 14:15:55 -07:00
Rene Scharfe
d0d619c8c5 git-verify-pack: free pack after use and a cleanup
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>
2006-08-10 14:15:49 -07:00
Rene Scharfe
fc5fc50980 git-verify-pack: get rid of while loop
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>
2006-08-10 14:15:41 -07:00
Rene Scharfe
68f4c78b95 git-verify-pack: insist on .idx extension
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>
2006-08-10 14:14:34 -07:00
Rene Scharfe
ae9c86f2b6 git-verify-pack: more careful path handling
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>
2006-08-10 14:14:27 -07:00
Rene Scharfe
6f05b57da8 git-verify-pack: show usage when no pack was specified
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-10 14:14:24 -07:00
Rene Scharfe
83a2b841d6 Add has_extension()
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>
2006-08-10 14:13:53 -07:00
Junio C Hamano
242abf106c builtin-apply: remove unused increment
We do not use desc.alloc after assigning desc.buffer to patch->result;
do not bother to increment it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-10 00:56:40 -07:00
Junio C Hamano
306ea2df03 Fix git-diff A...B
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>
2006-08-10 00:50:15 -07:00
Junio C Hamano
567a03d14c combine-diff: use color
Using the same mechanism as the regular diffs, color combined diff
output.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-10 00:30:33 -07:00
Rutger Nijlunsing
1e8d304507 http-push: Make WebDAV work with (broken?) default apache2 WebDAV module
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>
2006-08-09 23:40:40 -07:00
Junio C Hamano
2c71810b90 git-apply: applying a patch to make a symlink shorter.
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>
2006-08-09 22:47:25 -07:00
Junio C Hamano
943d5b73e2 allow diff.renamelimit to be set regardless of -M/-C
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-09 14:05:23 -07:00
Junio C Hamano
03b9d560be make --find-copies-harder imply -C
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-09 13:17:19 -07:00
Junio C Hamano
02c5cba200 find_unique_abbrev() with len=0 should not abbreviate
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-09 13:17:04 -07:00
Junio C Hamano
72ee96c0f1 check return value from diff_setup_done()
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-09 12:45:27 -07:00
Junio C Hamano
1d17c25c38 Fix tutorial-2.html
Honza Pazdziora noticed that one example did not match reality.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-09 01:03:39 -07:00
Jakub Narebski
a20b4d899a autoconf: Add support for setting CURLDIR, OPENSSLDIR, EXPATDIR
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>
2006-08-08 22:07:08 -07:00
Junio C Hamano
fb6ff943de Documentation: git-status takes the same options as git-commit
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-08 21:55:05 -07:00
Jakub Narebski
7b1e9d3d85 autoconf: It is --without-python, not --no-python
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-08 17:47:36 -07:00
Jonas Fonseca
d5dc6a76d4 Update git-init-db(1) and documentation of core.sharedRepository
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>
2006-08-08 17:45:20 -07:00
Junio C Hamano
1b1b678e3c autoconf: clean temporary file mak.append
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>
2006-08-08 17:19:28 -07:00
Jakub Narebski
424adc50b7 autoconf: Move variables which we always set to config.mak.in
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>
2006-08-08 17:19:18 -07:00
Junio C Hamano
6015c28b1d read-cache: tweak racy-git delay logic
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>
2006-08-08 17:17:04 -07:00
Junio C Hamano
102cb08521 Merge branch 'master' into mk/rename 2006-08-08 15:42:20 -07:00
Jakub Narebski
af6058cc2b autoconf: Improvements in NO_PYTHON/PYTHON_PATH handling
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>
2006-08-08 13:34:00 -07:00
Jakub Narebski
b52b1d433b autoconf: Error out on --without-shell and --without-perl
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>
2006-08-08 13:32:34 -07:00
Jakub Narebski
3900145ed7 autoconf: Add configure target to main Makefile
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>
2006-08-08 13:32:04 -07:00
Jeff King
6c8d06aff1 git-push: allow pushing from subdirectories
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>
2006-08-08 13:30:10 -07:00
Junio C Hamano
c96c29093f GIT-VERSION-GEN: adjust for ancient git
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>
2006-08-08 13:20:18 -07:00
Junio C Hamano
329a304714 builtin-mv: fix use of uninitialized memory.
Juergen Ruehle noticed that add_slash() tries to strcat()
into uninitialized memory and fails.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-08 12:47:55 -07:00
Junio C Hamano
aa5481c1af debugging: XMALLOC_POISON
Compile with -DXMALLOC_POISON=1 to catch errors from using uninitialized
memory returned by xmalloc.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-08 12:24:13 -07:00
Luben Tuikov
82f930dead gitweb: blame table row no highlight fix
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>
2006-08-07 18:15:29 -07:00
Luben Tuikov
d636ad9743 gitweb: bugfix: git_commit and git_commitdiff parents
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>
2006-08-07 18:15:29 -07:00
Jakub Narebski
f1efc38bf2 gitweb: Remove unused variables in git_shortlog_body and git_heads
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-07 17:29:40 -07:00
Ryan Anderson
7c49cb2881 annotate: Fix bug when parsing merges with differing real and logical parents.
Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-07 11:46:04 -07:00
Ryan Anderson
1dcb69224c log-tree: show_log() should respect the setting of diffopt->line_termination
Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-07 11:38:53 -07:00
Michael Krelin
b20805af60 handle https:// protocol in git-clone
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-07 11:35:16 -07:00
Junio C Hamano
b7e58b17b5 Racy git: avoid having to be always too careful
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>
2006-08-07 01:58:53 -07:00
Jakub Narebski
d5c31a1ccf autoconf: Unset NO_STH and NEED_STH when it is detected not needed
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>
2006-08-07 01:22:13 -07:00
Matthias Lederhofer
dd04c428cf gitweb: fix $project usage
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>
2006-08-06 13:50:43 -07:00
Matthias Lederhofer
1568515d5b gitweb: fix commitdiff_plain for root commits
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-06 13:42:41 -07:00