gitweb.git
Merge branch 'jk/add-p-skip-conflicts'Junio C Hamano Mon, 16 Apr 2012 19:43:36 +0000 (12:43 -0700)

Merge branch 'jk/add-p-skip-conflicts'

Excludes conflicted paths from "add -p" processing, as it is not prepared
to handle them.

By Jeff King
* jk/add-p-skip-conflicts:
add--interactive: ignore unmerged entries in patch mode

Merge branch 'jc/commit-unedited-template'Junio C Hamano Mon, 16 Apr 2012 19:43:07 +0000 (12:43 -0700)

Merge branch 'jc/commit-unedited-template'

When "git commit --template F" errors out because the user did not touch
the message, it claimed that it aborts due to "empty message", which was
utterly wrong.

By Junio C Hamano (4) and Adam Monsen (1)
* jc/commit-unedited-template:
Documentation/git-commit: rephrase the "initial-ness" of templates
git-commit.txt: clarify -t requires editing message
commit: rephrase the error when user did not touch templated log message
commit: do not trigger bogus "has templated message edited" check
t7501: test the right kind of breakage

Merge branch 'bw/spawn-via-shell-path'Junio C Hamano Mon, 16 Apr 2012 19:42:54 +0000 (12:42 -0700)

Merge branch 'bw/spawn-via-shell-path'

"sh" on the user's PATH may be utterly broken on some systems;
consistently use SHELL_PATH even from inside run-command API.

By Ben Walton
* bw/spawn-via-shell-path:
Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd

Merge branch 'wk/gitweb-snapshot-use-if-modified-since'Junio C Hamano Mon, 16 Apr 2012 19:42:48 +0000 (12:42 -0700)

Merge branch 'wk/gitweb-snapshot-use-if-modified-since'

Makes 'snapshot' request to "gitweb" honor If-Modified-Since: header,
based on the commit date.

By W. Trevor King
* wk/gitweb-snapshot-use-if-modified-since:
gitweb: add If-Modified-Since handling to git_snapshot().
gitweb: refactor If-Modified-Since handling
gitweb: add `status` headers to git_feed() responses.

Merge branch 'jk/http-backend-keep-committer-ident... Junio C Hamano Mon, 16 Apr 2012 19:42:40 +0000 (12:42 -0700)

Merge branch 'jk/http-backend-keep-committer-ident-env'

The smart-http backend used to always override GIT_COMMITTER_* variables
with REMOTE_USER and REMOTE_ADDR.

By Jeff King
* jk/http-backend-keep-committer-ident-env:
http-backend: respect existing GIT_COMMITTER_* variables

Merge branch 'sl/autoconf'Junio C Hamano Mon, 16 Apr 2012 19:42:29 +0000 (12:42 -0700)

Merge branch 'sl/autoconf'

Updates our configure.ac to follow a better "autoconf" style.

By Stefano Lattarini
* sl/autoconf:
configure: be more idiomatic
configure: avoid some code repetitions thanks to m4_{push,pop}def
configure: move definitions of private m4 macros before AC_INIT invocation

Merge branch 'jk/branch-quiet'Junio C Hamano Mon, 16 Apr 2012 19:42:22 +0000 (12:42 -0700)

Merge branch 'jk/branch-quiet'

Even with "-q"uiet option, "checkout" used to report setting up tracking.
Also "branch" learns "-q"uiet option to squelch informational message.

By Jeff King
* jk/branch-quiet:
teach "git branch" a --quiet option
checkout: suppress tracking message with "-q"

Merge branch 'rs/combine-diff-zero-context-at-the-begin... Junio C Hamano Mon, 16 Apr 2012 19:41:59 +0000 (12:41 -0700)

Merge branch 'rs/combine-diff-zero-context-at-the-beginning'

Fixes an age old corner case bug in combine diff (only triggered with -U0
and the hunk at the beginning of the file needs to be shown).

By René Scharfe
* rs/combine-diff-zero-context-at-the-beginning:
combine-diff: fix loop index underflow

Merge branch 'jk/diff-no-rename-empty'Junio C Hamano Mon, 16 Apr 2012 19:41:49 +0000 (12:41 -0700)

Merge branch 'jk/diff-no-rename-empty'

Forbids rename detection logic from matching two empty files as renames
during merge-recursive to prevent mismerges.

By Jeff King
* jk/diff-no-rename-empty:
merge-recursive: don't detect renames of empty files
teach diffcore-rename to optionally ignore empty content
make is_empty_blob_sha1 available everywhere
drop casts from users EMPTY_TREE_SHA1_BIN

Merge branch 'jc/maint-clean-nested-worktree-in-subdir'Junio C Hamano Mon, 16 Apr 2012 19:40:22 +0000 (12:40 -0700)

Merge branch 'jc/maint-clean-nested-worktree-in-subdir'

"git clean -d -f" (not "-d -f -f") is supposed to protect nested working
trees of independent git repositories that exist in the current project
working tree from getting removed, but the protection applied only to such
working trees that are at the top-level of the current project by mistake.

* jc/maint-clean-nested-worktree-in-subdir:
clean: preserve nested git worktree in subdirectories

Merge branch 'rs/unpack-trees-leakfix'Junio C Hamano Mon, 16 Apr 2012 19:39:58 +0000 (12:39 -0700)

Merge branch 'rs/unpack-trees-leakfix'

By René Scharfe
* rs/unpack-trees-leakfix:
unpack-trees: plug minor memory leak
unpack-trees: don't perform any index operation if we're not merging

Merge branch 'nl/rebase-i-cheat-sheet'Junio C Hamano Mon, 16 Apr 2012 19:39:41 +0000 (12:39 -0700)

Merge branch 'nl/rebase-i-cheat-sheet'

* nl/rebase-i-cheat-sheet:
rebase -i: remind that the lines are top-to-bottom

diff: avoid stack-buffer-read-overrun for very long... Jim Meyering Mon, 16 Apr 2012 15:20:02 +0000 (17:20 +0200)

diff: avoid stack-buffer-read-overrun for very long name

Due to the use of strncpy without explicit NUL termination,
we could end up passing names n1 or n2 that are not NUL-terminated
to queue_diff, which requires NUL-terminated strings.
Ensure that each is NUL terminated.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

RelNotes: the first batch of topics graduated to 'master'Junio C Hamano Mon, 16 Apr 2012 05:59:31 +0000 (22:59 -0700)

