gitweb.git
Merge branch 'bg/format-patch-N'Junio C Hamano Wed, 14 Nov 2007 22:04:25 +0000 (14:04 -0800)

Merge branch 'bg/format-patch-N'

* bg/format-patch-N:
Rearrange git-format-patch synopsis to improve clarity.
format-patch: Test --[no-]numbered and format.numbered
format-patch: Add configuration and off switch for --numbered

Merge branch 'np/progress'Junio C Hamano Wed, 14 Nov 2007 22:04:19 +0000 (14:04 -0800)

Merge branch 'np/progress'

* np/progress:
nicer display of thin pack completion
make display of total transferred fully accurate
remove dead code from the csum-file interface
git-fetch: be even quieter.
make display of total transferred more accurate
sideband.c: ESC is spelled '\033' not '\e' for portability.
fix display overlap between remote and local progress

Merge branch 'js/rebase-detached'Junio C Hamano Wed, 14 Nov 2007 22:04:06 +0000 (14:04 -0800)

Merge branch 'js/rebase-detached'

* js/rebase-detached:
rebase: fix "rebase --continue" breakage
rebase: operate on a detached HEAD

Merge branch 'rs/pretty'Junio C Hamano Wed, 14 Nov 2007 22:03:50 +0000 (14:03 -0800)

Merge branch 'rs/pretty'

* rs/pretty:
Fix preprocessor logic that determines the availablity of strchrnul().
Simplify strchrnul() compat code
--format=pretty: avoid calculating expensive expansions twice
add strbuf_adddup()
--pretty=format: parse commit message only once
--pretty=format: on-demand format expansion
Add strchrnul()

Merge branch 'rr/cvsexportcommit-w'Junio C Hamano Wed, 14 Nov 2007 22:03:40 +0000 (14:03 -0800)

Merge branch 'rr/cvsexportcommit-w'

* rr/cvsexportcommit-w:
cvsexportcommit: Add switch to specify CVS workdir

Merge branch 'gh/cvsimport-user'Junio C Hamano Wed, 14 Nov 2007 22:03:27 +0000 (14:03 -0800)

Merge branch 'gh/cvsimport-user'

* gh/cvsimport-user:
git-cvsimport: fix handling of user name when it is not set in CVSROOT

user-manual: minor rewording for clarity.Sergei Organov Wed, 14 Nov 2007 20:08:15 +0000 (12:08 -0800)

user-manual: minor rewording for clarity.

Junio screwed up when applying the previous round of the patch;
rewording from "previous" to "old" does make the description
clearer.

Also revert the rewording from head to branch. The description
is talking about the branch's tip commit and using the word head
is clearer.

Based on input from Sergei and Bruce.

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

Merge branch 'maint'Junio C Hamano Wed, 14 Nov 2007 11:37:18 +0000 (03:37 -0800)

Merge branch 'maint'

* maint:
git-clean: honor core.excludesfile
Documentation: Fix man page breakage with DocBook XSL v1.72
git-remote.txt: fix typo
core-tutorial.txt: Fix argument mistake in an example.
replace reference to git-rm with git-reset in git-commit doc
Grammar fixes for gitattributes documentation
Don't allow fast-import tree delta chains to exceed maximum depth
revert/cherry-pick: allow starting from dirty work tree.
t/t3404: fix test for a bogus todo file.

Conflicts:

fast-import.c

Fix dependencies of parse-options test programAlex Riesen Tue, 13 Nov 2007 23:16:36 +0000 (00:16 +0100)

Fix dependencies of parse-options test program

A stale test-parse-options can break t0040 otherwise.

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

user-manual.txt: fix a few mistakesSergei Organov Tue, 13 Nov 2007 18:19:39 +0000 (21:19 +0300)

user-manual.txt: fix a few mistakes

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-clean: honor core.excludesfileJunio C Hamano Wed, 14 Nov 2007 09:54:43 +0000 (01:54 -0800)

git-clean: honor core.excludesfile

git-clean did not honor core.excludesfile configuration
variable, although some other commands such as git-add and
git-status did. Fix this inconsistency.

Original report and patch from Shun'ichi Fuji. Rewritten by me
and bugs and tests are mine.

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

Documentation: Fix man page breakage with DocBook XSL... Jonas Fonseca Wed, 14 Nov 2007 09:38:46 +0000 (10:38 +0100)

Documentation: Fix man page breakage with DocBook XSL v1.72

From version 1.72 it will replace all dots in roff requests with U+2302
("house" character), and add escaping in output for all instances of dot
that are not in roff requests. This caused the ".ft" hack forcing
monospace font in listingblocks to end up as "\&.ft" and being visible
in the resulting man page.

The fix adds a DOCBOOK_XSL_172 build variable that will disable the
hack. To allow this variable to be defined in config.mak it also moves
build variable handling below the inclusion of config.mak.

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

Handle broken vsnprintf implementations in strbufShawn O. Pearce Tue, 13 Nov 2007 08:22:44 +0000 (03:22 -0500)

Handle broken vsnprintf implementations in strbuf

