gitweb.git
git svn: make minimize URL more reliable over http(s)Eric Wong Sat, 25 Jul 2009 20:14:16 +0000 (13:14 -0700)

git svn: make minimize URL more reliable over http(s)

In addition to path-based restrictions, Subversion servers over
http(s) may have access controls implemented via the LimitExcept
directive in Apache. In some cases, LimitExcept may be
(arguably) misconfigured to not allow REPORT requests while
allowing OPTIONS and PROPFIND.

This caused problems with our existing minimize_url logic that
only issued OPTIONS and PROPFIND requests when connecting and
using SVN::Ra::get_latest_revnum. We now call SVN::Ra::get_log
if get_latest_revnum succeeds, resulting in a REPORT request
being sent. This will increase our chances of tripping access
controls before we start attempting to fetch history.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

Disable asciidoc 8.4.1+ semantics for `{plus}` and... Thomas Rast Sat, 25 Jul 2009 12:06:50 +0000 (14:06 +0200)

Disable asciidoc 8.4.1+ semantics for `{plus}` and friends

asciidoc 8.4.1 changed the semantics of inline backtick quoting so
that they disable parsing of inline constructs, i.e.,

Input: `{plus}`
Pre 8.4.1: +
Post 8.4.1: {plus}

Fix this by defining the asciidoc attribute 'no-inline-literal'
(which, per the 8.4.1 changelog, is the toggle to return to the old
behaviour) when under ASCIIDOC8.

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

git svn: avoid escaping '/' when renaming/copying filesEric Wong Sat, 25 Jul 2009 09:29:28 +0000 (02:29 -0700)

git svn: avoid escaping '/' when renaming/copying files

Timothy Schaeffer reported the following:
> Git-svn has been giving me the following error for some time
> when calling "git svn dcommit":
>
> RA layer request failed: PROPFIND request failed on
> '/svn/stf/branches/dev/sw%2Fdpemu%2Finclude%2FNetCnxn.h': PROPFIND of
> '/svn/stf/branches/dev/sw%2Fdpemu%2Finclude%2FNetCnxn.h': 302 Found
> (https://oursvnrepo.net) at /usr/local/libexec/git-core/git-svn line 508
>
> This only occurred when git detected a rename or copy.
>
> Following the lead into git-svn.perl,
> and noticing that some of the '/'s in the path were hex-encoded
> and some were not,
> I changed the regex used to find chars
> to hex-encode in the relative part of the path
> to exclude '/'.
> It works, so far.
> I have included a patch.

While this has previous not been a problem in my experience,
newer versions of SVN may be stricter and this does not
introduce regressions in t9115.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

t9142: stop httpd after the testEric Wong Sat, 25 Jul 2009 09:11:39 +0000 (02:11 -0700)

t9142: stop httpd after the test

Otherwise it would fail in subsequent runs if the same
SVN_HTTPD_PORT was used.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

git svn: the branch command no longer needs the full... Eric Wong Sat, 25 Jul 2009 08:36:06 +0000 (01:36 -0700)

git svn: the branch command no longer needs the full path

This was introduced in 0b2af457a49e3b00d47d556d5301934d27909db8
("Fix branch detection when repository root is inaccessible")
but reintroduced in the previous commit.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

git svn: revert default behavior for --minimize-urlEric Wong Sat, 25 Jul 2009 07:00:50 +0000 (00:00 -0700)

git svn: revert default behavior for --minimize-url

This reverts the --minimize-url behavior change that
appeared recently in commit 0b2af457a49e3b00d47d556d5301934d27909db8
("Fix branch detection when repository root is inaccessible").

However, we now allow the option to be turned off by allowing
"--no-minimize-url" so people with limited-access setups can
still take advantage of the fix in
0b2af457a49e3b00d47d556d5301934d27909db8.

Also document the behavior and default settings of minimize-url
in the manpage for the first time.

This introduces a temporary UI regression to allow t9141 to pass
that will be reverted (fixed) in the next commit.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

git svn: add gc commandRobert Allan Zeh Sun, 19 Jul 2009 23:00:52 +0000 (18:00 -0500)

git svn: add gc command

Add a git svn gc command that gzips all unhandled.log files, and
removes all index files under .git/svn.

Signed-off-by: Robert Allan Zeh <robert.a.zeh@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>

git init: optionally allow a directory argumentNanako Shiraishi Fri, 24 Jul 2009 21:59:28 +0000 (06:59 +0900)

git init: optionally allow a directory argument

When starting a new repository, I see my students often say

% git init newrepo

and curse git. They could say

% mkdir newrepo; cd newrepo; git init

but allowing it as an obvious short-cut may be nicer.

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

Merge branch 'maint'Junio C Hamano Sat, 25 Jul 2009 09:16:25 +0000 (02:16 -0700)

Merge branch 'maint'

* maint:
t8005: Nobody writes Russian in shift_jis

Conflicts:
t/t8005-blame-i18n.sh

t8005: Nobody writes Russian in shift_jisJunio C Hamano Fri, 19 Jun 2009 02:18:37 +0000 (19:18 -0700)

t8005: Nobody writes Russian in shift_jis

The second and third tests of this script expected that Russian strings
are converted between ISO-8859-5 and Shift_JIS in the "blame --porcelain"
format output correctly.

Sure, many platforms may convert between such a combination, but that is
only because one of the base character set of Shift_JIS, JIS X 0208,
defines codepoints for Russian characters (among others); I do not think
anybody uses Shift_JIS when seriously writing Russian, and it is perfectly
understandable if iconv() libraries on some platforms fail converting
between this combination, as it does not matter in reality.

This patch changes the test to verify Japanese strings are converted
correctly between EUC-JP and Shift_JIS in the same procedure. The point
of the test is not about verifying the platform's iconv() library, but to
see if "git blame" makes correct iconv() library calls when it should.

We could instead use ISO-8859-5 and KOI8-R as the combination, because
they are both meant to represent Russian, in order to make this test
meaningful on more platforms, but we already use Shift_JIS vs EUC-JP
combinations to test other programs in our test suite, so this combination
is safer from the point of view of the portability. Besides, I do not
read nor write Russian; sorry ;-)