RelNotes: the first batch of topics graduated to 'master'

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

Merge branch 'da/difftool-test'Junio C Hamano Mon, 16 Apr 2012 05:52:04 +0000 (22:52 -0700)

Merge branch 'da/difftool-test'

Makes sure "difftool" options can be given in any order.

By David Aguilar
* da/difftool-test:
t7800: Test difftool passing arguments to diff

Merge branch 'zj/test-cred-helper-nicer-prove'Junio C Hamano Mon, 16 Apr 2012 05:51:56 +0000 (22:51 -0700)

Merge branch 'zj/test-cred-helper-nicer-prove'

Minor improvement to t0303.

By Zbigniew Jędrzejewski-Szmek
* zj/test-cred-helper-nicer-prove:
t0303: resurrect commit message as test documentation
t0303: immediately bail out w/o GIT_TEST_CREDENTIAL_HELPER

Merge branch 'jh/notes-merge-in-git-dir-worktree'Junio C Hamano Mon, 16 Apr 2012 05:51:44 +0000 (22:51 -0700)

Merge branch 'jh/notes-merge-in-git-dir-worktree'

Running "notes merge --commit" failed to perform correctly when run
from any directory inside $GIT_DIR/. When "notes merge" stops with
conflicts, $GIT_DIR/NOTES_MERGE_WORKTREE is the place a user edits
to resolve it.

By Johan Herland (3) and Junio C Hamano (1)
* jh/notes-merge-in-git-dir-worktree:
notes-merge: Don't remove .git/NOTES_MERGE_WORKTREE; it may be the user's cwd
notes-merge: use opendir/readdir instead of using read_directory()
t3310: illustrate failure to "notes merge --commit" inside $GIT_DIR/
remove_dir_recursively(): Add flag for skipping removal of toplevel dir

Merge branch 'tr/maint-word-diff-regex-sticky'Junio C Hamano Mon, 16 Apr 2012 05:51:34 +0000 (22:51 -0700)

Merge branch 'tr/maint-word-diff-regex-sticky'

The regexp configured with wordregex was incorrectly reused across files.

By Thomas Rast (2) and Johannes Sixt (1)
* tr/maint-word-diff-regex-sticky:
diff: tweak a _copy_ of diff_options with word-diff
diff: refactor the word-diff setup from builtin_diff_cmd
t4034: diff.*.wordregex should not be "sticky" in --word-diff

Merge branch 'jn/diffstat-tests'Junio C Hamano Mon, 16 Apr 2012 05:51:24 +0000 (22:51 -0700)

Merge branch 'jn/diffstat-tests'

Some tests checked the "diff --stat" output when they do not have to,
which unnecessarily made things harder to verify under GETTEXT_POISON.

By Jonathan Nieder
* jn/diffstat-tests:
diffstat summary line varies by locale: miscellany
test: use numstat instead of diffstat in binary-diff test
test: use --numstat instead of --stat in "git stash show" tests
test: test cherry-pick functionality and output separately
test: modernize funny-names test style
test: use numstat instead of diffstat in funny-names test
test: use test_i18ncmp when checking --stat output

Merge branch 'jc/diff-algo-cleanup'Junio C Hamano Mon, 16 Apr 2012 05:51:14 +0000 (22:51 -0700)

Merge branch 'jc/diff-algo-cleanup'

Resurrects the preparatory clean-up patches from another topic that was
discarded, as this would give a saner foundation to build on diff.algo
configuration option series.

* jc/diff-algo-cleanup:
xdiff: PATIENCE/HISTOGRAM are not independent option bits
xdiff: remove XDL_PATCH_* macros

Merge branch 'jc/commit-hook-authorship'Junio C Hamano Mon, 16 Apr 2012 05:51:01 +0000 (22:51 -0700)

Merge branch 'jc/commit-hook-authorship'

"git commit --author=$name" did not tell the name that was being recorded
in the resulting commit to hooks, even though it does do so when the end
user overrode the authorship via the "GIT_AUTHOR_NAME" environment
variable.

* jc/commit-hook-authorship:
commit: pass author/committer info to hooks
t7503: does pre-commit-hook learn authorship?
ident.c: add split_ident_line() to parse formatted ident line

Merge branch 'nd/stream-more'Junio C Hamano Mon, 16 Apr 2012 05:50:38 +0000 (22:50 -0700)

Merge branch 'nd/stream-more'

Use API to read blob data in smaller chunks in more places to reduce the
memory footprint.

By Nguyễn Thái Ngọc Duy (6) and Junio C Hamano (1)
* nd/stream-more:
update-server-info: respect core.bigfilethreshold
fsck: use streaming API for writing lost-found blobs
show: use streaming API for showing blobs
parse_object: avoid putting whole blob in core
cat-file: use streaming API to print blobs
Add more large blob test cases
streaming: make streaming-write-entry to be more reusable

merge overwrites unstaged changes in renamed fileClemens Buchacher Sat, 14 Apr 2012 23:15:17 +0000 (01:15 +0200)

merge overwrites unstaged changes in renamed file

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: mark @{upstream} error messages for translationZbigniew Jędrzejewski-Szmek Sat, 14 Apr 2012 07:54:35 +0000 (09:54 +0200)

i18n: mark @{upstream} error messages for translation

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Be more specific if upstream branch is not trackedZbigniew Jędrzejewski-Szmek Sat, 14 Apr 2012 07:54:34 +0000 (09:54 +0200)

Be more specific if upstream branch is not tracked

If the branch configured as upstream didn't have a local tracking
branch, git said "Upstream branch not found". We can be more helpful,
and separate the cases when upstream is not configured, and when it is
configured, but the upstream branch is not tracked in a local branch.

The following configuration leads to the second scenario:

[remote "origin"]
url = ...
fetch = refs/heads/master
[branch "master"]
remote = origin
merge = refs/heads/master

'git pull' will work on master, but master@{upstream} is not defined.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Provide better message for barnhc_wiht_tpyo@{u}Zbigniew Jędrzejewski-Szmek Sat, 14 Apr 2012 07:54:33 +0000 (09:54 +0200)

Provide better message for barnhc_wiht_tpyo@{u}

Instead of just saying that no upstream exists for such branch,
which is true but not very helpful, check that there's no
refs/heads/barnhc_wiht_tpyo and tell it to the user.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Provide branch name in error message when using @{u}Zbigniew Jędrzejewski-Szmek Sat, 14 Apr 2012 07:54:32 +0000 (09:54 +0200)