Solaris 9's vsnprintf implementation returns -1 if we pass it a
buffer of length 0. The only way to get it to give us the actual
length necessary for the formatted string is to grow the buffer
out to have at least 1 byte available in the strbuf and then ask
it to compute the length.

If the available space is 0 I'm growing it out by 64 to ensure
we will get an accurate length estimate from all implementations.
Some callers may need to grow the strbuf again but 64 should be a
reasonable enough initial growth.

We also no longer silently fail to append to the string when we are
faced with a broken vsnprintf implementation. On Solaris 9 this
silent failure caused me to no longer be able to execute "git clone"
as we tried to exec the empty string rather than "git-clone".

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote.txt: fix typoSergei Organov Tue, 13 Nov 2007 18:17:47 +0000 (21:17 +0300)

git-remote.txt: fix typo

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

core-tutorial.txt: Fix argument mistake in an example.Sergei Organov Sat, 10 Nov 2007 13:17:33 +0000 (16:17 +0300)

core-tutorial.txt: Fix argument mistake in an example.

One of examples has wrong output given the arguments provided.
Fix arguments to match the output.

Fix a minor syntax mistake in another place.

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

replace reference to git-rm with git-reset in git-commi... Jing Xue Mon, 12 Nov 2007 04:43:00 +0000 (23:43 -0500)

replace reference to git-rm with git-reset in git-commit doc

The message in git-commit suggesting to use 'git rm --cached'
to unstage is just plain wrong. It really should mention 'git reset'.

Suggested by Jan Hudec.

Signed-off-by: Jing Xue <jingxue@digizenstudio.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Grammar fixes for gitattributes documentationWincent Colaiuta Wed, 14 Nov 2007 07:51:41 +0000 (08:51 +0100)

Grammar fixes for gitattributes documentation

Tweak the "filter" section of the gitattributes documentation to add
some
missing articles and improve some word choices without changing the
semantics of the section.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Don't allow fast-import tree delta chains to exceed... Shawn O. Pearce Wed, 14 Nov 2007 04:48:42 +0000 (23:48 -0500)

Don't allow fast-import tree delta chains to exceed maximum depth

Brian Downing noticed fast-import can produce tree depths of up
to 6,035 objects and even deeper. Long delta chains can create
very small packfiles but cause problems during repacking as git
needs to unpack each tree to count the reachable blobs.

What's happening here is the active branch cache isn't big enough.
We're swapping out the branch and thus recycling the tree information
(struct tree_content) back into the free pool. When we later reload
the tree we set the delta_depth to 0 but we kept the tree we just
reloaded as a delta base.

So if the tree we reloaded was already at the maximum depth we
wouldn't know it and make the new tree a delta. Multiply the
number of times the branch cache has to swap out the tree times
max_depth (10) and you get the maximum delta depth of a tree created
by fast-import. In Brian's case above the active branch cache had
to swap the branch out 603/604 times during this import to produce
a tree with a delta depth of 6035.

Acked-by: Brian Downing <bdowning@lavos.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Resurrect git-revert.sh example and add comment to... Junio C Hamano Tue, 13 Nov 2007 21:45:11 +0000 (13:45 -0800)

Resurrect git-revert.sh example and add comment to builtin-revert.c

I had to scratch my head for quite some time figuring out why we
cannot optimize out write_tree() we do when --no-commit option
is given, whose purpose seem to be only to check if the index is
unmerged, with a simple loop over the active_cache[].

So add a comment to describe why the write_tree() is there, and
resurrect the last scripted version as a reference material in
contrib/example directory with others.

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

revert/cherry-pick: allow starting from dirty work... Junio C Hamano Tue, 13 Nov 2007 20:28:53 +0000 (12:28 -0800)

revert/cherry-pick: allow starting from dirty work tree.

There is no reason to forbid a dirty work tree when reverting or
cherry-picking a change, as long as the index is clean.

The scripted version used to allow it:

case "$no_commit" in
t)
# We do not intend to commit immediately. We just want to
# merge the differences in.
head=$(git-write-tree) ||
die "Your index file is unmerged."
;;
*)
head=$(git-rev-parse --verify HEAD) ||
die "You do not have a valid HEAD"
files=$(git-diff-index --cached --name-only $head) || exit
if [ "$files" ]; then
die "Dirty index: cannot $me (dirty: $files)"
fi
;;
esac

but C rewrite tightened the check, probably by mistake.

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

t/t3404: fix test for a bogus todo file.Junio C Hamano Tue, 13 Nov 2007 21:05:50 +0000 (13:05 -0800)

t/t3404: fix test for a bogus todo file.

The test wants to see if there are still remaining tasks, but checked
a wrong file.

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

Fix preprocessor logic that determines the availablity... Johannes Sixt Mon, 12 Nov 2007 10:09:05 +0000 (11:09 +0100)

Fix preprocessor logic that determines the availablity of strchrnul().

Apart from the error in the condition (&& should actually be ||), the
construct

#if !defined(A) || !A

leads to a syntax error in the C preprocessor if A is indeed not defined.

Tested-by: David Symonds <dsymonds@gmail.com>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-clean: Fix error message if clean.requireForce... Johannes Sixt Mon, 12 Nov 2007 08:27:35 +0000 (09:27 +0100)