This change allows tests to pass on my (friend's) Solaris 5.11 box.

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

Merge branch 'maint'Junio C Hamano Sat, 25 Jul 2009 08:31:53 +0000 (01:31 -0700)

Merge branch 'maint'

* maint:
Fix severe breakage in "git-apply --whitespace=fix"

Fix severe breakage in "git-apply --whitespace=fix"Junio C Hamano Sat, 25 Jul 2009 08:29:20 +0000 (01:29 -0700)

Fix severe breakage in "git-apply --whitespace=fix"

735c674 (Trailing whitespace and no newline fix, 2009-07-22) completely
broke --whitespace=fix, causing it to lose all the empty lines in a patch.

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

Update release notes for 1.6.4Junio C Hamano Sat, 25 Jul 2009 07:51:21 +0000 (00:51 -0700)

Update release notes for 1.6.4

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

Merge branch 'js/maint-graft-unhide-true-parents'Junio C Hamano Sat, 25 Jul 2009 07:45:03 +0000 (00:45 -0700)

Merge branch 'js/maint-graft-unhide-true-parents'

* js/maint-graft-unhide-true-parents:
git repack: keep commits hidden by a graft
Add a test showing that 'git repack' throws away grafted-away parents

Conflicts:
git-repack.sh

Merge branch 'av/maint-config-reader'Junio C Hamano Sat, 25 Jul 2009 07:44:52 +0000 (00:44 -0700)

Merge branch 'av/maint-config-reader'

* av/maint-config-reader:
After renaming a section, print any trailing variable definitions
Make section_name_match start on '[', and return the length on success

Merge branch 'jk/maint-send-email-alias-loop'Junio C Hamano Sat, 25 Jul 2009 07:44:45 +0000 (00:44 -0700)

Merge branch 'jk/maint-send-email-alias-loop'

* jk/maint-send-email-alias-loop:
send-email: detect cycles in alias expansion

After renaming a section, print any trailing variable... Alex Vandiver Fri, 24 Jul 2009 21:21:44 +0000 (17:21 -0400)

After renaming a section, print any trailing variable definitions

Signed-off-by: Alex Vandiver <alex@chmrr.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make section_name_match start on '[', and return the... Alex Vandiver Fri, 24 Jul 2009 21:21:43 +0000 (17:21 -0400)

Make section_name_match start on '[', and return the length on success

Signed-off-by: Alex Vandiver <alex@chmrr.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: detect cycles in alias expansionJeff King Thu, 23 Jul 2009 11:09:29 +0000 (07:09 -0400)

send-email: detect cycles in alias expansion

With the previous code, an alias cycle like:

$ echo 'alias a b' >aliases
$ echo 'alias b a' >aliases
$ git config sendemail.aliasesfile aliases
$ git config sendemail.aliasfiletype mutt

would put send-email into an infinite loop. This patch
detects the situation and complains to the user.

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

Show the presence of untracked files in the bash prompt.Daniel Trstenjak Wed, 22 Jul 2009 08:31:34 +0000 (10:31 +0200)

Show the presence of untracked files in the bash prompt.

Added the envvar GIT_PS1_SHOWUNTRACKEDFILES to 'git-completion.bash'.
When set to a nonempty value, then the char '%' will be shown next
to the branch name in the bash prompt.

Signed-off-by: Daniel Trstenjak <daniel.trstenjak@science-computing.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Fri, 24 Jul 2009 16:27:09 +0000 (09:27 -0700)

Merge branch 'maint'

* maint:
SunOS grep does not understand -C<n> nor -e
Fix export_marks() error handling.
git branch: clean up detached branch handling
git branch: avoid unnecessary object lookups
git branch: fix performance problem
do_one_ref(): null_sha1 check is not about broken ref

Conflicts:
Makefile

SunOS grep does not understand -C<n> nor -eJunio C Hamano Fri, 24 Jul 2009 05:30:07 +0000 (22:30 -0700)

SunOS grep does not understand -C<n> nor -e

The first "grep -C1" test in t7002 does not pass on my SunOS-5.11-i86pc,
and that is not because our way to spawn external grep is broken, but
because the native grep does not understand -C<n>.

It turns out that Peff was also using this option himself because our
Makefile doesn't do that automatically. Brandon Casey uses SUNWspro
compiler without having to set this, and it turns out that the compiler
does not define preprocessor macro __unix__ which made him always use the
built-in grep, never an external one.

Let's be more explicit and say that we do not use external grep on Suns.

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

Fix export_marks() error handling.Matthias Andree Fri, 24 Jul 2009 08:17:13 +0000 (10:17 +0200)

Fix export_marks() error handling.

- Don't leak one FILE * on error per export_marks() call. Found with
cppcheck and reported by Martin Ettl.

- Abort the potentially long for(;idnums.size;) loop on write errors.

- Record error if fprintf() fails for reasons not required to set the
stream error indicator, such as ENOMEM.

- Add a trailing full-stop to error message when fopen() fails.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git repack: keep commits hidden by a graftJohannes Schindelin Thu, 23 Jul 2009 15:33:49 +0000 (17:33 +0200)

git repack: keep commits hidden by a graft

When you have grafts that pretend that a given commit has different
parents than the ones recorded in the commit object, it is dangerous
to let 'git repack' remove those hidden parents, as you can easily
remove the graft and end up with a broken repository.

So let's play it safe and keep those parent objects and everything
that is reachable by them, in addition to the grafted parents.

As this behavior can only be triggered by git pack-objects, and as that
command handles duplicate parents gracefully, we do not bother to cull
duplicated parents that may result by using both true and grafted
parents.

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

Add a test showing that 'git repack' throws away grafte... Björn Steinbrink Thu, 23 Jul 2009 15:33:45 +0000 (17:33 +0200)

Add a test showing that 'git repack' throws away grafted-away parents

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

git branch: clean up detached branch handlingLinus Torvalds Thu, 23 Jul 2009 19:13:48 +0000 (12:13 -0700)

git branch: clean up detached branch handling

Make the 'show detached branch info' a routine of its own. And in the
process, avoid the object lookup that is unnecessary if the current
branch isn't detached.

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

git branch: avoid unnecessary object lookupsLinus Torvalds Thu, 23 Jul 2009 19:05:34 +0000 (12:05 -0700)

git branch: avoid unnecessary object lookups

They can be expensive in the cold-cache case, so don't bother looking up
the commits for all branches unless we really need them for some reason.

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

git branch: fix performance problemLinus Torvalds Thu, 23 Jul 2009 17:17:04 +0000 (10:17 -0700)

git branch: fix performance problem

'git branch' looks at _all_ the refs, and verifies them. Which means that
during cold-cache situations with a slow disk (and lots of tags, for
example) it can take several very annoying seconds (7.5s according to a
report by Carlos R. Mafra).

This avoids most of it by simply doing the filtering before looking up
the commits, by using the "raw" version of for_each_ref.

Reported-by: Carlos R. Mafra <crmafra2@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git svn: fix shallow clone when upstream revision is... Eric Wong Mon, 20 Jul 2009 09:06:24 +0000 (02:06 -0700)

git svn: fix shallow clone when upstream revision is too new

Thanks to Ka-Hing Cheung for the initial bug report and patch:
> git-svn uses $ra->get_latest_revnum to find out the latest
> revision, but that can be problematic, because get_latest_revnum
> returns the latest revnum in the entire repository, not
> restricted by whatever URL you used to construct $ra. So if you
> do git svn clone -r HEAD svn://blah/blah/trunk, it won't work if
> the latest checkin is in one of the branches (it will try to
> fetch a rev that doesn't exist in trunk, making the clone
> useless).

Relying on SVN::Core::INVALID_REVNUM (-1) as the "start"
argument to SVN::Ra::get_log() proved unreliable with http(s)
URLs so the result of SVN::Ra::get_latest_revnum() is used as
the "start" argument instead.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

do_one_ref(): null_sha1 check is not about broken refJunio C Hamano Thu, 23 Jul 2009 06:07:05 +0000 (23:07 -0700)

do_one_ref(): null_sha1 check is not about broken ref

f8948e2 (remote prune: warn dangling symrefs, 2009-02-08) introduced a
more dangerous variant of for_each_ref() family that skips the check for
dangling refs, but it also made another unrelated check optional by
mistake.

The check to see if a ref points at 0{40} is not about brokenness, but is
about a possible future plan to represent a deleted ref by writing 40 "0"
in a loose ref when there is a stale version of the same ref already in
.git/packed-refs, so that we can implement deletion of a ref without
having to rewrite the packed refs file excluding the ref being deleted.

This check has to live outside of the conditional.

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

configure.ac: properly unset NEEDS_SSL_WITH_CRYPTO... v1.6.4-rc2Brandon Casey Wed, 22 Jul 2009 22:20:53 +0000 (17:20 -0500)

configure.ac: properly unset NEEDS_SSL_WITH_CRYPTO when sha1 func is missing

The empty assignment NEEDS_SSL_WITH_CRYPTO= was mistakenly paired with the
assignment NEEDS_SSL_WITH_CRYPTO=YesPlease in the "action-if-found"
parameter of the AC_CHECK_LIB macro. The empty assignment was intended for
the "action-if-not-found" section, since in that case, the necessary sha1
hash function was not found and the internal sha1 implementation will be
used instead.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

janitor: useless checks before freePierre Habouzit Wed, 22 Jul 2009 21:51:55 +0000 (23:51 +0200)

janitor: useless checks before free

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

janitor: add DIV_ROUND_UP and use it.Pierre Habouzit Wed, 22 Jul 2009 21:34:35 +0000 (23:34 +0200)

janitor: add DIV_ROUND_UP and use it.

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

refactor: use bitsizeof() instead of 8 * sizeof()Pierre Habouzit Wed, 22 Jul 2009 21:34:34 +0000 (23:34 +0200)

refactor: use bitsizeof() instead of 8 * sizeof()

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

janitor: use NULL and not 0 for pointers.Pierre Habouzit Wed, 22 Jul 2009 21:34:33 +0000 (23:34 +0200)

janitor: use NULL and not 0 for pointers.

Brought to you thanks to coccinelle:

---8<----
@@
expression *E;
@@
(
E ==
- 0
+ NULL
|
E !=
- 0
+ NULL
|
E =
- 0
+ NULL
)

@@
identifier f;
type T;
@@
T *f(...) {
<...
- return 0;
+ return NULL;
...>
}
--->8----

There are a lot more hits in compat/nedmallox and compat/regex but these
are borrowed code we rather do not want to maintain our own forks for,
and this patch refrains from touching them.

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

git stash: modernize use of "dashed" git-XXX callsMartin Koegler Wed, 22 Jul 2009 05:30:58 +0000 (07:30 +0200)

git stash: modernize use of "dashed" git-XXX calls

Replace remaining git-XXX calls with git XXX.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Acked-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Improve doc for format-patch threading options.Yann Dirson Wed, 22 Jul 2009 21:39:31 +0000 (23:39 +0200)

Improve doc for format-patch threading options.

This hopefully makes the relationship between threading options of
format-patch and send-email easier to grasp.

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

List send-email config options in config.txt.Yann Dirson Wed, 22 Jul 2009 21:39:30 +0000 (23:39 +0200)

List send-email config options in config.txt.

Also mention deprecated aliases that do not appear in the send-email
manpage.

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

configure.ac: rework/fix the NEEDS_RESOLV and NEEDS_LIB... Brandon Casey Tue, 21 Jul 2009 20:23:06 +0000 (15:23 -0500)

configure.ac: rework/fix the NEEDS_RESOLV and NEEDS_LIBGEN tests

The "action" parameters for these two tests were supplied incorrectly for
the way the tests were implemented. The tests check whether a program
which calls hstrerror() or basename() successfully links when -lresolv or
-lgen are used, respectively. A successful linking would result in
NEEDS_RESOLV or NEEDS_LIBGEN being unset, and failure would result in
setting the respective variable.

Aside from that issue, the tests did not handle the case where neither
library was necessary for accessing the functions in question. So solve
both of these issues by re-working the two tests so that their form is like
the NEEDS_SOCKET test which attempts to link with just the c library, and
if it fails then assumes that the additional library is necessary and sets
the appropriate variable.

Also an entry in the config.mak.in file is necessary for the NEEDS_LIBGEN
variable to appear in the config.mak.autogen file with the value assigned
by the configure script. Without it, the generated shell script would
contain a snippet like this:

for ac_lib in ; do
...

which is incorrect.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Thu, 23 Jul 2009 04:56:46 +0000 (21:56 -0700)

Merge branch 'maint'

* maint:
Trailing whitespace and no newline fix
diff --cc: a lost line at the beginning of the file is shown incorrectly
combine-diff.c: fix performance problem when folding common deleted lines

grep: Add --max-depth option.Michał Kiedrowicz Wed, 22 Jul 2009 17:52:15 +0000 (19:52 +0200)

grep: Add --max-depth option.

It is useful to grep directories non-recursively, e.g. when one wants to
look for all files in the toplevel directory, but not in any subdirectory,
or in Documentation/, but not in Documentation/technical/.

This patch adds support for --max-depth <depth> option to git-grep. If it is
given, git-grep descends at most <depth> levels of directories below paths
specified on the command line.

Note that if path specified on command line contains wildcards, this option
makes no sense, e.g.

$ git grep -l --max-depth 0 GNU -- 'contrib/*'

(note the quotes) will search all files in contrib/, even in
subdirectories, because '*' matches all files.

Documentation updates, bash-completion and simple test cases are also
provided.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Trailing whitespace and no newline fixSZEDER Gábor Thu, 23 Jul 2009 00:24:38 +0000 (19:24 -0500)

Trailing whitespace and no newline fix

If a patch adds a new line to the end of a file and this line ends with
one trailing whitespace character and has no newline, then
'--whitespace=fix' currently does not remove that trailing whitespace.

This patch fixes this by removing the check for trailing whitespace at
the end of the line at a hardcoded offset which does not take the
eventual absence of newline into account.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff --cc: a lost line at the beginning of the file... Junio C Hamano Wed, 22 Jul 2009 21:48:29 +0000 (14:48 -0700)

diff --cc: a lost line at the beginning of the file is shown incorrectly

When combine-diff inspected the diff from one parent to the merge result,
it misinterpreted a header in the form @@ -l,k +0,0 @@.

This hunk header means that K lines were removed from the beginning of the
file, so the lost lines must be queued to the sline that represents the
first line of the merge result, but we incremented our pointer incorrectly
and ended up queuing it to the second line, which in turn made the lossage
appear _after_ the first line.

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

combine-diff.c: fix performance problem when folding... Junio C Hamano Wed, 22 Jul 2009 21:48:28 +0000 (14:48 -0700)

combine-diff.c: fix performance problem when folding common deleted lines

For a deleted line in a patch with the parent we are looking at, the
append_lost() function finds the same line among a run of lines that were
deleted from the same location by patches from parents we previously
checked. This is so that patches with two parents

@@ -1,4 +1,3 @@ @@ -1,4 +1,3 @@
one one
-two -two
three three
-quatro -fyra
+four +four

can be coalesced into this sequence, reusing one line that describes the
removal of "two" for both parents.

@@@ -1,4 -1,4 +1,3 @@@
one
--two
three
- quatro
-frya
++four

While reading the second patch (that removes "two" and then "fyra"), after
finding where removal of the "two" matches, we need to find existing
removal of "fyra" (if exists) in the removal list, but the match has to
happen after all the existing matches (in this case "two"). The code used
a naïve O(n^2) algorithm to compute this by scanning the whole removal
list over and over again.

This patch remembers where the next scan should be started in the existing
removal list to avoid this.

Noticed by Linus Torvalds.

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

Fix rebase -p --ontoGreg Price Wed, 22 Jul 2009 16:38:58 +0000 (12:38 -0400)

Fix rebase -p --onto

In a rebase with --onto, the correct test for whether we can skip
rewriting a commit is if it is already on top of $ONTO, not $UPSTREAM.
Without --onto, this distinction does not exist and the behavior does
not change.

In a situation with two merged branches on a common base X:

X---o---o---o---M
\ /
x---x---x---x

Y

if we try to move the branches from their base on X to be based on Y,
so as to get

X

Y---o'--o'--o'--M'
\ /
x'--x'--x'--x'

then we fail. The command `git rebase -p --onto Y X M` moves only the
first-parent chain, like so:

X
\
x---x---x---x
\
Y---o'--o'--o'--M'

because it mistakenly drops the other branch(es) x---x---x---x from
the TODO file. This tests and fixes this behavior.

Signed-off-by: Greg Price <price@ksplice.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git svn: fix reparenting when ugly http(s) URLs are... Eric Wong Mon, 20 Jul 2009 05:08:45 +0000 (22:08 -0700)

git svn: fix reparenting when ugly http(s) URLs are used

Mishandling of http(s) in need of escaping was causing
t9118-git-svn-funky-branch-names to fail when SVN_HTTPD_PORT
was defined.

This bug was exposed in (but not caused by)
commit 0b2af457a49e3b00d47d556d5301934d27909db8
(Fix branch detection when repository root is inaccessible)

Signed-off-by: Eric Wong <normalperson@yhbt.net>

git svn: rename tests that had conflicting numbersEric Wong Sun, 19 Jul 2009 10:08:27 +0000 (03:08 -0700)

git svn: rename tests that had conflicting numbers

Some unrelated tests were developed simultaneously and resulted
in test numbers conflicting. To avoid difficulty when referring
to tests via the "tXXXX" convention, rename the newer tests.

Suggested by Marc Branchaud.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

show: add space between multiple itemsJeff King Sat, 18 Jul 2009 10:14:37 +0000 (06:14 -0400)

show: add space between multiple items

When showing an annotated tag, "git show" will always
display the pointed-to object. However, it didn't separate
the two with whitespace, making it more difficult to notice
where the new object started. For example:

$ git tag -m 'my message' foo
$ git show foo
tag foo
Tagger: Jeff King <peff@peff.net>
Date: Fri Jul 17 18:46:25 2009 -0400

my message
commit 41cabf8fed2694ba33e01d64f9094f2fc5e5805a
Author: Jeff King <peff@peff.net>
Date: Thu Jul 16 17:31:34 2009 -0400
...

This patch respects and sets the rev.shown_one member to
prepend a blank line before showing a second item. We use
this member of rev_info instead of a local flag, because the
log_tree_commit we call into for showing commits already
respects and sets that flag. Meaning that everything will be
spaced properly if you intermix commits and tags, like:

$ git show v1.6.3 v1.6.2 HEAD

In that case, a single blank line will separate the first
tag, the commit it points to, the second tag, the commit
that one points to, and the final commit.

While we're at it, let's also support trees, so that even
something as crazy as

$ git show HEAD^{tree} HEAD~1^{tree} HEAD

will also be spaced in an easy-to-read way. However, we
intentionally do _not_ insert blank lines for blobs, so
that specifying multiple blobs gives a strict concatenation.

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

show: suppress extra newline when showing annotated tagJeff King Fri, 17 Jul 2009 23:18:34 +0000 (19:18 -0400)

show: suppress extra newline when showing annotated tag

When showing a tag, our header parsing finishes with the
offset pointing to the newline separating the tag header
from the tag body. This means that the printed body will
always start with a newline.

However, we also add an extra newline when printing the
tagger information. This leads to an ugly double-newline:

$ git show v1.6.3
tag v1.6.3
Tagger: Junio C Hamano <gitster@pobox.com>
Date: Wed May 6 18:16:47 2009 -0700

GIT 1.6.3
-----BEGIN PGP SIGNATURE-----
...

This patch removes the extra newline from the end of the
tagger headers. This is a better solution than suppressing
the separator newline, because it retains the behavior for
tags which have no tagger. E.g., "git show v0.99" will
continue to look like:

$ git show v0.99
tag v0.99

Test-release for wider distribution.
...

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

pull: support rebased upstream + fetch + pull --rebaseSanti Béjar Sun, 19 Jul 2009 07:45:16 +0000 (09:45 +0200)

pull: support rebased upstream + fetch + pull --rebase

You cannot do a "git pull --rebase" with a rebased upstream, if you have
already run "git fetch". Try to behave as if the "git fetch" was not run.

In other words, find the fork point of the current branch, where
the tip of upstream branch used to be, and use it as the upstream
parameter of "git rebase".

This patch computes the fork point by walking the reflog to find the first
commit which is an ancestor of the current branch. Maybe there are
smarter ways to compute it, but this is a straight forward implementation.

Signed-off-by: Santi Béjar <santi@agolina.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5520-pull: Test for rebased upstream + fetch + pull... Santi Béjar Thu, 16 Jul 2009 00:09:14 +0000 (02:09 +0200)

t5520-pull: Test for rebased upstream + fetch + pull --rebase

If your upstream has rebased you can do:

git pull --rebase

but only if you haven't fetch before.

Mark this case as test_expect_failure, in a later patch it will be
changed to test_expect_success.

Signed-off-by: Santi Béjar <santi@agolina.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Updates to draft release notes to 1.6.4Junio C Hamano Sat, 18 Jul 2009 20:01:49 +0000 (13:01 -0700)

Updates to draft release notes to 1.6.4

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

push: do not give big warning when no preference is... Junio C Hamano Sun, 19 Jul 2009 00:19:47 +0000 (17:19 -0700)

push: do not give big warning when no preference is configured

If the message said "we will be changing the default in the future, so
this is to warn people who want to keep the current default what to do",
it would have made some sense, but as it stands, the message is merely an
unsolicited advertisement for a new feature, which it is not helpful at
all. Squelch it.

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

t4202-log.sh: Test git log --no-walk sort orderMichael J Gruber Fri, 17 Jul 2009 14:28:06 +0000 (16:28 +0200)

t4202-log.sh: Test git log --no-walk sort order

'git log --no-walk' sorts commits by commit time whereas 'git show' does
not (it leaves them as given on the command line). Document this by two
tests so that we never forget why ba1d450 (Tentative built-in "git
show", 2006-04-15) introduced it and 8e64006 (Teach revision machinery
about --no-walk, 2007-07-24) exposed it as an option argument.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cvsexportcommit: reorder tests to quiet intermittent... Mike Ralphson Wed, 15 Jul 2009 14:34:24 +0000 (15:34 +0100)

cvsexportcommit: reorder tests to quiet intermittent failure

Reorder tests introduced in fef3a7cc and 54d5cc0e so an intermittent but
unimportant failure on the CVS side related to the former does not interfere
with what is actually being tested.

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Tested-by: Tommy Nordgren <tommy.nordgren@comhem.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sat, 18 Jul 2009 23:57:47 +0000 (16:57 -0700)

Merge branch 'maint'

* maint:
checkout -f: deal with a D/F conflict entry correctly
sha1_name.c: avoid unnecessary strbuf_release
refs.c: release file descriptor on error return

checkout -f: deal with a D/F conflict entry correctlyJunio C Hamano Sat, 18 Jul 2009 19:26:38 +0000 (12:26 -0700)

checkout -f: deal with a D/F conflict entry correctly

When we switch branches with "checkout -f", unpack_trees() feeds two
cache_entries to oneway_merge() function in its src[] array argument. The
zeroth entry comes from the current index, and the first entry represents
what the merge result should be, taken from the tree recorded in the
commit we are switching to.

When we have a blob (either regular file or a symlink) in the index and in
the work tree at path "foo", and the switched-to tree has "foo/bar",
i.e. "foo" becomes a directory, src[0] is obviously that blob currently
registered at "foo". Even though we do not have anything at "foo" in the
switched-to tree, src[1] is _not_ NULL in this case.

The unpack_trees() machinery places a special marker df_conflict_entry
to signal that no blob exists at "foo", but it will become a directory
that may have somthing underneath it (namely "foo/bar"), so a usual 3-way
merge can notice the situation.

But oneway_merge() codepath failed to notice this and passed the special
marker directly to merged_entry(). This happens to remove the "foo" in
the end because the df_conflict_entry does not have any name (hence the
"error" message) and its addition in add_index_entry() is rejected, but it
is wrong.

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

sha1_name.c: avoid unnecessary strbuf_releaseBrandon Casey Thu, 16 Jul 2009 21:25:19 +0000 (16:25 -0500)

sha1_name.c: avoid unnecessary strbuf_release

When we fall back to a standard for_each_reflog_ent() after failing to find
the nth branch switch (or if we had a short reflog) with the call to
for_each_recent_reflog_ent(), we do not need to free the memory allocated
for our strbuf's since a strbuf_reset() will be performed in
grab_nth_branch_switch() before assigning to the entry.

Plus, the strbuf_release() negates the non-zero hint we initially gave to
strbuf_init() just above these lines.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: release file descriptor on error returnBrandon Casey Thu, 16 Jul 2009 21:25:18 +0000 (16:25 -0500)

refs.c: release file descriptor on error return

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "mailinfo: Remove only one set of square brackets" v1.6.4-rc1Junio C Hamano Wed, 15 Jul 2009 22:10:06 +0000 (15:10 -0700)

Revert "mailinfo: Remove only one set of square brackets"

This reverts commit 650d30d8a120c8982309ccb9ef40432b4ea2eb74.

Some mailing lists are configured add prefix "[listname] " to all their
messages, and also people hand-edit subject lines, be it an output from
format-patch or a patch generated by some other means.

We cannot stop people from mucking with the subject line, and with the
change, there always will be need for hand editing the subject when that
happens. People have depended on the leading [bracketed string] removal.

Fix extraneous lstat's in 'git checkout -f'Linus Torvalds Tue, 14 Jul 2009 21:19:10 +0000 (14:19 -0700)

Fix extraneous lstat's in 'git checkout -f'

In our 'oneway_merge()' we always do an 'lstat()' to see if we might
need to mark the entry for updating.

But we really shouldn't need to do that when the cache entry is already
marked as being ce_uptodate(), and this makes us do unnecessary lstat()
calls if we have index preloading enabled.

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

Improve on the 'invalid object' error message at commit... Linus Torvalds Tue, 14 Jul 2009 18:25:17 +0000 (11:25 -0700)

Improve on the 'invalid object' error message at commit time

Not that anybody should ever get it, but somebody did (probably because
of a flaky filesystem, but whatever). And each time I see an error
message that I haven't seen before, I decide that next time it will look
better.

So this makes us write more relevant information about exactly which
file ended up having issues with a missing object. Which will tell
whether it was a tree object, for example, or just a regular file in the
index (and which one).

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

Make 'git show' more usefulLinus Torvalds Mon, 13 Jul 2009 21:41:12 +0000 (14:41 -0700)

Make 'git show' more useful

For some reason, I ended up doing

git show HEAD~5..

as an odd way of asking for a log. I realize I should just have used "git
log", but at the same time it does make perfect conceptual sense. After
all, you _could_ have done

git show HEAD HEAD~1 HEAD~2 HEAD~3 HEAD~4

and saying "git show HEAD~5.." is pretty natural. It's not like "git show"
only ever showed a single commit (or other object) before either! So
conceptually, giving a commit range is a very sensible operation, even
though you'd traditionally have used "git log" for that.

However, doing that currently results in an error

fatal: object ranges do not make sense when not walking revisions

which admittedly _also_ makes perfect sense - from an internal git
implementation standpoint in 'revision.c'.

However, I think that asking to show a range makes sense to a user, while
saying "object ranges no not make sense when not walking revisions" only
makes sense to a git developer.

So on the whole, of the two different "makes perfect sense" behaviors, I
think I originally picked the wrong one. And quite frankly, I don't really
see anybody actually _depending_ on that error case. So why not change it?

So rather than error out, just turn that non-walking error case into a
"silently turn on walking" instead.

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

bash: add '--merges' to common 'git log' optionsSZEDER Gábor Mon, 13 Jul 2009 15:11:45 +0000 (17:11 +0200)

bash: add '--merges' to common 'git log' options

... so it's available for git log, shortlog and gitk.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Document 'git (rev-list|log) --merges'SZEDER Gábor Mon, 13 Jul 2009 15:11:44 +0000 (17:11 +0200)

Document 'git (rev-list|log) --merges'

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: update Git homepage URLWincent Colaiuta Sun, 12 Jul 2009 12:31:28 +0000 (14:31 +0200)

gitweb: update Git homepage URL

git-scm.com is now the "official" Git project page, having taken over
from git.or.cz, so update the default link accordingly. This saves a
redirect when people hit git.or.cz.

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

init-db: migrate to parse-optionsMichał Kiedrowicz Sun, 12 Jul 2009 10:24:32 +0000 (12:24 +0200)

init-db: migrate to parse-options

Also add missing --bare to init-db synopsis.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git svn: allow uppercase UUIDs from SVNEric Wong Sat, 11 Jul 2009 21:13:12 +0000 (14:13 -0700)

git svn: allow uppercase UUIDs from SVN

SVN allows uppercase A-F characters in repositories. Although
`svnadmin' does not create UUIDs with uppercase by default, it
is possible to change the UUID of a SVN repository and SVN
itself will make no attempt to normalize them.

Thanks to Esben Skovenborg for discovering this issue.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn: Fix branch detection when repository root... Mattias Nissler Mon, 6 Jul 2009 23:40:02 +0000 (01:40 +0200)

git-svn: Fix branch detection when repository root is inaccessible

For the case of multiple projects sharing a single SVN repository, it is
common practice to create the standard SVN directory layout within a
subdirectory for each project. In such setups, access control is often
used to limit what projects a given user may access. git-svn failed to
detect branches (e.g. when passing --stdlayout to clone) because it
relied on having access to the root directory in the repository. This
patch solves this problem by making git-svn use paths relative to the
given repository URL instead of the repository root.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>

git-svn: Always duplicate paths returned from get_logMattias Nissler Mon, 6 Jul 2009 23:39:52 +0000 (01:39 +0200)

git-svn: Always duplicate paths returned from get_log

This makes get_log more safe to use because callers cannot run into path
clobbering any more. The additional overhead will not affect performance
since the critical calls from the fetch loop need the path duplication
anyway and the rest of the call sites is not performance critical.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>

apply: notice creation/removal patches produced by... Junio C Hamano Sat, 11 Jul 2009 01:38:08 +0000 (18:38 -0700)

apply: notice creation/removal patches produced by GNU diff

Unified context patch generated by GNU diff has UNIX epoch timestamp
on the side that does not exist when the patch is about a creation or
a deletion event. Notice this convention when reading a non-git diff.

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

prune-packed: migrate to parse-optionsStephen Boyd Wed, 8 Jul 2009 05:15:41 +0000 (22:15 -0700)

prune-packed: migrate to parse-options

Add long options for dry run and quiet to be more consistent with the
rest of git.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

verify-pack: migrate to parse-optionsStephen Boyd Wed, 8 Jul 2009 05:15:40 +0000 (22:15 -0700)

verify-pack: migrate to parse-options

OPT__VERBOSE introduces the long option (--verbose) in addition to the
already present short option (-v), so document this new addition.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

verify-tag: migrate to parse-optionsStephen Boyd Wed, 8 Jul 2009 05:15:39 +0000 (22:15 -0700)

verify-tag: migrate to parse-options

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

write-tree: migrate to parse-optionsStephen Boyd Wed, 8 Jul 2009 05:15:38 +0000 (22:15 -0700)

write-tree: migrate to parse-options

A check for extra options has been dropped, it could never be triggered
in the original code as the usage message would be printed instead.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

quickfetch(): Prevent overflow of the rev-list command... Johan Herland Thu, 9 Jul 2009 23:52:30 +0000 (01:52 +0200)

quickfetch(): Prevent overflow of the rev-list command line

quickfetch() calls rev-list to check whether the objects we are about to
fetch are already present in the repo (if so, we can skip the object fetch).
However, when there are many (~1000) refs to be fetched, the rev-list
command line grows larger than the maximum command line size on some systems
(32K in Windows). This causes rev-list to fail, making quickfetch() return
non-zero, which unnecessarily triggers the transport machinery. This somehow
causes fetch to fail with an exit code.

By using the --stdin option to rev-list (and feeding the object list to its
standard input), we prevent the overflow of the rev-list command line,
which causes quickfetch(), and subsequently the overall fetch, to succeed.

However, using rev-list --stdin is not entirely straightforward: rev-list
terminates immediately when encountering an unknown object, which can
trigger SIGPIPE if we are still writing object's to its standard input.
We therefore temporarily ignore SIGPIPE so that the fetch process is not
terminated.

The patch also contains a testcase to verify the fix (note that before
the patch, the testcase would only fail on msysGit).

Signed-off-by: Johan Herland <johan@herland.net>
Improved-by: Johannes Sixt <j6t@kdbg.org>
Improved-by: Alex Riesen <raa.lkml@gmail.com>
Tested-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: update IRIX64 sectionBrandon Casey Fri, 10 Jul 2009 18:31:19 +0000 (13:31 -0500)

Makefile: update IRIX64 section

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: add section for SGI IRIX 6.5Brandon Casey Fri, 10 Jul 2009 17:10:46 +0000 (12:10 -0500)

Makefile: add section for SGI IRIX 6.5

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: add NEEDS_LIBGEN to optionally add -lgen... Brandon Casey Fri, 10 Jul 2009 17:10:45 +0000 (12:10 -0500)

Makefile: add NEEDS_LIBGEN to optionally add -lgen to compile arguments

Commit 003b33a8 recently added a call to basename(). On IRIX 6.5, this
function resides in libgen and -lgen is required for the linker.

Update configure.ac too.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-compat-util.h: adjust for SGI IRIX 6.5Brandon Casey Fri, 10 Jul 2009 17:10:44 +0000 (12:10 -0500)

git-compat-util.h: adjust for SGI IRIX 6.5

Don't define _XOPEN_SOURCE
Do define _SGI_SOURCE

Defining _XOPEN_SOURCE prevents many of the common functions and macros
from being defined. _Not_ setting _XOPEN_SOURCE, and instead setting
_SGI_SOURCE, provides all of the XPG4, XPG5, BSD, POSIX functions and
declarations, _BUT_ provides a horribly broken snprintf(). SGI does have
a working snprintf(), but it is only provided when _NO_XOPEN5 evaluates
to zero, and this only happens if _XOPEN_SOURCE is defined which, as
mentioned above, prevents many other common functions and defines.

The broken snprintf will be worked around with SNPRINTF_RETURNS_BOGUS in
the Makefile in a later patch.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

unpack-trees.c: work around run-time array initializati... Brandon Casey Fri, 10 Jul 2009 17:10:43 +0000 (12:10 -0500)

unpack-trees.c: work around run-time array initialization flaw on IRIX 6.5

The c99 MIPSpro Compiler version 7.4.4m on IRIX 6.5 does not properly
initialize run-time initialized arrays. An array which is initialized with
fewer elements than the length of the array should have the unitialized
elements initialized to zero. This compiler only initializes the remaining
elements when the last element is a static parameter. So work around it
by adding a "NULL" initialization parameter.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'lt/dir-cleanup'Junio C Hamano Sat, 11 Jul 2009 03:18:37 +0000 (20:18 -0700)

Merge branch 'lt/dir-cleanup'

* lt/dir-cleanup:
Make index preloading check the whole path to the file
Export thread-safe version of 'has_symlink_leading_path()'
Prepare symlink caching for thread-safety
Avoid using 'lstat()' to figure out directories
Avoid doing extra 'lstat()'s for d_type if we have an up-to-date cache entry
Simplify read_directory[_recursive]() arguments
Add 'fill_directory()' helper function for directory traversal

Merge branch 'ae/maint-mailinfo-rm-only-one-patch-marker'Junio C Hamano Sat, 11 Jul 2009 03:18:09 +0000 (20:18 -0700)

Merge branch 'ae/maint-mailinfo-rm-only-one-patch-marker'

* ae/maint-mailinfo-rm-only-one-patch-marker:
mailinfo: Remove only one set of square brackets

Makefile: keep "git" when bindir is execdirJunio C Hamano Sat, 11 Jul 2009 03:17:33 +0000 (20:17 -0700)

Makefile: keep "git" when bindir is execdir

For some reason there still are people who use the old style layout
to put everything in $(bindir). The previous commit breaks the install
for them, because it tries to unconditionally remove git from execdir
and cp/ln from bindir --- oops.

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

Make index preloading check the whole path to the fileLinus Torvalds Thu, 9 Jul 2009 20:37:02 +0000 (13:37 -0700)

Make index preloading check the whole path to the file

This uses the new thread-safe 'threaded_has_symlink_leading_path()'
function to efficiently verify that the whole path leading up to the
filename is a proper path, and does not contain symlinks.

This makes 'ce_uptodate()' a much stronger guarantee: it no longer just
guarantees that the 'lstat()' of the path would match, it also means
that we know that people haven't played games with moving directories
around and covered it up with symlinks.

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

Export thread-safe version of 'has_symlink_leading_path()'Linus Torvalds Thu, 9 Jul 2009 20:35:31 +0000 (13:35 -0700)

Export thread-safe version of 'has_symlink_leading_path()'

The threaded index preloading will want it, so that it can avoid
locking by simply using a per-thread symlink/directory cache.

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

Prepare symlink caching for thread-safetyLinus Torvalds Thu, 9 Jul 2009 20:23:59 +0000 (13:23 -0700)

Prepare symlink caching for thread-safety

This doesn't actually change the external interfaces, so they are still
thread-unsafe, but it makes the code internally pass a pointer to a
local 'struct cache_def' around, so that the core code can be made
thread-safe.

The threaded index preloading will want to verify that the paths leading
up to a pathname are all real directories.

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

Avoid using 'lstat()' to figure out directoriesLinus Torvalds Thu, 9 Jul 2009 20:14:28 +0000 (13:14 -0700)

Avoid using 'lstat()' to figure out directories

If we have an up-to-date index entry for a file in that directory, we
can know that the directories leading up to that file must be
directories. No need to do an lstat() on the directory.

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

Makefile: install 'git' in execdir v1.6.4-rc0Jeff King Thu, 9 Jul 2009 06:37:35 +0000 (02:37 -0400)

Makefile: install 'git' in execdir

When a git command executes a subcommand, it uses the "git
foo" form, which relies on finding "git" in the PATH.
Normally this should not be a problem, since the same "git"
that was used to invoke git in the first place will be
found. And if somebody invokes a "git" outside of the PATH
(e.g., by giving its absolute path), this case is already
covered: we put that absolute path onto the front of PATH.

However, if one is using "sudo", then sudo will execute the
"git" from the PATH, but pass along a restricted PATH that
may not contain the original "git" directory. In this case,
executing a subcommand will fail.

To solve this, we put the "git" wrapper itself into the
execdir; this directory is prepended to the PATH when git
starts, so the wrapper will always be found.

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

Avoid doing extra 'lstat()'s for d_type if we have... Linus Torvalds Thu, 9 Jul 2009 02:31:49 +0000 (19:31 -0700)

Avoid doing extra 'lstat()'s for d_type if we have an up-to-date cache entry

On filesystems without d_type, we can look at the cache entry first.
Doing an lstat() can be expensive.

Reported by Dmitry Potapov for Cygwin.

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

Simplify read_directory[_recursive]() argumentsLinus Torvalds Thu, 9 Jul 2009 02:24:39 +0000 (19:24 -0700)

Simplify read_directory[_recursive]() arguments

Stop the insanity with separate 'path' and 'base' arguments that must
match. We don't need that crazy interface any more, since we cleaned up
handling of 'path' in commit da4b3e8c28b1dc2b856d2555ac7bb47ab712598c.

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

Add 'fill_directory()' helper function for directory... Linus Torvalds Thu, 14 May 2009 20:22:36 +0000 (13:22 -0700)

Add 'fill_directory()' helper function for directory traversal

Most of the users of "read_directory()" actually want a much simpler
interface than the whole complex (but rather powerful) one.

In fact 'git add' had already largely abstracted out the core interface
issues into a private "fill_directory()" function that was largely
applicable almost as-is to a number of callers. Yes, 'git add' wants to
do some extra work of its own, specific to the add semantics, but we can
easily split that out, and use the core as a generic function.

This function does exactly that, and now that much simplified
'fill_directory()' function can be shared with a number of callers,
while also ensuring that the rather more complex calling conventions of
read_directory() are used by fewer call-sites.

This also makes the 'common_prefix()' helper function private to dir.c,
since all callers are now in that file.

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

Merge branch 'ld/push-porcelain-output-format'Junio C Hamano Thu, 9 Jul 2009 08:07:54 +0000 (01:07 -0700)

Merge branch 'ld/push-porcelain-output-format'

* ld/push-porcelain-output-format:
add --porcelain option to git-push

Merge branch 'gb/gitweb-avatar'Junio C Hamano Thu, 9 Jul 2009 08:00:59 +0000 (01:00 -0700)

Merge branch 'gb/gitweb-avatar'

* gb/gitweb-avatar:
gitweb: add empty alt text to avatar img
gitweb: picon avatar provider
gitweb: gravatar url cache
gitweb: (gr)avatar support
gitweb: use git_print_authorship_rows in 'tag' view too
gitweb: uniform author info for commit and commitdiff
gitweb: refactor author name insertion

Merge branch 'ml/http'Junio C Hamano Thu, 9 Jul 2009 08:00:36 +0000 (01:00 -0700)

Merge branch 'ml/http'

* ml/http:
http.c: add http.sslCertPasswordProtected option
http.c: prompt for SSL client certificate password

Conflicts:
http.c

Merge branch 'rs/grep-p'Junio C Hamano Thu, 9 Jul 2009 07:59:58 +0000 (00:59 -0700)

Merge branch 'rs/grep-p'

* rs/grep-p:
grep: simplify -p output
grep -p: support user defined regular expressions
grep: add option -p/--show-function
grep: handle pre context lines on demand
grep: print context hunk marks between files
grep: move context hunk mark handling into show_line()
userdiff: add xdiff_clear_find_func()

Merge branch 'js/run-command-updates' (early part)Junio C Hamano Thu, 9 Jul 2009 07:59:32 +0000 (00:59 -0700)

Merge branch 'js/run-command-updates' (early part)

* 'js/run-command-updates' (early part):
MinGW: truncate exit()'s argument to lowest 8 bits

mailinfo: Remove only one set of square bracketsAndreas Ericsson Mon, 29 Jun 2009 09:55:51 +0000 (11:55 +0200)

mailinfo: Remove only one set of square brackets

git-format-patch prepends patches with a [PATCH x/n] prefix, but
mailinfo used to remove any number of square-bracket pairs and
the content between them. This prevents one from using a commit
subject like this:

[ and ] must be allowed as input

Removing the square bracket pair from this rather clumsily
constructed subject line loses important information, so we must
take care not to.

This patch causes the subject stripping to stop after it has
encountered one pair of square brackets.

One possible downside of this patch is that the patch-handling
programs will now fail at removing author-added square-brackets
to be removed, such as

[RFC][PATCH x/n]

However, since format-patch only adds one set of square brackets,
this behaviour is quite easily undesrstood and defended while the
previous behaviour is not.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn.txt: fix description of fetch flags accepted... Yann Dirson Tue, 7 Jul 2009 20:22:22 +0000 (22:22 +0200)

git-svn.txt: fix description of fetch flags accepted by clone.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn.txt: fix fetch flags incorrectly documented... Yann Dirson Tue, 7 Jul 2009 20:22:21 +0000 (22:22 +0200)

git-svn.txt: fix fetch flags incorrectly documented as init flags.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>