Provide branch name in error message when using @{u}

When using @{u} or @{upstream} it is common to omit the branch name,
implying current branch. If the upstream is not configured, the error
message was "No upstream branch found for ''".

When resolving '@{u}', branch_get() is called, which almost always
returns a description of a branch. This allows us to use a branch name
in the error message, even if the user said something like '@{u}'.

The only case when branch_get() returns NULL is when HEAD points to so
something which is not a branch. Of course this also means that no
upstream is configured, but it is better to directly say that HEAD
does not point to a branch.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1507: add tests to document @{upstream} behaviourZbigniew Jędrzejewski-Szmek Sat, 14 Apr 2012 07:54:31 +0000 (09:54 +0200)

t1507: add tests to document @{upstream} behaviour

In preparation for future changes, add tests which show error messages
with @{upstream} in various conditions:

- test branch@{u} with . as remote
- check error message for branch@{u} on a branch with
* no upstream,
* on a branch with a configured upstream which doesn't have a
remote-tracking branch
- check error message for branch@{u} when branch 'branch' does not
exist
- check error message for @{u} without the branch name

Right now the messages are very similar, but various cases can and
will be distinguished.

Note: test_i18ncmp is not used, because currently error output is not
internationalized. test_cmp will be switched to test_i18ncmp in a later
patch, when error messages are internationalized.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: add initial bash completion testsFelipe Contreras Wed, 11 Apr 2012 21:57:03 +0000 (00:57 +0300)

tests: add initial bash completion tests

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cherry-pick: do not expect file argumentsClemens Buchacher Sat, 14 Apr 2012 19:04:48 +0000 (21:04 +0200)

cherry-pick: do not expect file arguments

If a commit-ish passed to cherry-pick or revert happens to have a file
of the same name, git complains that the argument is ambiguous and
advises to use '--'. To make things worse, the '--' argument is removed
by parse_options, und so passing '--' has no effect.

Instead, always interpret cherry-pick/revert arguments as revisions.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

properly keep track of current working directoryClemens Buchacher Thu, 12 Apr 2012 23:11:36 +0000 (01:11 +0200)

properly keep track of current working directory

Various failure modes in the repository detection code path currently
quote the wrong directory in their error message. The working directory
is changed iteratively to the parent directory until a git repository is
found. If the working directory cannot be changed to the parent
directory for some reason, the detection gives up and prints an error
message. The error message should report the current working directory.

Instead of continually updating the 'cwd' variable, which is actually
used to remember the original working directory, the 'offset' variable
is used to keep track of the current working directory. At the point
where the affected error handling code is called, 'offset' already
points to the end of the parent of the working directory, rather than
the current working directory.

Fix this by explicitly using a variable 'offset_parent' and update
'offset' concurrently with the call to chdir.

In a similar fashion, the function get_device_or_die() would print the
original working directory in case of a failure, rather than the current
working directory. Fix this as well by making use of the 'offset'
variable.

Lastly, replace the phrase 'mount parent' with 'mount point'. The former
appears to be a typo.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import doc: cat-blob and ls responses need to... Jonathan Nieder Wed, 11 Apr 2012 21:25:01 +0000 (16:25 -0500)

fast-import doc: cat-blob and ls responses need to be consumed quickly

If fast-import's command pipe and the frontend's cat-blob/ls response
pipe are both filled, there can be a deadlock. Luckily all existing
frontends consume any pending cat-blob/ls responses completely before
writing the next command.

Document the requirements so future frontend authors and users can be
spared from the problem, too. It is not always easy to catch that
kind of bug by testing.

To set the scene, add some words of explanation to help the novice
understand that "cat-blob" and "ls" output are meant for consumption
by the frontend.

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stash: use eval_gettextln correctlyRoss Lagerwall Sat, 14 Apr 2012 12:37:29 +0000 (14:37 +0200)

stash: use eval_gettextln correctly

Otherwise, passing an invalid option, git stash -v, gave:

git-stash: line 204: $'error: unknown option for \'stash save\':
$option\n To provide a message, use git stash save -- \'$option\'':
command not found

Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodules: recursive fetch also checks new tags for... Jens Lehmann Fri, 13 Apr 2012 16:25:16 +0000 (18:25 +0200)

submodules: recursive fetch also checks new tags for submodule commits

Since 88a21979c (fetch/pull: recurse into submodules when necessary) all
fetched commits are examined if they contain submodule changes (unless
configuration or command line options inhibit that). If a newly recorded
submodule commit is not present in the submodule, a fetch is run inside
it to download that commit.

Checking new refs was done in an else branch where it wasn't executed for
tags. This normally isn't a problem because tags are only fetched with
the branches they live on, then checking the new commits in the fetched
branches for submodule commits will also process all tags. But when a
specific tag is fetched (or the refspec contains refs/tags/) commits only
reachable by tags won't be searched for submodule commits, which is a bug.

Fix that by moving the code outside the if/else construct to handle new
tags just like any other ref. The performance impact of adding tags that
most of the time lie on a branch which is checked anyway for new submodule
commit should be minimal, as since 6859de4 (fetch: avoid quadratic loop
checking for updated submodules) all ref-tips are collected first and then
fed to a single rev-list.

Spotted-by: Jeff King <peff@peff.net>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: am of empty patch should not succeedJonathan Nieder Sat, 14 Apr 2012 04:48:13 +0000 (23:48 -0500)

test: am of empty patch should not succeed

The "git am empty" test uses the construct

git am empty-file && false || :

which unconditionally returns true. Use test_must_fail instead, which
also has the benefit of noticing if "git am" has segfaulted.

While at it, tighten the test to check that the diagnostic appears on
stderr and not stdout.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: use test_i18ncmp for "Patch format detection... Jonathan Nieder Sat, 14 Apr 2012 04:46:18 +0000 (23:46 -0500)

test: use test_i18ncmp for "Patch format detection failed" message