git-clean: Fix error message if clean.requireForce is not set.

It was distracting to see this error message:

clean.requireForce set and -n or -f not given; refusing to clean

even though clean.requireForce was not set at all. This patch distinguishes
the cases and gives a different message depending on whether the
configuration variable is not set or set to true.

While we are here, we also divert the error messages to stderr.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: fix "rebase --continue" breakageJohannes Schindelin Mon, 12 Nov 2007 13:11:46 +0000 (13:11 +0000)

rebase: fix "rebase --continue" breakage

The --skip case was handled properly when rebasing without --merge,
but the --continue case was not.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: support for funky branch and project names... Eric Wong Mon, 12 Nov 2007 07:37:42 +0000 (23:37 -0800)

git-svn: support for funky branch and project names over HTTP(S)

SVN requires that paths be URI-escaped for HTTP(S) repositories.
file:// and svn:// repositories do not need these rules.

Additionally, accessing individual paths inside repositories
(check_path() and get_log() do NOT require escapes to function
and in fact it breaks things).

Noticed-by: Michael J. Cohen <mjc@cruiseplanners.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: Fix references to deprecated commandsJonas Fonseca Mon, 12 Nov 2007 00:32:51 +0000 (01:32 +0100)

Documentation: Fix references to deprecated commands

... by changing git-tar-tree reference to git-archive and removing
seemingly unrelevant footnote about git-ssh-{fetch,upload}.

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

Merge branch 'maint'Junio C Hamano Mon, 12 Nov 2007 08:14:15 +0000 (00:14 -0800)

Merge branch 'maint'

* maint:
for-each-ref: fix off by one read.
git-branch: remove mention of non-existent '-b' option
git-svn: prevent dcommitting if the index is dirty.
Fix memory leak in traverse_commit_list

Merge branch 'sp/maint-plug-traverse-commit-list-leak... Junio C Hamano Mon, 12 Nov 2007 08:00:00 +0000 (00:00 -0800)

Merge branch 'sp/maint-plug-traverse-commit-list-leak' into maint

* sp/maint-plug-traverse-commit-list-leak:
Fix memory leak in traverse_commit_list

for-each-ref: fix off by one read.Christian Couder Mon, 12 Nov 2007 04:37:25 +0000 (05:37 +0100)

for-each-ref: fix off by one read.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-branch: remove mention of non-existent '-b' optionJeff King Mon, 12 Nov 2007 04:07:05 +0000 (23:07 -0500)

git-branch: remove mention of non-existent '-b' option

This looks like a cut and paste error from the git-checkout
explanation of --no-track.

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

git-svn: prevent dcommitting if the index is dirty.Benoit Sigoure Sun, 11 Nov 2007 18:41:41 +0000 (19:41 +0100)

git-svn: prevent dcommitting if the index is dirty.

dcommit uses rebase to sync the history with what has just been pushed to
SVN. Trying to dcommit with a dirty index is troublesome for rebase, so now
the user will get an error message if he attempts to dcommit with a dirty
index.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'js/upload-pack'Junio C Hamano Sun, 11 Nov 2007 23:19:57 +0000 (15:19 -0800)

Merge branch 'js/upload-pack'

* js/upload-pack:
upload-pack: Use finish_{command,async}() instead of waitpid().

Merge branch 'js/reset'Junio C Hamano Sun, 11 Nov 2007 23:19:24 +0000 (15:19 -0800)

Merge branch 'js/reset'

* js/reset:
builtin-reset: avoid forking "update-index --refresh"
builtin-reset: do not call "ls-files --unmerged"

Merge branch 'js/parseopt-abbrev-fix'Junio C Hamano Sun, 11 Nov 2007 23:12:06 +0000 (15:12 -0800)

Merge branch 'js/parseopt-abbrev-fix'

* js/parseopt-abbrev-fix:
parse-options: abbreviation engine fix.

Merge branch 'maint'Junio C Hamano Sun, 11 Nov 2007 23:00:05 +0000 (15:00 -0800)

Merge branch 'maint'

* maint:
fix index-pack with packs >4GB containing deltas on 32-bit machines
git-hash-object should honor config variables
gitweb: correct month in date display for atom feeds

push: teach push to pass --verbose option to transport... Steffen Prohaska Sun, 11 Nov 2007 14:01:44 +0000 (15:01 +0100)

push: teach push to pass --verbose option to transport layer

A --verbose option to push should also be passed to the
transport layer, i.e. git-send-pack, git-http-push.

git push is modified to do so.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

push: mention --verbose option in documentationSteffen Prohaska Sun, 11 Nov 2007 14:01:43 +0000 (15:01 +0100)

push: mention --verbose option in documentation

Before this commit, only '-v' was documented.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Simplify strchrnul() compat codeAndreas Ericsson Sat, 10 Nov 2007 11:55:48 +0000 (12:55 +0100)

Simplify strchrnul() compat code

