gitweb.git
Merge branch 'cj/maint-gitpm-fix-maybe-self'Junio C Hamano Mon, 3 Nov 2008 00:36:21 +0000 (16:36 -0800)

Merge branch 'cj/maint-gitpm-fix-maybe-self'

* cj/maint-gitpm-fix-maybe-self:
Git.pm: do not break inheritance

Add reference for status letters in documentation.Yann Dirson Sun, 2 Nov 2008 13:37:28 +0000 (14:37 +0100)

Add reference for status letters in documentation.

Also fix error in diff_filepair::status documentation, and point to
the in-code reference as well as the doc.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Document that git-log takes --all-match.Mikael Magnusson Sun, 2 Nov 2008 18:32:46 +0000 (19:32 +0100)

Document that git-log takes --all-match.

Signed-off-by: Mikael Magnusson <mikachu@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

autoconf: Add link tests to each AC_CHECK_FUNC() testDavid M. Syzdek Sun, 26 Oct 2008 11:52:19 +0000 (03:52 -0800)

autoconf: Add link tests to each AC_CHECK_FUNC() test

Update configure.ac to test libraries for getaddrinfo, strcasestr, memmem,
strlcpy, strtoumax, setenv, unsetenv, and mkdtemp. The default compilers
on FreeBSD 4.9-SECURITY and FreeBSD 6.2-RELEASE-p4 do not generate warnings
for missing prototypes unless `-Wall' is used. This behavior renders the
results of AC_CHECK_FUNC() void on these platforms. The test AC_SEARCH_LIBS()
verifies a function is valid by linking to symbol within the system libraries.

Since this pattern needs to be repeated for many functions that are
checked with AC_CHECK_FUNC(), we add GIT_CHECK_FUNC() to drive the two
autoconf macros together.

Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: make the supported snapshot formats array globalGiuseppe Bilotta Sun, 2 Nov 2008 09:21:37 +0000 (10:21 +0100)

gitweb: make the supported snapshot formats array global

The array of supported snapshot format is used and defined (with two
different names) in two routines, one of which (format_snapshot_links)
is often called multiple times per page.

Simplify code and speed up page generation by making the array global.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: don't leak pack window reference when... Nicolas Pitre Wed, 29 Oct 2008 23:02:52 +0000 (19:02 -0400)

pack-objects: don't leak pack window reference when splitting packs

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

extend test coverage for latest pack corruption resilie... Nicolas Pitre Wed, 29 Oct 2008 23:02:51 +0000 (19:02 -0400)

extend test coverage for latest pack corruption resilience improvements

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: allow "fixing" a corrupted pack without... Nicolas Pitre Wed, 29 Oct 2008 23:02:50 +0000 (19:02 -0400)

pack-objects: allow "fixing" a corrupted pack without a full repack

When the pack data to be reused is found to be bad, let's fall back to
full object access through the generic path which has its own strategies
to find alternate object sources in that case. This allows for "fixing"
a corrupted pack simply by copying either another pack containing the
object(s) found to be bad, or the loose object itself, into the object
store and launch a repack without the need for -f.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

make find_pack_revindex() aware of the nasty worldNicolas Pitre Wed, 29 Oct 2008 23:02:49 +0000 (19:02 -0400)

make find_pack_revindex() aware of the nasty world

It currently calls die() whenever given offset is not found thinking
that such thing should never happen. But this offset may come from a
corrupted pack whych _could_ happen and not be found. Callers should
deal with this possibility gracefully instead.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

make check_object() resilient to pack corruptionsNicolas Pitre Wed, 29 Oct 2008 23:02:48 +0000 (19:02 -0400)

make check_object() resilient to pack corruptions

The check_object() function tries to get away with the least amount of
pack access possible when it already has partial information on given
object rather than calling the more costly packed_object_info().

When things don't look right, it should just give up and fall back to
packed_object_info() directly instead of die()'ing.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

make packed_object_info() resilient to pack corruptionsNicolas Pitre Wed, 29 Oct 2008 23:02:47 +0000 (19:02 -0400)

make packed_object_info() resilient to pack corruptions

In the same spirit as commit 8eca0b47ff, let's try to survive a pack
corruption by making packed_object_info() able to fall back to alternate
packs or loose objects.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

make unpack_object_header() non fatalNicolas Pitre Wed, 29 Oct 2008 23:02:46 +0000 (19:02 -0400)

make unpack_object_header() non fatal

It is possible to have pack corruption in the object header. Currently
unpack_object_header() simply die() on them instead of letting the caller
deal with that gracefully.

So let's have unpack_object_header() return an error instead, and find
a better name for unpack_object_header_gently() in that context. All
callers of unpack_object_header() are ready for it.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

better validation on delta base object offsetsNicolas Pitre Wed, 29 Oct 2008 23:02:45 +0000 (19:02 -0400)

better validation on delta base object offsets

In one case, it was possible to have a bad offset equal to 0 effectively
pointing a delta onto itself and crashing git after too many recursions.
In the other cases, a negative offset could result due to off_t being
signed. Catch those.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

close another possibility for propagating pack corruptionNicolas Pitre Fri, 31 Oct 2008 15:31:08 +0000 (11:31 -0400)

close another possibility for propagating pack corruption

Abstract
--------

With index v2 we have a per object CRC to allow quick and safe reuse of
pack data when repacking. This, however, doesn't currently prevent a
stealth corruption from being propagated into a new pack when _not_
reusing pack data as demonstrated by the modification to t5302 included
here.

The Context
-----------

The Git database is all checksummed with SHA1 hashes. Any kind of
corruption can be confirmed by verifying this per object hash against
corresponding data. However this can be costly to perform systematically
and therefore this check is often not performed at run time when
accessing the object database.

First, the loose object format is entirely compressed with zlib which
already provide a CRC verification of its own when inflating data. Any
disk corruption would be caught already in this case.

Then, packed objects are also compressed with zlib but only for their
actual payload. The object headers and delta base references are not
deflated for obvious performance reasons, however this leave them
vulnerable to potentially undetected disk corruptions. Object types
are often validated against the expected type when they're requested,
and deflated size must always match the size recorded in the object header,
so those cases are pretty much covered as well.

Where corruptions could go unnoticed is in the delta base reference.
Of course, in the OBJ_REF_DELTA case, the odds for a SHA1 reference to
get corrupted so it actually matches the SHA1 of another object with the
same size (the delta header stores the expected size of the base object
to apply against) are virtually zero. In the OBJ_OFS_DELTA case, the
reference is a pack offset which would have to match the start boundary
of a different base object but still with the same size, and although this
is relatively much more "probable" than in the OBJ_REF_DELTA case, the
probability is also about zero in absolute terms. Still, the possibility
exists as demonstrated in t5302 and is certainly greater than a SHA1
collision, especially in the OBJ_OFS_DELTA case which is now the default
when repacking.

Again, repacking by reusing existing pack data is OK since the per object
CRC provided by index v2 guards against any such corruptions. What t5302
failed to test is a full repack in such case.

The Solution
------------

As unlikely as this kind of stealth corruption can be in practice, it
certainly isn't acceptable to propagate it into a freshly created pack.
But, because this is so unlikely, we don't want to pay the run time cost
associated with extra validation checks all the time either. Furthermore,
consequences of such corruption in anything but repacking should be rather
visible, and even if it could be quite unpleasant, it still has far less
severe consequences than actively creating bad packs.

So the best compromize is to check packed object CRC when unpacking
objects, and only during the compression/writing phase of a repack, and
only when not streaming the result. The cost of this is minimal (less
than 1% CPU time), and visible only with a full repack.

Someone with a stats background could provide an objective evaluation of
this, but I suspect that it's bad RAM that has more potential for data
corruptions at this point, even in those cases where this extra check
is not performed. Still, it is best to prevent a known hole for
corruption when recreating object data into a new pack.

What about the streamed pack case? Well, any client receiving a pack
must always consider that pack as untrusty and perform full validation
anyway, hence no such stealth corruption could be propagated to remote
repositoryes already. It is therefore worthless doing local validation
in that case.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft 1.6.0.4 release notesJunio C Hamano Sun, 2 Nov 2008 22:35:41 +0000 (14:35 -0800)

Update draft 1.6.0.4 release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'js/maint-fetch-update-head' into maintJunio C Hamano Sun, 2 Nov 2008 21:37:16 +0000 (13:37 -0800)

Merge branch 'js/maint-fetch-update-head' into maint

* js/maint-fetch-update-head:
pull: allow "git pull origin $something:$current_branch" into an unborn branch
Fix fetch/pull when run without --update-head-ok

Merge branch 'jk/maint-ls-files-other' into maintJunio C Hamano Sun, 2 Nov 2008 21:37:13 +0000 (13:37 -0800)

Merge branch 'jk/maint-ls-files-other' into maint

* jk/maint-ls-files-other:
refactor handling of "other" files in ls-files and status

Merge branch 'jc/maint-reset-remove-unmerged-new' into... Junio C Hamano Sun, 2 Nov 2008 21:36:20 +0000 (13:36 -0800)

Merge branch 'jc/maint-reset-remove-unmerged-new' into maint

* jc/maint-reset-remove-unmerged-new:
reset --hard/read-tree --reset -u: remove unmerged new paths

Merge branch 'jc/maint-co-track' into maintJunio C Hamano Sun, 2 Nov 2008 21:36:14 +0000 (13:36 -0800)

Merge branch 'jc/maint-co-track' into maint

* jc/maint-co-track:
Enhance hold_lock_file_for_{update,append}() API
demonstrate breakage of detached checkout with symbolic link HEAD
Fix "checkout --track -b newbranch" on detached HEAD

gitk: Unify handling of merge diffs with normal 2-way... Paul Mackerras Sun, 2 Nov 2008 11:34:47 +0000 (22:34 +1100)

gitk: Unify handling of merge diffs with normal 2-way diffs

This adds code to getblobdiffline to make it able to recognize and
display merge diffs (i.e. N-way diffs for N >= 3) as well as normal
two-way diffs. This means that it can also correctly display the
3-way diff of the local changes when the git repository is in the
middle of a merge with conflicts.

This also removes getmergediffline and changes mergediff to invoke
getblobdiffline rather than getmergediffline.

Signed-off-by: Paul Mackerras <paulus@samba.org>

Update draft release notes to 1.6.1Junio C Hamano Sun, 2 Nov 2008 07:36:07 +0000 (00:36 -0700)

Update draft release notes to 1.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stop using compat/regex.c on platforms with working... Junio C Hamano Fri, 24 Oct 2008 02:44:27 +0000 (19:44 -0700)

Stop using compat/regex.c on platforms with working regexp library

We used to have non-POSIX comformant BRE in our code, and linked with GNU
regexp library on a few platforms (Darwin, FreeBSD and AIX) to work it
around. This was backwards.

We've fixed the broken regexps to use ERE that native regexp libraries on
these platforms can handle just fine. There is no need to link with GNU
regexp library on these platforms anymore.

Tested-on-AIX-by: Mike Ralphson <mike@abacus.co.uk>
Tested-on-FreeBSD-by: Jeff King <peff@peff.net>
Tested-on-Darwin-by: Arjen Laarhoven <arjen@yaph.org>
Tested-on-Darwin-by: Pieter de Bie <pieter@frim.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

connect.c: add a way for git-daemon to pass an error... Tom Preston-Werner Sat, 1 Nov 2008 18:44:45 +0000 (11:44 -0700)

connect.c: add a way for git-daemon to pass an error back to client

The current behavior of git-daemon is to simply close the connection on
any error condition. This leaves the client without any information as
to the cause of the failed fetch/push/etc.

This patch allows get_remote_heads to accept a line prefixed with "ERR"
that it can display to the user in an informative fashion. Once clients
can understand this ERR line, git-daemon can be made to properly report
"repository not found", "permission denied", or other errors.

Example

S: ERR No matching repository.
C: fatal: remote error: No matching repository.

Signed-off-by: Tom Preston-Werner <tom@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Introduce receive.denyDeletesJan Krüger Sat, 1 Nov 2008 14:42:16 +0000 (15:42 +0100)

Introduce receive.denyDeletes

Occasionally, it may be useful to prevent branches from getting deleted from
a centralized repository, particularly when no administrative access to the
server is available to undo it via reflog. It also makes
receive.denyNonFastForwards more useful if it is used for access control
since it prevents force-updating by deleting and re-creating a ref.

Signed-off-by: Jan Krüger <jk@jk.gs>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add Makefile check for FreeBSD 4.9-SECURITYDavid M. Syzdek Sun, 26 Oct 2008 11:52:47 +0000 (03:52 -0800)

Add Makefile check for FreeBSD 4.9-SECURITY

If the system is FreeBSD 4.9, then NO_UINTMAX_T and NO_STRTOUMAX is defined.

Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Build: add NO_UINTMAX_T to support ancient systemsDavid M. Syzdek Sun, 26 Oct 2008 11:52:37 +0000 (03:52 -0800)

Build: add NO_UINTMAX_T to support ancient systems

This adds NO_UINTMAX_T for ancient systems, such as FreeBSD 4.9-SECURITY.
If NO_UINTMAX_T is defined, then uintmax_t is defined as uint32_t.

Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sun, 2 Nov 2008 07:15:22 +0000 (00:15 -0700)

Merge branch 'maint'

* maint:
Start 1.6.0.4 cycle
add instructions on how to send patches to the mailing list with Gmail
Documentation/gitattributes: Add subsection header for each attribute
git send-email: avoid leaking directory file descriptors.
send-pack: do not send out single-level refs such as refs/stash
fix overlapping memcpy in normalize_absolute_path
pack-objects: avoid reading uninitalized data
correct cache_entry allocation

Conflicts:
RelNotes

Start 1.6.0.4 cycleJunio C Hamano Sun, 2 Nov 2008 07:14:04 +0000 (00:14 -0700)

Start 1.6.0.4 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>

add instructions on how to send patches to the mailing... Tom Preston-Werner Sat, 1 Nov 2008 15:28:18 +0000 (15:28 +0000)

add instructions on how to send patches to the mailing list with Gmail

Gmail is one of the most popular email providers in the world. Now that Gmail
supports IMAP, sending properly formatted patches via `git imap-send` is
trivial. This section in SubmittingPatches explains how to do so.

Signed-off-by: Tom Preston-Werner <tom@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/gitattributes: Add subsection header... Jakub Narebski Sat, 1 Nov 2008 06:24:55 +0000 (06:24 +0000)

Documentation/gitattributes: Add subsection header for each attribute

This makes attributes easier to find; before this patch some
attributes had individual subsections, and some didn't.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git send-email: avoid leaking directory file descriptors.Pierre Habouzit Fri, 31 Oct 2008 18:57:10 +0000 (18:57 +0000)

git send-email: avoid leaking directory file descriptors.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-pack: do not send out single-level refs such as... Jeff King Wed, 29 Oct 2008 05:17:55 +0000 (05:17 +0000)

send-pack: do not send out single-level refs such as refs/stash

Since no version of receive-pack accepts these "funny refs", we should
mirror the check when considering the list of refs to send. IOW, don't
even make them eligible for matching or mirroring.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

fix overlapping memcpy in normalize_absolute_pathJeff King Thu, 23 Oct 2008 04:32:23 +0000 (04:32 +0000)

fix overlapping memcpy in normalize_absolute_path

The comments for normalize_absolute_path explicitly claim
that the source and destination buffers may be the same
(though they may not otherwise overlap). Thus the call to
memcpy may involve copying overlapping data, and memmove
should be used instead.

This fixes a valgrind error in t1504.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: avoid reading uninitalized dataJeff King Thu, 23 Oct 2008 04:31:03 +0000 (04:31 +0000)

pack-objects: avoid reading uninitalized data

In the main loop of find_deltas, we do:

struct object_entry *entry = *list++;
...
if (!*list_size)
...
break

Because we look at and increment *list _before_ the check of
list_size, in the very last iteration of the loop we will
look at uninitialized data, and increment the pointer beyond
one past the end of the allocated space. Since we don't
actually do anything with the data until after the check,
this is not a problem in practice.

But since it technically violates the C standard, and
because it provokes a spurious valgrind warning, let's just
move the initialization of entry to a safe place.

This fixes valgrind errors in t5300, t5301, t5302, t303, and
t9400.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

correct cache_entry allocationJeff King Thu, 23 Oct 2008 04:30:58 +0000 (04:30 +0000)

correct cache_entry allocation

Most cache_entry structs are allocated by using the
cache_entry_size macro, which rounds the size of the struct
up to the nearest multiple of 8 bytes (presumably to avoid
memory fragmentation).

There is one exception: the special "conflict entry" is
allocated with an empty name, and so is explicitly given
just one extra byte to hold the NUL.

However, later code doesn't realize that this particular
struct has been allocated differently, and happily tries
reading and copying it based on the ce_size macro, which
assumes the 8-byte alignment.

This can lead to reading uninitalized data, though since
that data is simply padding, there shouldn't be any problem
as a result. Still, it makes sense to hold the padding
assumption so as not to surprise later maintainers.

This fixes valgrind errors in t1005, t3030, t4002, and
t4114.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge git://repo.or.cz/git-guiJunio C Hamano Sun, 2 Nov 2008 05:31:46 +0000 (22:31 -0700)

Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui: (27 commits)
git-gui: Update German translation.
git-gui: Do not munge conflict marker lines in a normal diff
git-gui: Add a simple implementation of SSH_ASKPASS.
git-gui: Add a dialog that shows the OpenSSH public key.
git-gui: Mark-up strings in show_{other,unmerged}_diff() for localization
git-gui: Show a round number of bytes of large untracked text files
git-gui: Fix the blame viewer destroy handler.
git-gui: Add a search command to the blame viewer.
git-gui: Fix the blame window shape.
git-gui: Fix switch statement in lib/merge.tcl
git-gui: Fix fetching from remotes when adding them
git-gui: Fix removing non-pushable remotes
git-gui: Make input boxes in init/clone/open dialogs consistent
git-gui: Avoid using the term URL when specifying repositories
git-gui: gui.autoexplore makes explorer to pop up automatically after picking
git-gui: Add Explore Working Copy to the Repository menu
git-gui: Use git web--browser for web browsing
git-gui: mkdir -p when initializing new remote repository
git-gui: Add support for removing remotes
git-gui: Add support for adding remotes
...

Merge branch 'maint' of git://repo.or.cz/git-gui into... Junio C Hamano Sun, 2 Nov 2008 05:31:14 +0000 (22:31 -0700)

Merge branch 'maint' of git://repo.or.cz/git-gui into maint

* 'maint' of git://repo.or.cz/git-gui:
git-gui: Help identify aspell version on Windows too

git-gui: Update German translation.Christian Stimming Sat, 25 Oct 2008 20:51:05 +0000 (22:51 +0200)

git-gui: Update German translation.

Not yet completed, though.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: Do not munge conflict marker lines in a normal... Johannes Sixt Tue, 14 Oct 2008 11:48:37 +0000 (13:48 +0200)

git-gui: Do not munge conflict marker lines in a normal diff

Previously, conflict markers were highlighted in two ways: (1) They
received a distinguishing color; and (2) they had the '+' removed at the
beginning of the line. However, by doing (2), a hunk that contained
conflict markers could not be staged or unstaged because the resulting
patch was corrupted. With this change we no longer modify the diff text
of a 2-way diff, so that "Stage Hunk" and friends work.

Note that 3-way diff of a conflicted file is unaffected by this change,
and '++' before conflict markers is still removed. But this has no negative
impact because in this mode staging hunks or lines is disabled anyway.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: Add a simple implementation of SSH_ASKPASS.Alexander Gavrilov Wed, 15 Oct 2008 09:28:21 +0000 (13:28 +0400)

git-gui: Add a simple implementation of SSH_ASKPASS.

OpenSSH allows specifying an external program to use
for direct user interaction. While most Linux systems
already have such programs, some environments, for
instance, msysgit, lack it. This patch adds a simple
fallback Tcl implementation of the tool.

In msysgit it is also necessary to set a fake value of
the DISPLAY variable, because otherwise ssh won't even
try to use SSH_ASKPASS handlers.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: Add a dialog that shows the OpenSSH public... Alexander Gavrilov Wed, 15 Oct 2008 09:28:20 +0000 (13:28 +0400)

git-gui: Add a dialog that shows the OpenSSH public key.

Generating a new SSH key or finding an existing one may
be a difficult task for non-technical users, especially
on Windows.

This commit adds a new dialog that shows the public key,
or allows the user to generate a new one if none were found.
Since this is a convenience/informational feature for new
users, and the dialog is mostly read-only, it is located
in the Help menu.

The command line used to invoke ssh-keygen is designed to
force it to use SSH_ASKPASS if available, or accept empty
passphrases, but _never_ wait for user response on the tty.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

update-ref --no-deref -d: handle the case when the... Miklos Vajna Fri, 31 Oct 2008 23:25:44 +0000 (00:25 +0100)

update-ref --no-deref -d: handle the case when the pointed ref is packed

In this case we did nothing in the past, but we should delete the
reference in fact.

The problem was that when the symref is not packed but the referenced
ref is packed, then we assumed that the symref is packed as well, but
symrefs are never packed.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Avoid using non-portable `echo -n` in tests.Brian Gernhardt Fri, 31 Oct 2008 05:09:13 +0000 (01:09 -0400)

Avoid using non-portable `echo -n` in tests.

Expecting echo to recognise -n is a BSDism. Using printf is far more
portable.

Discovered on OS X 10.5.5 in t4030-diff-textconv.sh and changed in all
the test scripts.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Fri, 31 Oct 2008 08:42:58 +0000 (01:42 -0700)

Merge branch 'maint'

* maint:
git-svn: change dashed git-commit-tree to git commit-tree
Documentation: clarify information about 'ident' attribute
bash completion: add doubledash to "git show"
Use test-chmtime -v instead of perl in t5000 to get mtime of a file
Add --verbose|-v to test-chmtime
asciidoc: add minor workaround to add an empty line after code blocks
Plug a memleak in builtin-revert
Add file delete/create info when we overflow rename_limit
Install git-cvsserver in $(bindir)
Install git-shell in bindir, too

git-svn: change dashed git-commit-tree to git commit... Deskin Miller Fri, 31 Oct 2008 04:10:25 +0000 (00:10 -0400)

git-svn: change dashed git-commit-tree to git commit-tree

Signed-off-by: Deskin Miller <deskinm@umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: clarify information about 'ident' attributeJan Krüger Thu, 30 Oct 2008 18:14:33 +0000 (19:14 +0100)

Documentation: clarify information about 'ident' attribute

The documentation spoke of the attribute being set "to" a path; this can
mistakenly be interpreted as "the attribute needs to have its value set to
some kind of path". This clarifies things.

Signed-off-by: Jan Krüger <jk@jk.gs>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash completion: add doubledash to "git show"Markus Heidelberg Fri, 31 Oct 2008 00:04:46 +0000 (01:04 +0100)

bash completion: add doubledash to "git show"

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use test-chmtime -v instead of perl in t5000 to get... Alex Riesen Thu, 30 Oct 2008 10:20:27 +0000 (11:20 +0100)

Use test-chmtime -v instead of perl in t5000 to get mtime of a file

The test was broken on admittedly broken combination of Windows, Cygwin,
and ActiveState Perl.

Signed-off-by: Alex Riesen <ariesen@harmanbecker.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add --verbose|-v to test-chmtimeAlex Riesen Thu, 30 Oct 2008 09:00:29 +0000 (10:00 +0100)

Add --verbose|-v to test-chmtime

This allows us replace perl when getting the mtime of a file because
of time zone conversions, though at the moment only one platform which
does this has been identified: Cygwin when used with ActiveState Perl
(as usual).

The output format is:

<mtime1> TAB <filename1> <LF>
<mtime2> TAB <filename2> <LF>
...

which, if only mtime is needed can be parsed with cut(1):

test-chmtime -v +0 filename1 | cut -f 1

Also, the change adds a description of programs features, with examples.

Signed-off-by: Alex Riesen <ariesen@harmanbecker.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

asciidoc: add minor workaround to add an empty line... Jonas Fonseca Thu, 30 Oct 2008 10:45:03 +0000 (11:45 +0100)

asciidoc: add minor workaround to add an empty line after code blocks

Insert an empty <simpara> in manpages after code blocks to force and
empty line.

The problem can be seen on the manpage for the git tutorial, where an
example command and the following paragraph is printed with no empty
line between them:

First, note that you can get documentation for a command such as git
log --graph with:

$ man git-log
It is a good idea to introduce yourself to git [...]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ar/maint-mksnpath' into ar/mksnpathJunio C Hamano Fri, 31 Oct 2008 01:08:58 +0000 (18:08 -0700)

Merge branch 'ar/maint-mksnpath' into ar/mksnpath

* ar/maint-mksnpath:
Use git_pathdup instead of xstrdup(git_path(...))
git_pathdup: returns xstrdup-ed copy of the formatted path
Fix potentially dangerous use of git_path in ref.c
Add git_snpath: a .git path formatting routine with output buffer

Conflicts:
builtin-revert.c
refs.c
rerere.c

Use git_pathdup instead of xstrdup(git_path(...))Alex Riesen Mon, 27 Oct 2008 10:22:09 +0000 (11:22 +0100)

Use git_pathdup instead of xstrdup(git_path(...))

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git_pathdup: returns xstrdup-ed copy of the formatted... Alex Riesen Mon, 27 Oct 2008 10:17:51 +0000 (11:17 +0100)

git_pathdup: returns xstrdup-ed copy of the formatted path

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix potentially dangerous use of git_path in ref.cAlex Riesen Mon, 27 Oct 2008 10:11:40 +0000 (11:11 +0100)

Fix potentially dangerous use of git_path in ref.c

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add git_snpath: a .git path formatting routine with... Alex Riesen Mon, 27 Oct 2008 09:22:21 +0000 (10:22 +0100)

Add git_snpath: a .git path formatting routine with output buffer

The function's purpose is to replace git_path where the buffer of
formatted path may not be reused by subsequent calls of the function
or will be copied anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Plug a memleak in builtin-revertAlex Riesen Tue, 28 Oct 2008 17:27:33 +0000 (18:27 +0100)

Plug a memleak in builtin-revert

Probably happened when working around git_path's problem with returned
buffer being reused.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git branch -m: forbid renaming of a symrefMiklos Vajna Wed, 29 Oct 2008 00:05:27 +0000 (01:05 +0100)

git branch -m: forbid renaming of a symref

There may be cases where one would really want to rename the symbolic
ref without changing its value, but "git branch -m" is not such a
use-case.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

compat/cygwin.c: make runtime detection of lstat/stat... Junio C Hamano Fri, 24 Oct 2008 05:54:09 +0000 (22:54 -0700)

compat/cygwin.c: make runtime detection of lstat/stat lessor impact

The original patch that lead to an earlier commit adbc0b6 (cygwin: Use
native Win32 API for stat, 2008-09-30) did not call git_default_config()
and it was a good thing. The lazy config reading when lstat/stat is
called for the first time to find out if core.filemode is set can happen
anytime in the calling program. If it happens after the calling program
parsed the configuration file to prime its default parameter settings and
processed its command line parameters to tweak them, this will overwrite
the values set by the program with the values read from the config file.

This essentially reverts the code to the version as submitted by Mark,
with a bit more comments to clarify why we do not fall back on the default
configuration parser from git_cygwin_config().

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add file delete/create info when we overflow rename_limitLinus Torvalds Mon, 27 Oct 2008 20:06:16 +0000 (13:06 -0700)

Add file delete/create info when we overflow rename_limit

When we refuse to do rename detection due to having too many files
created or deleted, let the user know the numbers. That way there is a
reasonable starting point for setting the diff.renamelimit option.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Install git-cvsserver in $(bindir)Nanako Shiraishi Wed, 10 Sep 2008 11:03:18 +0000 (20:03 +0900)

Install git-cvsserver in $(bindir)

It is one of the server side programs and needs to be found on usual $PATH.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Install git-shell in bindir, tooTommi Virtanen Sun, 24 Aug 2008 20:23:25 +0000 (23:23 +0300)

Install git-shell in bindir, too

/etc/passwd shell field must be something execable, you can't enter
"/usr/bin/git shell" there. git-shell must be present as a separate
executable, or it is useless.

Signed-off-by: Tommi Virtanen <tv@eagain.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitk: Make the background color of marked lines configu... Paul Mackerras Mon, 27 Oct 2008 11:37:21 +0000 (22:37 +1100)

gitk: Make the background color of marked lines configurable

This makes it possible for the user to configure the background color
of lines that are "marked". At the moment only the "show the origin
of this line" function marks lines. This also makes the user's choice
persistent by saving it in ~/.gitk.

Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Add a menu item to show where a given line comes... Paul Mackerras Mon, 27 Oct 2008 10:36:25 +0000 (21:36 +1100)

gitk: Add a menu item to show where a given line comes from

This adds a menu item to the pop-up menu for the diff display window
which makes gitk find which commit added the line (via git blame)
and show that commit, with the line highlighted with a light-blue
background.

Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Fix some off-by-one errors in computing which... Paul Mackerras Mon, 27 Oct 2008 10:13:37 +0000 (21:13 +1100)

gitk: Fix some off-by-one errors in computing which line to blame

When walking back from the line where a right-click happened to the
previous hunk separator line to calculate the line number to work on,
we were counting every line including the one clicked on. That isn't
right; if the user clicked on the line immediately after the hunk
separator then the correct line number would be the one from the
hunk separator. Therefore this looks at the clicked-on line to work
out which parent to blame (or whether to blame the current commit),
and then looks only at the preceding lines to work out the offset from
the line number in the hunk separator.

This also fixes an off-by-one error when we are showing files rather
than diffs. In this case diff_menu_filebase is the line number of
the banner showing the file name, so the first line of the file is
at line $diff_menu_filebase + 1.

This also simplifies the code in find_hunk_blamespec a bit and arranges
that we don't pop up the context menu if the user clicks on a file
separator line or a hunk separator line.

Signed-off-by: Paul Mackerras <paulus@samba.org>

Fix potentially dangerous uses of mkpath and git_pathAlex Riesen Sun, 26 Oct 2008 22:08:52 +0000 (23:08 +0100)

Fix potentially dangerous uses of mkpath and git_path

Replace them with mksnpath/git_snpath and a local buffer
for the resulting string.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ar/maint-mksnpath' into HEADJunio C Hamano Mon, 27 Oct 2008 05:24:44 +0000 (22:24 -0700)

Merge branch 'ar/maint-mksnpath' into HEAD

* ar/maint-mksnpath:
Fix potentially dangerous uses of mkpath and git_path
Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c
Add mksnpath which allows you to specify the output buffer

Fix potentially dangerous uses of mkpath and git_pathAlex Riesen Sun, 26 Oct 2008 22:08:52 +0000 (23:08 +0100)

Fix potentially dangerous uses of mkpath and git_path

Replace them with mksnpath/git_snpath and a local buffer
for the resulting string.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.cAlex Riesen Sun, 26 Oct 2008 22:07:24 +0000 (23:07 +0100)

Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c

Otherwise the function sometimes fail to resolve obviously correct
refnames, because the string data pointed to by "str" argument were
reused.

The change in dwim_log does not fix anything, just optimizes away
strcpy code as the path can be created directly in the available
buffer.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add mksnpath which allows you to specify the output... Alex Riesen Sun, 26 Oct 2008 21:59:13 +0000 (22:59 +0100)

Add mksnpath which allows you to specify the output buffer

This is just vsnprintf's but additionally calls cleanup_path() on the
result. To be used as alternatives to mkpath() where the buffer for the
created path may not be reused by subsequent calls of the same formatting
function.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sun, 26 Oct 2008 23:21:08 +0000 (16:21 -0700)

Merge branch 'maint'

* maint:
add -p: warn if only binary changes present
git-archive: work in bare repos
git-svn: change dashed git-config to git config

add -p: warn if only binary changes presentThomas Rast Sun, 26 Oct 2008 19:37:06 +0000 (20:37 +0100)

add -p: warn if only binary changes present

Current 'git add -p' will say "No changes." if there are no changes to
text files, which can be confusing if there _are_ changes to binary
files. Add some code to distinguish the two cases, and give a
different message in the latter one.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-archive: work in bare reposCharles Bailey Sat, 25 Oct 2008 15:38:14 +0000 (11:38 -0400)

git-archive: work in bare repos

This moves the call to git_config to a place where it doesn't break the
logic for using git archive in a bare repository but retains the fix to
make git archive respect core.autocrlf.

Tests are by René Scharfe.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Tested-by: Deskin Miller <deskinm@umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix git update-ref --no-deref -d.Miklos Vajna Sun, 26 Oct 2008 02:33:58 +0000 (03:33 +0100)

Fix git update-ref --no-deref -d.

Till now --no-deref was just ignored when deleting refs, fix this.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rename_ref(): handle the case when the reflog of a... Miklos Vajna Sun, 26 Oct 2008 02:33:57 +0000 (03:33 +0100)

rename_ref(): handle the case when the reflog of a ref does not exist

We tried to check if a reflog of a ref is a symlink without first
checking if it exists, which is a bug.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix git branch -m for symrefs.Miklos Vajna Sun, 26 Oct 2008 02:33:56 +0000 (03:33 +0100)

Fix git branch -m for symrefs.

This had two problems with symrefs. First, it copied the actual sha1
instead of the "pointer", second it failed to remove the old ref after a
successful rename.

Given that till now delete_ref() always dereferenced symrefs, a new
parameters has been introduced to delete_ref() to allow deleting refs
without a dereference.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

enable textconv for diff in verbose status/commitJeff King Sun, 26 Oct 2008 04:50:02 +0000 (00:50 -0400)

enable textconv for diff in verbose status/commit

This diff is meant for human consumption, so it makes sense
to apply text conversion here, as we would for the regular
diff porcelain.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add userdiff textconv testsJeff King Sun, 26 Oct 2008 04:42:25 +0000 (00:42 -0400)

add userdiff textconv tests

These tests provide a basic sanity check that textconv'd
files work. The tests try to describe how this configuration
_should_ work; thus some of the tests are marked to expect
failure.

In particular, we fail to actually textconv anything because
the 'diff.foo.binary' config option is not set, which will
be fixed in the next patch.

This also means that some "expect_failure" tests actually
seem to be fixed; in reality, this is just because textconv
is broken and its failure mode happens to make these tests
work.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

wt-status: load diff ui configJeff King Sun, 26 Oct 2008 04:49:35 +0000 (00:49 -0400)

wt-status: load diff ui config

When "git status -v" shows a diff, we did not respect the
user's usual diff preferences at all. Loading just
git_diff_basic_config would give us things like rename
limits and diff drivers. But it makes even more sense to
load git_diff_ui_config, which gives us colorization if the
user has requested it.

Note that we need to take special care to cancel
colorization when writing to the commit template file, as
described in the code comments.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

only textconv regular filesJeff King Sun, 26 Oct 2008 04:46:21 +0000 (00:46 -0400)

only textconv regular files

We treat symlinks as text containing the results of the
symlink, so it doesn't make much sense to text-convert them.

Similarly gitlink components just end up as the text
"Subproject commit $sha1", which we should leave intact.

Note that a typechange may be broken into two parts: the
removal of the old part and the addition of the new. In that
case, we _do_ show the textconv for any part which is the
addition or removal of a file we would ordinarily textconv,
since it is purely acting on the file contents.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

userdiff: require explicitly allowing textconvJeff King Sun, 26 Oct 2008 04:45:55 +0000 (00:45 -0400)

userdiff: require explicitly allowing textconv

Diffs that have been produced with textconv almost certainly
cannot be applied, so we want to be careful not to generate
them in things like format-patch.

This introduces a new diff options, ALLOW_TEXTCONV, which
controls this behavior. It is off by default, but is
explicitly turned on for the "log" family of commands, as
well as the "diff" porcelain (but not diff-* plumbing).

Because both text conversion and external diffing are
controlled by these diff options, we can get rid of the
"plumbing versus porcelain" distinction when reading the
config. This was an attempt to control the same thing, but
suffered from being too coarse-grained.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refactor userdiff textconv codeJeff King Sun, 26 Oct 2008 04:44:53 +0000 (00:44 -0400)

refactor userdiff textconv code

The original implementation of textconv put the conversion
into fill_mmfile. This was a bad idea for a number of
reasons:

- it made the semantics of fill_mmfile unclear. In some
cases, it was allocating data (if a text conversion
occurred), and in some cases not (if we could use the
data directly from the filespec). But the caller had
no idea which had happened, and so didn't know whether
the memory should be freed

- similarly, the caller had no idea if a text conversion
had occurred, and so didn't know whether the contents
should be treated as binary or not. This meant that we
incorrectly guessed that text-converted content was
binary and didn't actually show it (unless the user
overrode us with "diff.foo.binary = false", which then
created problems in plumbing where the text conversion
did _not_ occur)

- not all callers of fill_mmfile want the text contents. In
particular, we don't really want diffstat, whitespace
checks, patch id generation, etc, to look at the
converted contents.

This patch pulls the conversion code directly into
builtin_diff, so that we only see the conversion when
generating an actual patch. We also then know whether we are
doing a conversion, so we can check the binary-ness and free
the data from the mmfile appropriately (the previous version
leaked quite badly when text conversion was used)

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

document the diff driver textconv featureJeff King Sun, 26 Oct 2008 04:41:52 +0000 (00:41 -0400)

document the diff driver textconv feature

This patch also changes the term "custom diff driver" to
"external diff driver"; now that there are more facets of a
"custom driver" than just external diffing, it makes sense
to refer to the configuration of "diff.foo.*" as the "foo
diff driver", with "diff.foo.command" as the "external
driver for foo".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: add missing static declarationJeff King Sun, 26 Oct 2008 04:41:28 +0000 (00:41 -0400)

diff: add missing static declaration

This function isn't used outside of diff.c; the 'static' was
simply overlooked in the original writing.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

receive-pack: fix "borrowing from alternate object... Junio C Hamano Sun, 26 Oct 2008 18:07:18 +0000 (11:07 -0700)

receive-pack: fix "borrowing from alternate object store" implementation

In the alternate_object_database structure, ent->base[] is a buffer the
users can use to form pathnames to loose objects, and ent->name is a
pointer into that buffer (it points at one beyond ".git/objects/"). If
you get a call to add_refs_from_alternate() after somebody used the entry
(has_loose_object() has been called, for example), *ent->name would not be
NUL, and ent->base[] won't be the path to the object store.

This caller is expecting to read the path to the object store in ent->base[];
it needs to NUL terminate the buffer if it wants to.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitk: Allow starting gui blame for a specific lineAlexander Gavrilov Fri, 24 Oct 2008 08:13:01 +0000 (12:13 +0400)

gitk: Allow starting gui blame for a specific line

This adds a context menu item to the diff viewer pane that calls git
gui blame, focusing it on the clicked line. In case of combined
diffs, it also automatically deduces which parent is to be blamed.
Lines added by the diff are blamed on the current commit itself.

The context menu itself is added by this patch. It would be possible
to add the commands from the flist menu to it.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitweb: generate parent..current URLsGiuseppe Bilotta Tue, 21 Oct 2008 19:34:54 +0000 (21:34 +0200)

gitweb: generate parent..current URLs

If use_pathinfo is enabled, href now creates links that contain paths in
the form $project/$action/oldhash:/oldname..newhash:/newname for actions
that use hash_parent etc.

If any of the filename contains two consecutive dots, it's kept as a CGI
parameter since the resulting path would otherwise be ambiguous.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: parse parent..current syntax from PATH_INFOGiuseppe Bilotta Tue, 21 Oct 2008 19:34:53 +0000 (21:34 +0200)

gitweb: parse parent..current syntax from PATH_INFO

This patch makes it possible to use an URL such as
project/action/somebranch..otherbranch:/filename to get a diff between
different version of a file. Paths like
project/action/somebranch:/somefile..otherbranch:/otherfile are parsed
as well.

All '*diff' actions and in general actions that use $hash_parent[_base]
and $file_parent (e.g. 'shortlog') can now get all of their parameters
from PATH_INFO

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: use_pathinfo filenames start with /Giuseppe Bilotta Tue, 21 Oct 2008 19:34:52 +0000 (21:34 +0200)

gitweb: use_pathinfo filenames start with /

Generate PATH_INFO URLs in the form project/action/hash_base:/filename
rather than project/action/hash_base:filename (the latter form is still
accepted in input).

This minimal change allows relative navigation to work properly when
viewing HTML files in raw ('blob_plain') mode.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: generate project/action/hash URLsGiuseppe Bilotta Tue, 21 Oct 2008 19:34:51 +0000 (21:34 +0200)

gitweb: generate project/action/hash URLs

When generating path info URLs, reduce the number of CGI parameters by
embedding action and hash_parent:filename or hash in the path.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: parse project/action/hash_base:filename PATH_INFOGiuseppe Bilotta Tue, 21 Oct 2008 19:34:50 +0000 (21:34 +0200)

gitweb: parse project/action/hash_base:filename PATH_INFO

This patch enables gitweb to parse URLs with more information embedded
in PATH_INFO, reducing the need for CGI parameters. The typical gitweb
path is now $project/$action/$hash_base:$file_name or
$project/$action/$hash

This is mostly backwards compatible with the old-style gitweb paths,
$project/$branch[:$filename], except when it was used to access a branch
whose name matches a gitweb action.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

blame: use xdi_diff_hunks(), get rid of struct patchRené Scharfe Sat, 25 Oct 2008 13:31:36 +0000 (15:31 +0200)

blame: use xdi_diff_hunks(), get rid of struct patch

Based on a patch by Brian Downing, this replaces the struct patch based
code for blame passing with calls to xdi_diff_hunks(). This way we
avoid generating and then parsing patches; we only let the interesting
infos be passed to our callbacks instead. This makes blame a bit faster:

$ blame="./git blame -M -C -C -p --incremental v1.6.0"

# master
$ /usr/bin/time $blame Makefile >/dev/null
1.38user 0.14system 0:01.52elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+12226minor)pagefaults 0swaps
$ /usr/bin/time $blame cache.h >/dev/null
1.66user 0.13system 0:01.80elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+12262minor)pagefaults 0swaps

# this patch series
$ /usr/bin/time $blame Makefile >/dev/null
1.27user 0.12system 0:01.40elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+11836minor)pagefaults 0swaps
$ /usr/bin/time $blame cache.h >/dev/null
1.52user 0.12system 0:01.70elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+12052minor)pagefaults 0swaps

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add xdi_diff_hunks() for callers that only need hunk... René Scharfe Sat, 25 Oct 2008 13:31:15 +0000 (15:31 +0200)

add xdi_diff_hunks() for callers that only need hunk lengths

Based on a patch by Brian Downing, this uses the xdiff emit_func feature
to implement xdi_diff_hunks(). It's a function that calls a callback for
each hunk of a diff, passing its lengths.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Allow alternate "low-level" emit function from xdl_diffBrian Downing Sat, 25 Oct 2008 13:30:54 +0000 (15:30 +0200)

Allow alternate "low-level" emit function from xdl_diff

For some users (e.g. git blame), getting textual patch output is just
extra work, as they can get all the information they need from the low-
level diff structures. Allow for an alternate low-level emit function
to be defined to allow bypassing the textual patch generation; set
xemitconf_t's emit_func member to enable this.

The (void (*)()) type is pretty ugly, but the alternative would be to
include most of the private xdiff headers in xdiff.h to get the types
required for the "proper" function prototype. Also, a (void *) won't
work, as ANSI C doesn't allow a function pointer to be cast to an
object pointer.

Signed-off-by: Brian Downing <bdowning@lavos.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Always initialize xpparam_t to 0Brian Downing Sat, 25 Oct 2008 13:30:37 +0000 (15:30 +0200)

Always initialize xpparam_t to 0

We're going to be adding some parameters to this, so we can't have
any uninitialized data in it.

Signed-off-by: Brian Downing <bdowning@lavos.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

blame: inline get_patch()René Scharfe Sat, 25 Oct 2008 13:30:22 +0000 (15:30 +0200)

blame: inline get_patch()

Inline get_patch() to its only call site as a preparation for getting rid
of struct patch. Also we don't need to check the ptr members because
fill_origin_blob() already did, and the caller didn't check for NULL
anyway, so drop the test.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-daemon: set REMOTE_ADDR to client addressJoey Hess Fri, 24 Oct 2008 05:48:50 +0000 (01:48 -0400)

git-daemon: set REMOTE_ADDR to client address

This allows hooks like pre-receive to look at the client's IP
address.

Of course the IP address can't be used to get strong security;
git-daemon isn't the right thing to use if you need that. However,
basic IP address checking can be good enough in some situations.

REMOTE_ADDR is the same environment variable used to communicate the
client's address to CGI scripts.

Signed-off-by: Joey Hess <joey@kitenet.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: change dashed git-config to git configDeskin Miller Thu, 23 Oct 2008 19:21:34 +0000 (15:21 -0400)

git-svn: change dashed git-config to git config

Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

index-pack: don't leak leaf delta resultNicolas Pitre Thu, 23 Oct 2008 19:05:59 +0000 (15:05 -0400)

index-pack: don't leak leaf delta result

Another (but minor this time) fallout from commit 9441b61 (index-pack:
rationalize delta resolution code, 2008-10-17).

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

improve index-pack testsNicolas Pitre Thu, 23 Oct 2008 00:59:22 +0000 (20:59 -0400)

improve index-pack tests

Commit 9441b61dc5 introduced serious bugs in index-pack which are
described and fixed by commit ce3f6dc655. However, despite the
boldness of those bugs, the test suite still passed.

This improves t5302-pack-index.sh so to ensure a much better code
path coverage. With commit ce3f6dc655 reverted, 17 of the 26 tests
do fail now.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: fix some non-portable grep invocationsJeff King Wed, 22 Oct 2008 19:22:53 +0000 (15:22 -0400)

submodule: fix some non-portable grep invocations

Not all greps support "-e", but in this case we can easily convert it to a
single extended regex.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>