v1.7.8.5~2 (am: don't infloop for an empty input file, 2012-02-25)
added a check for the human-readable message "Patch format detection
failed." but we forgot to suppress that check when running tests with
git configured to write output in another language.

Noticed by running tests with GETTEXT_POISON=YesPlease.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: do not rely on US English tracking-info messagesJonathan Nieder Sat, 14 Apr 2012 04:45:31 +0000 (23:45 -0500)

test: do not rely on US English tracking-info messages

When v1.7.9.2~28^2 (2012-02-02) marked "Your branch is behind" and
friends for translation, it forgot to adjust tests not to check those
messages when tests are being run with git configured to write its
output in another language.

With this patch applied, t2020 and t6040 pass again with
GETTEXT_POISON=YesPlease.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Explained-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http: use newer curl options for setting credentialsJeff King Fri, 13 Apr 2012 06:19:25 +0000 (02:19 -0400)

http: use newer curl options for setting credentials

We give the username and password to curl by sticking them
in a buffer of the form "user:pass" and handing the result
to CURLOPT_USERPWD. Since curl 7.19.1, there is a split
mechanism, where you can specify each element individually.

This has the advantage that a username can contain a ":"
character. It also is less code for us, since we can hand
our strings over to curl directly. And since curl 7.17.0 and
higher promise to copy the strings for us, we we don't even
have to worry about memory ownership issues.

Unfortunately, we have to keep the ugly code for old curl
around, but as it is now nicely #if'd out, we can easily get
rid of it when we decide that 7.19.1 is "old enough".

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

http: clean up leak in init_curl_http_authJeff King Fri, 13 Apr 2012 06:18:35 +0000 (02:18 -0400)

http: clean up leak in init_curl_http_auth

When we have a credential to give to curl, we must copy it
into a "user:pass" buffer and then hand the buffer to curl.
Old versions of curl did not copy the buffer, and we were
expected to keep it valid. Newer versions of curl will copy
the buffer.

Our solution was to use a strbuf and detach it, giving
ownership of the resulting buffer to curl. However, this
meant that we were leaking the buffer on newer versions of
curl, since curl was just copying it and throwing away the
string we passed. Furthermore, when we replaced a
credential (e.g., because our original one was rejected), we
were also leaking on both old and new versions of curl.

This got even worse in the last patch, which started
replacing the credential (and thus leaking) on every http
request.

Instead, let's use a static buffer to make the ownership
more clear and less leaky. We already keep a static "struct
credential", so we are only handling a single credential at
a time, anyway.

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

Fix httpd tests that broke when non-ff push advice... Christopher Tiwald Thu, 12 Apr 2012 17:56:28 +0000 (13:56 -0400)

Fix httpd tests that broke when non-ff push advice changed

Signed-off-by: Christopher Tiwald <christiwald@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: Add Danish team (da) to list of teamsByrial Jensen Wed, 11 Apr 2012 00:11:12 +0000 (02:11 +0200)

l10n: Add Danish team (da) to list of teams

l10n: New da.po file with 0 translationsByrial Jensen Tue, 10 Apr 2012 16:50:59 +0000 (18:50 +0200)

l10n: New da.po file with 0 translations

apply: document buffer ownership rules across functionsJunio C Hamano Wed, 11 Apr 2012 21:43:48 +0000 (14:43 -0700)

apply: document buffer ownership rules across functions

In general, the private functions in this file were not very
much documented; even though what each of them do is reasonably
self explanatory, the ownership rules for various buffers and
data structures were not very obvious.

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

apply: tighten constness of line bufferJunio C Hamano Wed, 11 Apr 2012 21:41:42 +0000 (14:41 -0700)

apply: tighten constness of line buffer

These point into a single line in the patch text we read from
the input, and they are not used to modify it.

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

apply: drop unused macroJunio C Hamano Wed, 11 Apr 2012 21:38:31 +0000 (14:38 -0700)

apply: drop unused macro

CHUNKSIZE is no longer used.

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

gitweb: Refinement highlightning in combined diffsMichał Kiedrowicz Wed, 11 Apr 2012 21:18:44 +0000 (23:18 +0200)

gitweb: Refinement highlightning in combined diffs

The highlightning of combined diffs is currently disabled. This is
because output from a combined diff is much harder to highlight because
it is not obvious which removed and added lines should be compared.

Current code requires that the number of added lines is equal to the
number of removed lines and only skips first +/- character, treating
second +/- as a line content, Thus, it is not possible to simply use
existing algorithm unchanged for combined diffs.

Let's start with a simple case: only highlight changes that come from
one parent, i.e. when every removed line has a corresponding added line
for the same parent. This way the highlightning cannot get wrong. For
example, following diffs would be highlighted:

- removed line for first parent
+ added line for first parent
context line
-removed line for second parent
+added line for second parent

or

- removed line for first parent
-removed line for second parent
+ added line for first parent
+added line for second parent

but following output will not:

- removed line for first parent
-removed line for second parent
+added line for second parent
++added line for both parents

In other words, we require that pattern of '-'-es in pre-image matches
pattern of '+'-es in post-image.

Further changes may introduce more intelligent approach that better
handles combined diffs.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Highlight interesting parts of diffMichał Kiedrowicz Wed, 11 Apr 2012 21:18:43 +0000 (23:18 +0200)

gitweb: Highlight interesting parts of diff

Reading diff output is sometimes very hard, even if it's colored,
especially if lines differ only in few characters. This is often true
when a commit fixes a typo or renames some variables or functions.

This commit teaches gitweb to highlight characters that are different
between old and new line with a light green/red background. This should
work in the similar manner as in Trac or GitHub.

The algorithm that compares lines is based on contrib/diff-highlight.
Basically, it works by determining common prefix/suffix of corresponding
lines and highlightning only the middle part of lines. For more
information, see contrib/diff-highlight/README.

Combined diffs are not supported but a following commit will change it.

Since we need to pass esc_html()'ed or esc_html_hl_regions()'ed lines to
format_diff_lines(), so it was taught to accept preformatted lines
passed as a reference.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Push formatting diff lines to print_diff_chunk()Michał Kiedrowicz Wed, 11 Apr 2012 21:18:42 +0000 (23:18 +0200)

gitweb: Push formatting diff lines to print_diff_chunk()

Now lines are formatted closer to place where we actually use HTML
formatted output.

This means that we put raw lines in the @chunk accumulator, rather than
formatted lines. Because we still need to know class (type) of line
when accumulating data to post-process and print, process_diff_line()
subroutine was retired and replaced by diff_line_class() used in
git_patchset_body() and new restructured format_diff_line() used in
print_diff_chunk().

As a side effect, we have to pass \%from and \%to down to callstack.

This is a preparation patch for diff refinement highlightning. It's not
meant to change gitweb output.

[jn: wrote commit message]

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Use print_diff_chunk() for both side-by-side... Michał Kiedrowicz Wed, 11 Apr 2012 21:18:41 +0000 (23:18 +0200)

gitweb: Use print_diff_chunk() for both side-by-side and inline diffs

This renames print_sidebyside_diff_chunk() to print_diff_chunk() and
makes use of it for both side-by-side and inline diffs. Now diff lines
are always accumulated before they are printed. This opens the
possibility to preprocess diff output before it's printed, which is
needed for diff refinement highlightning (implemented in incoming
patches).

If print_diff_chunk() was left as is, the new function
print_inline_diff_lines() could reorder diff lines. It first prints all
context lines, then all removed lines and finally all added lines. If
the diff output consisted of mixed added and removed lines, gitweb would
reorder these lines. This is true for combined diff output, for
example:

- removed line for first parent
+ added line for first parent
-removed line for second parent
++added line for both parents

would be rendered as:

- removed line for first parent
-removed line for second parent
+ added line for first parent
++added line for both parents

To prevent gitweb from reordering lines, print_diff_chunk() calls
print_diff_lines() as soon as it detects that both added and removed
lines are present and there was a class change, and at the end of chunk.

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

gitweb: Extract print_sidebyside_diff_lines()Michał Kiedrowicz Wed, 11 Apr 2012 21:18:40 +0000 (23:18 +0200)

gitweb: Extract print_sidebyside_diff_lines()

Currently, print_sidebyside_diff_chunk() does two things: it
accumulates diff lines and prints them. Accumulation may be used to
perform additional operations on diff lines, so it makes sense to split
these two things. Thus, whole code that formats and prints diff lines
in the 'side-by-side' manner is moved out of print_sidebyside_diff_chunk()
to a separate subroutine and two conditions that control printing
diff liens are merged.

Thanks to that, we can easily (in later patches) replace call to that
subroutine with a call to more generic print_diff_lines() that will
control whether 'inline' or 'side-by-side' diff should be printed.

As a side effect, context lines are printed just before printing added
and removed lines, and at the end of chunk (previously, they were
printed immediately on the class change). However, this doesn't change
gitweb output.

The outcome of this patch is that print_sidebyside_diff_chunk() is now
much shorter and easier to read.

While at it, drop the '# assume that it is change' comment. According
to Jakub Narębski:

What I meant here when I was writing it that they are lines that
changed between two versions, like '!' in original (not unified)
context format.

We can omit this comment.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Pass esc_html_hl_regions() options to esc_html()Jakub Narębski Wed, 11 Apr 2012 21:18:39 +0000 (23:18 +0200)

gitweb: Pass esc_html_hl_regions() options to esc_html()

With this change, esc_html_hl_regions() accepts options and passes them
down to esc_html(). This may be needed if a caller wants to pass
-nbsp=>1 to esc_html().

The idea and implementation example of this change was described in
337da8d2 (gitweb: Introduce esc_html_match_hl and esc_html_hl_regions,
2012-02-27). While other suggestions may be more useful in some cases,
there is no need to implement them at the moment. The
esc_html_hl_regions() interface may be changed later if it's needed.

[mk: extracted from larger patch and wrote commit message]

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

gitweb: esc_html_hl_regions(): Don't create empty ... Michał Kiedrowicz Wed, 11 Apr 2012 21:18:38 +0000 (23:18 +0200)

gitweb: esc_html_hl_regions(): Don't create empty <span> elements

If $end is equal to or less than $begin, esc_html_hl_regions()
generates an empty <span> element. It normally shouldn't be visible in
the web browser, but it doesn't look good when looking at page source.
It also minimally increases generated page size for no special reason.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Use descriptive names in esc_html_hl_regions()Michał Kiedrowicz Wed, 11 Apr 2012 21:18:37 +0000 (23:18 +0200)

gitweb: Use descriptive names in esc_html_hl_regions()

The $s->[0] and $s->[1] variables look a bit cryptic. Let's rename them
to $begin and $end so that it's clear what they do.

Suggested-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

blame: accept --need-minimalJunio C Hamano Wed, 11 Apr 2012 20:08:08 +0000 (13:08 -0700)

blame: accept --need-minimal

Between v1.7.1 and v1.7.2, 582aa00bdffb switched the default "diff"
invocation not to use XDF_NEED_MINIMAL, but this breaks "git blame"
rather badly.

Allow the command line option to ask for an extra careful matching.

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

Kick off post 1.7.10 cycleJunio C Hamano Wed, 11 Apr 2012 19:17:17 +0000 (12:17 -0700)

Kick off post 1.7.10 cycle

I tentatively named the release notes "1.7.11" but this may have to
be renamed to "1.8" or some other name later. Let's see how well
we would do during this cycle.

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

gitweb: Fix unintended "--no-merges" for regular Atom... Sebastian Pipping Wed, 4 Apr 2012 12:25:44 +0000 (14:25 +0200)

gitweb: Fix unintended "--no-merges" for regular Atom feed

The print_feed_meta() subroutine generates links for feeds with and
without merges, in RSS and Atom formats. However because %href_params
was not properly reset, it generated links with "--no-merges" for all
except the very first link.

Before:
<link rel="alternate" title="[..] - Atom feed" href="/?p=.git;a=atom;opt=--no-merges" type="application/atom+xml" />
<link rel="alternate" title="[..] - Atom feed (no merges)" href="/?p=.git;a=atom;opt=--no-merges" type="application/atom+xml" />

After:
<link rel="alternate" title="[..] - Atom feed" href="/?p=.git;a=atom" type="application/atom+xml" />
<link rel="alternate" title="[..] - Atom feed (no merges)" href="/?p=.git;a=atom;opt=--no-merges" type="application/atom+xml" />

Signed-off-by: Sebastian Pipping <sebastian@pipping.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: modernise style: more uses of test_line_countStefano Lattarini Wed, 11 Apr 2012 11:24:01 +0000 (13:24 +0200)

tests: modernise style: more uses of test_line_count

Prefer:

test_line_count <OP> COUNT FILE

over:

test $(wc -l <FILE) <OP> COUNT

(or similar usages) in several tests.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revision: insert unsorted, then sort in prepare_revisio... René Scharfe Sat, 31 Mar 2012 22:11:01 +0000 (00:11 +0200)

revision: insert unsorted, then sort in prepare_revision_walk()

Speed up prepare_revision_walk() by adding commits without sorting
to the commit_list and at the end sort the list in one go. Thanks
to mergesort() working behind the scenes, this is a lot faster for
large numbers of commits than the current insert sort.

Also introduce and use commit_list_reverse(), to keep the ordering
of commits sharing the same commit date unchanged. That's because
commit_list_insert_by_date() sorts commits with descending date,
but adds later entries with the same date entries last, while
commit_list_insert() always inserts entries at the top. The
following commit_list_sort_by_date() keeps the order of entries
sharing the same date.

Jeff's test case, in a repo with lots of refs, was to run:

# make a new commit on top of HEAD, but not yet referenced
sha1=`git commit-tree HEAD^{tree} -p HEAD </dev/null`

# now do the same "connected" test that receive-pack would do
git rev-list --objects $sha1 --not --all

With a git.git with a ref for each revision, master needs (best of
five):

real 0m2.210s
user 0m2.188s
sys 0m0.016s

And with this patch:

real 0m0.480s
user 0m0.456s
sys 0m0.020s

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

commit: use mergesort() in commit_list_sort_by_date()René Scharfe Sat, 31 Mar 2012 22:10:39 +0000 (00:10 +0200)

commit: use mergesort() in commit_list_sort_by_date()

Replace the insertion sort in commit_list_sort_by_date() with a
call to the generic mergesort function. This sets the stage for
using commit_list_sort_by_date() for larger lists, as shown in
the next patch.

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

add mergesort() for linked listsRené Scharfe Sat, 31 Mar 2012 22:10:11 +0000 (00:10 +0200)

add mergesort() for linked lists

This adds a generic bottom-up mergesort implementation for singly linked
lists. It was inspired by Simon Tatham's webpage on the topic[1], but
not so much by his implementation -- for no good reason, really, just a
case of NIH.

[1] http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html

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

unpack-trees: plug minor memory leakRené Scharfe Tue, 6 Mar 2012 19:37:23 +0000 (20:37 +0100)

unpack-trees: plug minor memory leak

The allocations made by unpack_nondirectories() using create_ce_entry()
are never freed.

In the non-merge case, we duplicate them using add_entry() and later
only look at the first allocated element (src[0]), perhaps even only
by mistake. Split out the actual addition from add_entry() into the
new helper do_add_entry() and call this non-duplicating function
instead of add_entry() to avoid the leak.

Valgrind reports this for the command "git archive v1.7.9" without
the patch:

==13372== LEAK SUMMARY:
==13372== definitely lost: 230,986 bytes in 2,325 blocks
==13372== indirectly lost: 0 bytes in 0 blocks
==13372== possibly lost: 98 bytes in 1 blocks
==13372== still reachable: 2,259,198 bytes in 3,243 blocks
==13372== suppressed: 0 bytes in 0 blocks

And with the patch applied:

==13375== LEAK SUMMARY:
==13375== definitely lost: 65 bytes in 1 blocks
==13375== indirectly lost: 0 bytes in 0 blocks
==13375== possibly lost: 0 bytes in 0 blocks
==13375== still reachable: 2,364,417 bytes in 3,245 blocks
==13375== suppressed: 0 bytes in 0 blocks

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

unpack-trees: don't perform any index operation if... René Scharfe Tue, 10 Apr 2012 18:55:58 +0000 (20:55 +0200)

unpack-trees: don't perform any index operation if we're not merging

src[0] points to the index entry in the merge case and to the first
tree to unpack in the non-merge case. We only want to mark the index
entry, so check first if we're merging.

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

do_for_each_ref(): only iterate over the subtree that... Michael Haggerty Tue, 10 Apr 2012 05:30:27 +0000 (07:30 +0200)

do_for_each_ref(): only iterate over the subtree that was requested

If the base argument has a "/" chararacter, then only iterate over the
reference subdir whose name is the part up to the last "/".

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: store references hierarchicallyMichael Haggerty Tue, 10 Apr 2012 05:30:26 +0000 (07:30 +0200)

refs: store references hierarchically

Store references hierarchically in a tree that matches the
pseudo-directory structure of the reference names. Add a new kind of
ref_entry (with flag REF_DIR) to represent a whole subdirectory of
references. Sort ref_dirs one subdirectory at a time.

NOTE: the dirs can now be sorted as a side-effect of other function
calls. Therefore, it would be problematic to do something from a
each_ref_fn callback that could provoke the sorting of a directory
that is currently being iterated over (i.e., the directory containing
the entry that is being processed or any of its parents).

This is a bit far-fetched, because a directory is always sorted just
before being iterated over. Therefore, read-only accesses cannot
trigger the sorting of a directory whose iteration has already
started. But if a callback function would add a reference to a parent
directory of the reference in the iteration, then try to resolve a
reference under that directory, a re-sort could be triggered and cause
the iteration to work incorrectly.

Nevertheless...add a comment in refs.h warning against modifications
during iteration.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sort_ref_dir(): simplify logicMichael Haggerty Tue, 10 Apr 2012 05:30:25 +0000 (07:30 +0200)

sort_ref_dir(): simplify logic

Use the more usual indexing idiom for clarity.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: rename ref_array -> ref_dirMichael Haggerty Tue, 10 Apr 2012 05:30:24 +0000 (07:30 +0200)

refs.c: rename ref_array -> ref_dir

This purely textual change is in preparation for storing references
hierarchically, when the old ref_array structure will represent one
"directory" of references. Rename functions that deal with this
structure analogously, and also rename the structure's "refs" member
to "entries".

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

struct ref_entry: nest the value part in a unionMichael Haggerty Tue, 10 Apr 2012 05:30:23 +0000 (07:30 +0200)

struct ref_entry: nest the value part in a union

This change is obviously silly by itself, but it is a step towards
adding a second member to the union.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

check_refname_component(): return 0 for zero-length... Michael Haggerty Tue, 10 Apr 2012 05:30:22 +0000 (07:30 +0200)

check_refname_component(): return 0 for zero-length components

Return 0 (instead of -1) for zero-length components. Move the
interpretation of zero-length components as illegal to
check_refname_format().

This will make it easier to extend check_refname_format() to also
check whether directory names are valid.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

free_ref_entry(): new functionMichael Haggerty Tue, 10 Apr 2012 05:30:21 +0000 (07:30 +0200)

free_ref_entry(): new function

Add a function free_ref_entry(). This function will become nontrivial
when ref_entry (soon) becomes polymorphic.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

names_conflict(): simplify implementationMichael Haggerty Tue, 10 Apr 2012 05:30:19 +0000 (07:30 +0200)

names_conflict(): simplify implementation

Save a bunch of lines of code and a couple of strlen() calls.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

repack_without_ref(): reimplement using do_for_each_ref... Michael Haggerty Tue, 10 Apr 2012 05:30:17 +0000 (07:30 +0200)

repack_without_ref(): reimplement using do_for_each_ref_in_array()

It costs a bit of boilerplate, but it means that the function can be
ignorant of how cached refs are stored.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

do_for_each_ref_in_arrays(): new functionMichael Haggerty Tue, 10 Apr 2012 05:30:16 +0000 (07:30 +0200)

do_for_each_ref_in_arrays(): new function

Extract function do_for_each_ref_in_arrays() from do_for_each_ref().
The new function will be a useful building block for storing refs
hierarchically.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

do_for_each_ref_in_array(): new functionMichael Haggerty Tue, 10 Apr 2012 05:30:15 +0000 (07:30 +0200)

do_for_each_ref_in_array(): new function

Extract function do_for_each_ref_in_array() from do_for_each_ref().
The new function will be a useful building block for storing refs
hierarchically.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: manage current_ref within do_one_ref()Michael Haggerty Tue, 10 Apr 2012 05:30:14 +0000 (07:30 +0200)

refs: manage current_ref within do_one_ref()

Set and clear current_ref within do_one_ref() instead of setting it
here and leaving it to somebody else to clear it.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: reorder definitions more logicallyMichael Haggerty Tue, 10 Apr 2012 05:30:13 +0000 (07:30 +0200)

refs.c: reorder definitions more logically

Reorder definitions in file: first check_refname_format() and helper
functions, then the functions for managing the ref_entry and ref_array
data structures, then ref_cache, then the more "business-logicky"
stuff. No code is changed.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: Updated pt_PT languageMarco Sousa Tue, 10 Apr 2012 22:04:30 +0000 (00:04 +0200)

l10n: Updated pt_PT language

var doc: advertise current DEFAULT_PAGER and DEFAULT_ED... Jonathan Nieder Sat, 31 Mar 2012 08:44:53 +0000 (03:44 -0500)

var doc: advertise current DEFAULT_PAGER and DEFAULT_EDITOR settings

Document the default pager and editor chosen at compile time in the
git-var(1) manpage so users curious about what command _this_ copy of
git will fall back to when EDITOR, VISUAL, and PAGER are unset can
find the answer quickly.

In builds leaving those settings uncustomized, this patch makes the
manpage continue to say "usually vi" and "usually less" so the
formatted documentation is usable for a wide audience including users
of custom builds that change those settings. If you would like your
copy of the docs to be less noncommittal, you will need to set
DEFAULT_PAGER=less and DEFAULT_EDITOR=vi explicitly.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-curl: main test case for the OS command line... Ivan Todoroski Mon, 2 Apr 2012 15:17:03 +0000 (17:17 +0200)

remote-curl: main test case for the OS command line overflow

This is main test case for the original problem that triggered this
patch series. We create a repo with 50k tags and then test whether
git-clone over the smart HTTP protocol succeeds.

Note that we construct the repo in a slightly different way than the
original script used to reproduce the problem. This is because the
original script just created 50k tags all pointing to the same commit,
so if there was a bug where remote-curl.c was not passing all the refs
to fetch-pack we wouldn't know. The clone would succeed even if only one
tag was passed, because all the other tags were pointing at the same SHA
and would be considered present.

Instead we create a repo with 50k independent (dangling) commits and
then tag each of those commits with a unique tag. This way if one of the
tags is not given to fetch-pack, later stages of the clone would
complain about it.

This allows us to test both that the command line overflow was fixed, as
well as that it was fixed in a way that doesn't leave out any of the
refs.

Signed-off-by: Ivan Todoroski <grnch@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch-pack: test cases for the new --stdin optionIvan Todoroski Mon, 2 Apr 2012 15:16:24 +0000 (17:16 +0200)

fetch-pack: test cases for the new --stdin option

These test cases focus only on testing the parsing of refs on stdin,
without bothering with the rest of the fetch-pack machinery. We pass in
the refs using different combinations of command line and stdin and then
we watch fetch-pack's stdout to see whether it prints all the refs we
specified (but we ignore their order).

Signed-off-by: Ivan Todoroski <grnch@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-curl: send the refs to fetch-pack on stdinIvan Todoroski Mon, 2 Apr 2012 15:14:44 +0000 (17:14 +0200)

remote-curl: send the refs to fetch-pack on stdin

Now that we can throw an arbitrary number of refs at fetch-pack using
its --stdin option, we use it in the remote-curl helper to bypass the
OS command line length limit.

Signed-off-by: Ivan Todoroski <grnch@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: tighten parsing of datarefsPete Wyckoff Sat, 7 Apr 2012 22:59:20 +0000 (18:59 -0400)

fast-import: tighten parsing of datarefs

The syntax for the use of mark references in fast-import
demands either a SP (space) or LF (end-of-line) after
a mark reference. Fast-import does not complain when garbage
appears after a mark reference in some cases.

Factor out parsing of mark references and complain if
errant characters are found. Also be a little more careful
when parsing "inline" and SHA1s, complaining if extra
characters appear or if the form of the dataref is unrecognized.

Buggy input can cause fast-import to produce the wrong output,
silently, without error. This makes it difficult to track
down buggy generators of fast-import streams. An example is
seen in the last line of this commit command:

commit refs/heads/S2
committer Name <name@example.com> 1112912893 -0400
data <<COMMIT
commit message
COMMIT
from :1M 100644 :103 hello.c

It is missing a newline and should be:

[...]
from :1
M 100644 :103 hello.c

What fast-import does is to produce a commit with the same
contents for hello.c as in refs/heads/S2^. What the buggy
program was expecting was the contents of blob :103. While
the resulting commit graph looked correct, the contents in
some commits were wrong.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 10 Apr 2012 19:45:35 +0000 (12:45 -0700)

Merge branch 'maint'

* maint:
test-subprocess: fix segfault without arguments
submodule: fix prototype of gitmodules_config

Merge branch 'maint-1.7.9' into maintJunio C Hamano Tue, 10 Apr 2012 19:44:58 +0000 (12:44 -0700)

Merge branch 'maint-1.7.9' into maint

* maint-1.7.9:

Merge branch 'maint-1.7.8' into maint-1.7.9Junio C Hamano Tue, 10 Apr 2012 19:44:45 +0000 (12:44 -0700)

Merge branch 'maint-1.7.8' into maint-1.7.9

* maint-1.7.8:
Documentation/gitweb: trivial English fixes
fetch/receive: remove over-pessimistic connectivity check

test-subprocess: fix segfault without argumentsRené Scharfe Tue, 10 Apr 2012 19:07:34 +0000 (21:07 +0200)

test-subprocess: fix segfault without arguments

Check if we even have a parameter before checking its value. Running
this command without any arguments may not make a lot of sense, but
reacting with a segmentation fault is unduly harsh.

While we're at it, avoid casting argv by declaring it const right away.

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

submodule: fix prototype of gitmodules_configRené Scharfe Tue, 10 Apr 2012 19:10:26 +0000 (21:10 +0200)

submodule: fix prototype of gitmodules_config

Add void to make it match its definition in submodule.c.

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

rev-parse --show-prefix: add in trailing newlineRoss Lagerwall Mon, 9 Apr 2012 13:27:56 +0000 (15:27 +0200)

rev-parse --show-prefix: add in trailing newline

Print out a trailing newline when --show-prefix is run with cwd
at the top level of the tree which results in an empty prefix.
Behavior is now like --show-cdup.

Fixes an expected failure in t1501.

Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fix http auth with multiple curl handlesJeff King Tue, 10 Apr 2012 09:53:40 +0000 (11:53 +0200)

fix http auth with multiple curl handles

HTTP authentication is currently handled by get_refs and fetch_ref, but
not by fetch_object, fetch_pack or fetch_alternates. In the
single-threaded case, this is not an issue, since get_refs is always
called first. It recognigzes the 401 and prompts the user for
credentials, which will then be used subsequently.

If the curl multi interface is used, however, only the multi handle used
by get_refs will have credentials configured. Requests made by other
handles fail with an authentication error.

Fix this by setting CURLOPT_USERPWD whenever a slot is requested.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http auth fails with multiple curl handlesClemens Buchacher Tue, 10 Apr 2012 09:53:39 +0000 (11:53 +0200)

http auth fails with multiple curl handles

Create a repo with multiple loose objects in order to demonstrate http
authentication breakage.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix git-subtree install instructionsDavid A. Greene Tue, 10 Apr 2012 03:19:01 +0000 (22:19 -0500)

Fix git-subtree install instructions

Update the install instructions to reflect the changes for an
integrated git-subtree.

Signed-off-by: David A. Greene <greened@obbligato.org>

Use git-subtree test MakefileDavid A. Greene Tue, 10 Apr 2012 03:07:02 +0000 (22:07 -0500)

Use git-subtree test Makefile

Use the Makefile in contrib/subtree/t to run git-subtree tests.

Signed-off-by: David A. Greene <greened@obbligato.org>

Add subtree test MakefileDavid A. Greene Sun, 5 Feb 2012 22:29:06 +0000 (16:29 -0600)

Add subtree test Makefile

Add a Makefile to run subtree tests. This is largely copied
from the standard test suite with irrelevant targets removed
and some paths altered to account for where subtree tests live.

Signed-off-by: David A. Greene <greened@obbligato.org>

Install git-subtree from contribDavid A. Greene Tue, 10 Apr 2012 02:13:03 +0000 (21:13 -0500)

Install git-subtree from contrib

Build git-subtree in its contrib directory and install from there.
The main Makefile no longer discovers subcommands build in the main
build area so we cannot count on it to install git-subtree. The user
should make && make install in contrib/subtree to install git-subtree.

Change the rule to install the git-subtree manpage. The main
Documentation area doesn't directly support installing documentation
from other directories so the user will have to do that from within
contrib/subtree for now.

Signed-off-by: David A. Greene <greened@obbligato.org>

Use configure settings for git-subtreeDavid A. Greene Tue, 10 Apr 2012 02:39:08 +0000 (21:39 -0500)

Use configure settings for git-subtree

Include config.make.autogen in the git-subtree contrib area to pick up
settings for prefix and other such things.

Signed-off-by: David A. Greene <greened@obbligato.org>

Use project config filesDavid A. Greene Sun, 29 Jan 2012 22:17:43 +0000 (16:17 -0600)

Use project config files

Use project-wide files to process documentation for git-subtree.

Signed-off-by: David A. Greene <greened@obbligato.org>

Remove unnecessary git-subtree filesDavid A. Greene Tue, 10 Apr 2012 03:11:25 +0000 (22:11 -0500)

Remove unnecessary git-subtree files

Remove various files that simply duplicate functionality already
provided by the main project files.

Signed-off-by: David A. Greene <greened@obbligato.org>

Set TEST_DIRECTORYDavid A. Greene Tue, 20 Mar 2012 23:11:49 +0000 (18:11 -0500)

Set TEST_DIRECTORY

Set TEST_DIRECTORY to the main git test area. This allows the
git-subtree out-of-tree tests to run correctly.

Signed-off-by: David A. Greene <greened@obbligato.org>

Add 'contrib/subtree/' from commit 'd3a04e06c77d57978bb... David A. Greene Tue, 10 Apr 2012 01:22:55 +0000 (20:22 -0500)

Add 'contrib/subtree/' from commit 'd3a04e06c77d57978bb5230361c64946232cc346'

git-subtree-dir: contrib/subtree
git-subtree-mainline: e8dde3e5f9ddb7cf95a6ff3cea6cf07c3a2db80d
git-subtree-split: d3a04e06c77d57978bb5230361c64946232cc346

rebase -i continue: don't skip commits that only change... John Keeping Sat, 7 Apr 2012 10:20:53 +0000 (11:20 +0100)

rebase -i continue: don't skip commits that only change submodules

When git-rebase--interactive stops due to a conflict and the only change
to be committed is in a submodule, the test for whether there is
anything to be committed ignores the staged submodule change. This
leads rebase to skip creating the commit for the change.

While unstaged submodule changes should be ignored to avoid needing to
update submodules during a rebase, it is safe to remove the
--ignore-submodules option to diff-index because --cached ensures that
it is only checking the index. This was discussed in [1] and a test is
included to ensure that unstaged changes are still ignored correctly.

[1] http://thread.gmane.org/gmane.comp.version-control.git/188713

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote: update builtin usageMichael Schubert Sat, 7 Apr 2012 14:25:52 +0000 (16:25 +0200)

remote: update builtin usage

Add missing options "--tags|--no-tags" and "--push".

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>