strchrnul() was introduced in glibc in April 1999 and included in
glibc-2.1. Checking for that version means the majority of all git
users would get to use the optimized version in glibc. Of the
remaining few some might get to use a slightly slower version
than necessary but probably not slower than what we have today.

Unfortunately, __GLIBC_PREREQ() macro was not available in glibc 2.1.1
which was short lived but already supported strchrnul(). Odd minority
users of that library needs to live with our compatibility inline version.

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

fix index-pack with packs >4GB containing deltas on... Nicolas Pitre Sun, 11 Nov 2007 04:29:10 +0000 (23:29 -0500)

fix index-pack with packs >4GB containing deltas on 32-bit machines

This probably hasn't been properly tested before. Here's a script to
create a 8GB repo with the necessary characteristics (copy the
test-genrandom executable from the Git build tree to /tmp first):

-----
#!/bin/bash

git init
git config core.compression 0

# create big objects with no deltas
for i in $(seq -w 1 2 63)
do
echo $i
/tmp/test-genrandom $i 268435456 > file_$i
git add file_$i
rm file_$i
echo "file_$i -delta" >> .gitattributes
done

# create "deltifiable" objects in between big objects
for i in $(seq -w 2 2 64)
do
echo "$i $i $i" >> grow
cp grow file_$i
git add file_$i
rm file_$i
done
rm grow

# create a pack with them
git commit -q -m "commit of big objects interlaced with small deltas"
git repack -a -d
-----

Then clone this repo over the Git protocol.

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

git-hash-object should honor config variablesNicolas Pitre Sat, 10 Nov 2007 20:00:33 +0000 (15:00 -0500)

git-hash-object should honor config variables

... such as core.compression.

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

--format=pretty: avoid calculating expensive expansions... René Scharfe Sat, 10 Nov 2007 11:18:26 +0000 (12:18 +0100)

--format=pretty: avoid calculating expensive expansions twice

As Jeff King remarked, format strings with duplicate placeholders can
be slow to expand, because each instance is calculated anew.

This patch makes use of the fact that format_commit_message() and its
helper functions only ever add stuff to the end of the strbuf. For
certain expensive placeholders, store the offset and length of their
expansion with the strbuf at the first occurrence. Later they
expansion result can simply be copied from there -- no malloc() or
strdup() required.

These certain placeholders are the abbreviated commit, tree and
parent hashes, as the search for a unique abbreviated hash is quite
costly. Here are the times for next (best of three runs):

$ time git log --pretty=format:%h >/dev/null

real 0m0.611s
user 0m0.404s
sys 0m0.204s

$ time git log --pretty=format:%h%h%h%h >/dev/null

real 0m1.206s
user 0m0.744s
sys 0m0.452s

And here those with this patch (and the previous two); the speedup
of the single placeholder case is just noise:

$ time git log --pretty=format:%h >/dev/null

real 0m0.608s
user 0m0.416s
sys 0m0.192s

$ time git log --pretty=format:%h%h%h%h >/dev/null

real 0m0.639s
user 0m0.488s
sys 0m0.140s

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

add strbuf_adddup()René Scharfe Sat, 10 Nov 2007 11:16:05 +0000 (12:16 +0100)

add strbuf_adddup()

Add a new function, strbuf_adddup(), that appends a duplicate of a
part of a struct strbuf to end of the latter.

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

--pretty=format: parse commit message only onceRené Scharfe Sat, 10 Nov 2007 11:14:20 +0000 (12:14 +0100)

--pretty=format: parse commit message only once

As Jeff King pointed out, some placeholder expansions are related to
each other: the steps to calculate one go most of the way towards
calculating the other, too.

This patch makes format_commit_message() parse the commit message
only once, remembering the position of each item. This speeds up
handling of format strings containing multiple placeholders from the
set %s, %a*, %c*, %e, %b.

Here are the timings for the git version in next. The first one is
to estimate the overhead of the caching, the second one is taken
from http://svn.tue.mpg.de/tentakel/trunk/tentakel/Makefile as an
example of a format string found in the wild. The times are the
fastest of three consecutive runs in each case:

$ time git log --pretty=format:%e >/dev/null

real 0m0.381s
user 0m0.340s
sys 0m0.024s

$ time git log --pretty=format:"* %cd %cn%n%n%s%n%b" >/dev/null

real 0m0.623s
user 0m0.556s
sys 0m0.052s

And here the times with this patch:

$ time git log --pretty=format:%e >/dev/null

real 0m0.385s
user 0m0.332s
sys 0m0.040s

$ time git log --pretty=format:"* %cd %cn%n%n%s%n%b" >/dev/null

real 0m0.563s
user 0m0.504s
sys 0m0.048s

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

gitweb: correct month in date display for atom feedsVincent Zanotti Sat, 10 Nov 2007 18:55:27 +0000 (19:55 +0100)

gitweb: correct month in date display for atom feeds

Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib.sh: move error line after error() declarationMichele Ballabio Sat, 10 Nov 2007 14:17:25 +0000 (15:17 +0100)

test-lib.sh: move error line after error() declaration

This patch removes a spurious "command not found" error
and actually makes the "Test script did not set test_description."
string follow the command line option "--no-color".

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

for-each-ref: fix setup of option-parsing for --sortLars Hjemli Sat, 10 Nov 2007 16:47:54 +0000 (17:47 +0100)

for-each-ref: fix setup of option-parsing for --sort

The option value for --sort is already a pointer to a pointer to struct
ref_sort, so just use it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sat, 10 Nov 2007 10:06:30 +0000 (02:06 -0800)

Merge branch 'maint'

* maint:
print warning/error/fatal messages in one shot

core-tutorial.txt: Fix git-show-branch example and... Sergei Organov Thu, 8 Nov 2007 15:10:28 +0000 (18:10 +0300)

core-tutorial.txt: Fix git-show-branch example and its description

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix memory leak in traverse_commit_listShawn O. Pearce Fri, 9 Nov 2007 11:06:10 +0000 (06:06 -0500)

Fix memory leak in traverse_commit_list

If we were listing objects too then the objects were buffered in an
array only reachable from a stack allocated structure. When this
function returns that array would be leaked as nobody would have
a reference to it anymore.

Historically this hasn't been a problem as the primary user of
traverse_commit_list() (the noble git-rev-list) would terminate
as soon as the function was finished, thus allowing the operating
system to cleanup memory. However we have been leaking this data
in git-pack-objects ever since that program learned how to run the
revision listing internally, rather than relying on reading object
names from git-rev-list.

To better facilitate reuse of traverse_commit_list during other
builtin tools (such as git-fetch) we shouldn't leak temporary memory
like this and instead we need to clean up properly after ourselves.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-commit: a bit more testsJunio C Hamano Sat, 10 Nov 2007 09:49:34 +0000 (01:49 -0800)

git-commit: a bit more tests

Add tests for -s (sign-off) and multiple -m options

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

print warning/error/fatal messages in one shotNicolas Pitre Fri, 9 Nov 2007 19:33:54 +0000 (14:33 -0500)

print warning/error/fatal messages in one shot

Not doing so is likely to create a messed up display when sent over the
sideband protocol.

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

builtin-blame: set up the work_tree before the first... Johannes Schindelin Fri, 9 Nov 2007 11:34:07 +0000 (11:34 +0000)

builtin-blame: set up the work_tree before the first file access

We check in cmd_blame() if the specified path is there, but we
failed to set up the working tree before that.

While at it, make setup_work_tree() just return if it was run
before.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add a howto document about corrupted blob recoveryNicolas Pitre Fri, 9 Nov 2007 17:28:19 +0000 (12:28 -0500)

add a howto document about corrupted blob recovery

Extracted from a post by Linus on the mailing list.

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

Documentation: remove documentation for removed tools.Junio C Hamano Fri, 9 Nov 2007 01:22:44 +0000 (17:22 -0800)

Documentation: remove documentation for removed tools.

Old commit walkers other than http/curl transport have been removed
for some time now. Remove their documents.

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

Make check-docs target detect removed commandsJunio C Hamano Fri, 9 Nov 2007 02:38:27 +0000 (18:38 -0800)

Make check-docs target detect removed commands

The maintainer should remember running "make check-docs" from
time to time.

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

Documentation: lost-found is now deprecated.Junio C Hamano Fri, 9 Nov 2007 01:21:48 +0000 (17:21 -0800)

Documentation: lost-found is now deprecated.

This makes it possible to mark commands that are deprecated in the
command list of the primary manual page git(7), and uses it to
mark "git lost-found" and "git tar-tree" as deprecated.

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

rebase: operate on a detached HEADJohannes Schindelin Thu, 8 Nov 2007 18:19:08 +0000 (18:19 +0000)

rebase: operate on a detached HEAD

The interactive version of rebase does all the operations on a detached
HEAD, so that after a successful rebase, <branch>@{1} is the pre-rebase
state. The reflogs of "HEAD" still show all the actions in detail.

This teaches the non-interactive version to do the same.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

--pretty=format: on-demand format expansionRené Scharfe Fri, 9 Nov 2007 00:49:42 +0000 (01:49 +0100)

--pretty=format: on-demand format expansion

Some of the --pretty=format placeholders expansions are expensive to
calculate. This is made worse by the current code's use of
interpolate(), which requires _all_ placeholders are to be prepared
up front.

One way to speed this up is to check which placeholders are present
in the format string and to prepare only the expansions that are
needed. That still leaves the allocation overhead of interpolate().

Another way is to use a callback based approach together with the
strbuf library to keep allocations to a minimum and avoid string
copies. That's what this patch does. It introduces a new strbuf
function, strbuf_expand().

The function takes a format string, list of placeholder strings,
a user supplied function 'fn', and an opaque pointer 'context'
to tell 'fn' what thingy to operate on.

The function 'fn' is expected to accept a strbuf, a parsed
placeholder string and the 'context' pointer, and append the
interpolated value for the 'context' thingy, according to the
format specified by the placeholder.

Thanks to Pierre Habouzit for his suggestion to use strchrnul() and
the code surrounding its callsite. And thanks to Junio for most of
this commit message. :)

Here my measurements of most of Paul Mackerras' test cases that
highlighted the performance problem (best of three runs):

(master)
$ time git log --pretty=oneline >/dev/null

real 0m0.390s
user 0m0.340s
sys 0m0.040s

(master)
$ time git log --pretty=raw >/dev/null

real 0m0.434s
user 0m0.408s
sys 0m0.016s

(master)
$ time git log --pretty="format:%H {%P} %ct" >/dev/null

real 0m1.347s
user 0m0.080s
sys 0m1.256s

(interp_find_active -- Dscho)
$ time ./git log --pretty="format:%H {%P} %ct" >/dev/null

real 0m0.694s
user 0m0.020s
sys 0m0.672s

(strbuf_expand -- this patch)
$ time ./git log --pretty="format:%H {%P} %ct" >/dev/null

real 0m0.395s
user 0m0.352s
sys 0m0.028s

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

Add strchrnul()René Scharfe Fri, 9 Nov 2007 00:49:36 +0000 (01:49 +0100)

Add strchrnul()

As suggested by Pierre Habouzit, add strchrnul(). It's a useful GNU
extension and can simplify string parser code. There are several
places in git that can be converted to strchrnul(); as a trivial
example, this patch introduces its usage to builtin-fetch--tool.c.

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

git-cvsimport: fix handling of user name when it is... Gordon Hopper Thu, 8 Nov 2007 20:15:20 +0000 (13:15 -0700)

git-cvsimport: fix handling of user name when it is not set in CVSROOT

The cvs programs do not default to "anonymous" as the user name, but use the
currently logged in user. This patch more closely matches the cvs behavior.

Signed-off-by: Gordon Hopper <g.hopper@computer.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes for 1.5.4Junio C Hamano Fri, 9 Nov 2007 08:32:38 +0000 (00:32 -0800)

Update draft release notes for 1.5.4

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

Merge branch 'maint'Junio C Hamano Fri, 9 Nov 2007 08:21:44 +0000 (00:21 -0800)

Merge branch 'maint'

* maint:
Start preparing for 1.5.3.6
git-send-email: Change the prompt for the subject of the initial message.
SubmittingPatches: improve the 'Patch:' section of the checklist
instaweb: Minor cleanups and fixes for potential problems
stop t1400 hiding errors in tests
Makefile: add missing dependency on wt-status.h
refresh_index_quietly(): express "optional" nature of index writing better
Fix sed string regex escaping in module_name.
Avoid a few unportable, needlessly nested "...`...".
git-mailsplit: with maildirs not only process cur/, but also new/

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

git-bisect.sh: Fix sed script to work with AIX and... Ralf Wildenhues Thu, 8 Nov 2007 21:48:24 +0000 (22:48 +0100)

git-bisect.sh: Fix sed script to work with AIX and BSD sed.

\n is not portable in a s/// replacement string, only
in the regex part. backslash-newline helps.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Start preparing for 1.5.3.6Junio C Hamano Fri, 9 Nov 2007 08:17:26 +0000 (00:17 -0800)

Start preparing for 1.5.3.6

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

git-send-email: Change the prompt for the subject of... Benoit Sigoure Thu, 8 Nov 2007 18:56:28 +0000 (19:56 +0100)

git-send-email: Change the prompt for the subject of the initial message.

I never understood what this prompt was asking for until I read the actual
source code. I think this wording is much more understandable.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

SubmittingPatches: improve the 'Patch:' section of... Sergei Organov Thu, 8 Nov 2007 16:40:25 +0000 (19:40 +0300)

SubmittingPatches: improve the 'Patch:' section of the checklist

There were 2 items "send patch to..." but having different set of
addresses to send patch to. Merge them together and move the resulting
item to the end of checklist.

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

instaweb: Minor cleanups and fixes for potential problemsJonas Fonseca Thu, 8 Nov 2007 23:21:42 +0000 (00:21 +0100)

instaweb: Minor cleanups and fixes for potential problems

Fix path quoting and test of empty values that some shells do not like.
Remove duplicate check and setting of $browser.

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

stop t1400 hiding errors in testsAlex Riesen Thu, 8 Nov 2007 23:41:39 +0000 (00:41 +0100)

stop t1400 hiding errors in tests

The last rm in the test was lacking an "&&" before it,
which caused the errors in the commands be silently hidden.

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

Makefile: add missing dependency on wt-status.hJunio C Hamano Fri, 9 Nov 2007 00:41:56 +0000 (16:41 -0800)

Makefile: add missing dependency on wt-status.h

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

refresh_index_quietly(): express "optional" nature... Junio C Hamano Fri, 9 Nov 2007 00:24:00 +0000 (16:24 -0800)

refresh_index_quietly(): express "optional" nature of index writing better

The point of the part of the code this patch touches is that if
we modified the active_cache, we try to write it out and make it
the index file for later users to use by calling
"commit_locked_index", but we do not really care about the
failure from this sequence because it is done purely as an
optimization.

The original code called three functions primarily for their
side effects but as condition of an if statement, which is
admittedly a bad style.

Incidentally, it squelches an "empty if body" warning from gcc.

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

Fix sed string regex escaping in module_name.Ralf Wildenhues Thu, 8 Nov 2007 21:48:49 +0000 (22:48 +0100)

Fix sed string regex escaping in module_name.

When escaping a string to be used as a sed regex, it is important
to only escape active characters. Escaping other characters is
undefined according to POSIX, and in practice leads to issues with
extensions such as GNU sed's \+.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Avoid a few unportable, needlessly nested "...`...".Ralf Wildenhues Thu, 8 Nov 2007 21:47:36 +0000 (22:47 +0100)

Avoid a few unportable, needlessly nested "...`...".

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

nicer display of thin pack completionNicolas Pitre Thu, 8 Nov 2007 20:45:41 +0000 (15:45 -0500)

nicer display of thin pack completion

In the same spirit of prettifying Git's output display for mere mortals,
here's a simple extension to the progress API allowing for a final
message to be provided when terminating a progress line, and use it for
the display of the number of objects needed to complete a thin pack,
saving yet one more line of screen display.

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

Style: place opening brace of a function definition... Junio C Hamano Thu, 8 Nov 2007 23:35:32 +0000 (15:35 -0800)

Style: place opening brace of a function definition at column 1

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

contrib/hooks/post-receive-email: remove cruft, $commit... Gerrit Pape Thu, 8 Nov 2007 12:11:57 +0000 (12:11 +0000)

contrib/hooks/post-receive-email: remove cruft, $committer is not used

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

hooks--update: decline deleting tags or branches by... Gerrit Pape Thu, 8 Nov 2007 09:47:39 +0000 (09:47 +0000)

hooks--update: decline deleting tags or branches by default, add config options

Decline deleting tags or branches through git push <remote> :<ref> by
default, support config options hooks.allowdeletetag, hooks.allowdeletebranch
to override this per repository.

Before this patch the update hook interpreted deleting a tag, no matter if
annotated or not, through git push <remote> :<tag> as unannotated tag, and
declined it by default, but with an unappropriate error message:

$ git push origin :atag
deleting 'refs/tags/atag'
*** The un-annotated tag, atag, is not allowed in this repository
*** Use 'git tag [ -a | -s ]' for tags you want to propagate.
ng refs/tags/atag hook declined
error: hooks/update exited with error code 1
error: hook declined to update refs/tags/atag
error: failed to push to 'monolith:/git/qm/test-repo'

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

hooks--update: fix test for properly set up project... Gerrit Pape Thu, 8 Nov 2007 14:02:00 +0000 (14:02 +0000)

hooks--update: fix test for properly set up project description file

The update hook template intends to abort if the project description file
hasn't been adjusted or is empty. This patch fixes the check for 'being
adjusted'.

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-mailsplit: with maildirs not only process cur/... Gerrit Pape Tue, 6 Nov 2007 08:54:18 +0000 (08:54 +0000)

git-mailsplit: with maildirs not only process cur/, but also new/

When saving patches to a maildir with e.g. mutt, the files are put into
the new/ subdirectory of the maildir, not cur/. This makes git-am state
"Nothing to do.". This patch lets git-mailsplit additional check new/
after reading cur/.

This was reported by Joey Hess through
http://bugs.debian.org/447396

Signed-off-by: Gerrit Pape <pape@smarden.org>
Acked-by: Jeff King <peff@peff.net>
Acked-by: Alex Riesen <raa.lkml@gmail.com>
Acked-by: Fernando J. Pereda <ferdy@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/clean-config'Junio C Hamano Thu, 8 Nov 2007 02:19:38 +0000 (18:19 -0800)

Merge branch 'jc/clean-config'

* jc/clean-config:
clean: require -f to do damage by default

Merge branch 'gp/reset-q'Junio C Hamano Thu, 8 Nov 2007 02:18:55 +0000 (18:18 -0800)

Merge branch 'gp/reset-q'

* gp/reset-q:
git-reset: add -q option to operate quietly

Merge branch 'ds/maint-deflatebound'Junio C Hamano Thu, 8 Nov 2007 02:17:20 +0000 (18:17 -0800)

Merge branch 'ds/maint-deflatebound'

* ds/maint-deflatebound:
Improve accuracy of check for presence of deflateBound.

Merge branch 'cp/p4'Junio C Hamano Thu, 8 Nov 2007 02:16:18 +0000 (18:16 -0800)

Merge branch 'cp/p4'

* cp/p4:
git-p4: Detect changes to executable bit and include them in p4 submit.
git-p4: Add a helper function to parse the full git diff-tree output.

Merge branch 'maint'Junio C Hamano Thu, 8 Nov 2007 02:07:07 +0000 (18:07 -0800)

Merge branch 'maint'

* maint:
Add Documentation/CodingGuidelines
When exec() fails include the failing command in the error message
RelNotes-1.5.3.5: fix another typo

Merge branch 'mh/work-tree'Junio C Hamano Thu, 8 Nov 2007 01:37:00 +0000 (17:37 -0800)

Merge branch 'mh/work-tree'

* mh/work-tree:
Make git-blame fail when working tree is needed and we're not in one
Don't always require working tree for git-rm
Use setup_work_tree() in builtin-ls-files.c
Refactor working tree setup

Small code readability improvement in show_reference... Mike Hommey Sat, 3 Nov 2007 13:08:05 +0000 (14:08 +0100)

Small code readability improvement in show_reference() in builtin-tag.c

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: apply --suppress-from to S-o-b and cc-cmdUwe Kleine-König Wed, 7 Nov 2007 07:34:12 +0000 (08:34 +0100)

send-email: apply --suppress-from to S-o-b and cc-cmd

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Cc: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix minor nits in configure.acRalf Wildenhues Tue, 6 Nov 2007 20:12:45 +0000 (21:12 +0100)

Fix minor nits in configure.ac

Avoid "test -o" as it is only XSI not POSIX, and not portable.
Avoid exit(3) in test programs in favor of return, to accommodate
for newer Autoconf not providing a declaration for exit.

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

Deprecate git-lost-foundJohannes Schindelin Thu, 8 Nov 2007 00:41:22 +0000 (00:41 +0000)

Deprecate git-lost-found

"git fsck" learnt the option "--lost-found" in v1.5.3-rc0~5, to make
"git lost-found" obsolete. It is time to deprecate "git lost-found".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Improve accuracy of check for presence of deflateBound.David Symonds Wed, 7 Nov 2007 03:24:28 +0000 (14:24 +1100)

Improve accuracy of check for presence of deflateBound.

ZLIB_VERNUM isn't defined in some zlib versions, so this patch does a proper
linking test in autoconf to see whether deflateBound exists in zlib. Also,
setting NO_DEFLATE_BOUND will also work for folk not using autoconf.

Signed-off-by: David Symonds <dsymonds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add Documentation/CodingGuidelinesJohannes Schindelin Thu, 8 Nov 2007 00:33:19 +0000 (00:33 +0000)

Add Documentation/CodingGuidelines

Even if our code is quite a good documentation for our coding style,
some people seem to prefer a document describing it.

The part about the shell scripts is clearly just copied from one of
Junio's helpful mails, and some parts were added from comments by
Junio, Andreas Ericsson and Robin Rosenberg.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

make display of total transferred fully accurateNicolas Pitre Tue, 6 Nov 2007 21:30:28 +0000 (16:30 -0500)

make display of total transferred fully accurate

The minimum delay of 1/2 sec between successive throughput updates might
not have been elapsed when display_throughput() is called for the last
time, potentially making the display of total transferred bytes not
right when progress is said to be done.

Let's force an update of the throughput display as well when the
progress is complete. As a side effect, the total transferred will
always be displayed even if the actual transfer rate doesn't have time
to kickin.

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

contrib/hooks/post-receive-email: make subject prefix... Gerrit Pape Tue, 6 Nov 2007 13:49:30 +0000 (13:49 +0000)

contrib/hooks/post-receive-email: make subject prefix configurable

Email subjects are prefixed with "[SCM] " by default, make this optionally
configurable through the hooks.emailprefix config option.

Suggested by martin f krafft through
http://bugs.debian.org/428418

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/hooks/post-receive-email: reformat to wrap... Gerrit Pape Tue, 6 Nov 2007 13:48:34 +0000 (13:48 +0000)

contrib/hooks/post-receive-email: reformat to wrap comments at 76 chars

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/hooks/post-receive-email: fix typoGerrit Pape Tue, 6 Nov 2007 13:48:07 +0000 (13:48 +0000)

contrib/hooks/post-receive-email: fix typo

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

restore fetching with thin-pack capabilityNicolas Pitre Wed, 7 Nov 2007 22:20:22 +0000 (17:20 -0500)

restore fetching with thin-pack capability

Broken since commit fa74052922cf39e5a39ad7178d1b13c2da9b4519.

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

When exec() fails include the failing command in the... Ask Bjørn Hansen Tue, 6 Nov 2007 10:54:01 +0000 (02:54 -0800)

When exec() fails include the failing command in the error message

git-svn occasionally fails with no details as to what went wrong - this should help debug those situations.

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

RelNotes-1.5.3.5: fix another typoDavid D Kilzer Sun, 4 Nov 2007 12:45:22 +0000 (04:45 -0800)

RelNotes-1.5.3.5: fix another typo

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-reset: add -q option to operate quietlyGerrit Pape Sun, 4 Nov 2007 09:37:20 +0000 (09:37 +0000)

git-reset: add -q option to operate quietly

Many git commands have a -q option to suppress output to stdout, let's
have it for git-reset too.

This was asked for by Joey Hess through
http://bugs.debian.org/444933

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make git-blame fail when working tree is needed and... Mike Hommey Sat, 3 Nov 2007 12:22:55 +0000 (13:22 +0100)

Make git-blame fail when working tree is needed and we're not in one

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Don't always require working tree for git-rmMike Hommey Sat, 3 Nov 2007 11:23:13 +0000 (12:23 +0100)

Don't always require working tree for git-rm

This allows to do git rm --cached -r directory, instead of
git ls-files -z directory | git update-index --remove -z --stdin.
This can be particularly useful for git-filter-branch users.

Signed-off-by: Mike Hommey <mh@glandium.org>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>