gitweb.git
Merge branch 'ef/ipv4-connect-error-report'Junio C Hamano Thu, 11 Aug 2011 18:03:06 +0000 (11:03 -0700)

Merge branch 'ef/ipv4-connect-error-report'

* ef/ipv4-connect-error-report:
connect: only log if all attempts failed (ipv4)

am: Document new --exclude=<path> optionmaximilian attems Tue, 9 Aug 2011 15:21:08 +0000 (17:21 +0200)

am: Document new --exclude=<path> option

The --exclude=<path> option is passed down to apply; document it as such.

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: add support for bisecting bare repositoriesJon Seymour Tue, 9 Aug 2011 02:11:54 +0000 (12:11 +1000)

bisect: add support for bisecting bare repositories

This enhances the support for bisecting history in bare repositories.

The "git bisect" command no longer needs to be run inside a repository
with a working tree; it defaults to --no-checkout when run in a bare
repository.

Two tests are included to demonstrate this behaviour.

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

helping smart-http/stateless-rpc fetch raceJunio C Hamano Fri, 5 Aug 2011 20:54:06 +0000 (13:54 -0700)

helping smart-http/stateless-rpc fetch race

A request to fetch from a client over smart HTTP protocol is served in
multiple steps. In the first round, the server side shows the set of refs
it has and their values, and the client picks from them and sends "I want
to fetch the history leading to these commits".

When the server tries to respond to this second request, its refs may have
progressed by a push from elsewhere. By design, we do not allow fetching
objects that are not at the tip of an advertised ref, and the server
rejects such a request. The client needs to try again, which is not ideal
especially for a busy server.

Teach upload-pack (which is the workhorse driven by git-daemon and smart
http server interface) that it is OK for a smart-http client to ask for
commits that are not at the tip of any advertised ref, as long as they are
reachable from advertised refs.

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

xdiff/xhistogram: drop need for additional variableTay Ray Chuan Mon, 1 Aug 2011 04:20:10 +0000 (12:20 +0800)

xdiff/xhistogram: drop need for additional variable

Having an additional variable (ptr) instead of changing line(1|2) and
count(1|2) was for debugging purposes.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

xdiff/xhistogram: rely on xdl_trim_ends()Tay Ray Chuan Mon, 1 Aug 2011 04:20:09 +0000 (12:20 +0800)

xdiff/xhistogram: rely on xdl_trim_ends()

Do away with reduce_common_start_end() and use xdf->dstart and xdf->dend
set by xdl_trim_ends() that similarly tells us where the first unmatched
line from the start and end occurs.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

xdiff/xhistogram: rework handling of recursed resultsTay Ray Chuan Mon, 1 Aug 2011 04:20:08 +0000 (12:20 +0800)

xdiff/xhistogram: rework handling of recursed results

Previously we were over-complicating matters by trying to combine the
recursed results. Now, terminate immediately if a recursive call failed
and return its result.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'oa/pull-reflog'Junio C Hamano Mon, 8 Aug 2011 19:33:36 +0000 (12:33 -0700)

Merge branch 'oa/pull-reflog'

* oa/pull-reflog:
pull: remove extra space from reflog message

Conflicts:
git-pull.sh

Merge branch 'ms/reflog-show-is-default'Junio C Hamano Mon, 8 Aug 2011 19:33:35 +0000 (12:33 -0700)

Merge branch 'ms/reflog-show-is-default'

* ms/reflog-show-is-default:
reflog: actually default to subcommand 'show'

Merge branch 'jl/submodule-status-summary-doc'Junio C Hamano Mon, 8 Aug 2011 19:33:35 +0000 (12:33 -0700)

Merge branch 'jl/submodule-status-summary-doc'

* jl/submodule-status-summary-doc:
Documentation/submodule: add command references and update options

Merge branch 'jn/gitweb-config-list-case'Junio C Hamano Mon, 8 Aug 2011 19:33:35 +0000 (12:33 -0700)

Merge branch 'jn/gitweb-config-list-case'

* jn/gitweb-config-list-case:
gitweb: Git config keys are case insensitive, make config search too

Merge branch 'jl/submodule-update-quiet'Junio C Hamano Mon, 8 Aug 2011 19:33:34 +0000 (12:33 -0700)

Merge branch 'jl/submodule-update-quiet'

* jl/submodule-update-quiet:
submodule: update and add must honor --quiet flag

Merge branch 'js/ls-tree-error'Junio C Hamano Mon, 8 Aug 2011 19:33:34 +0000 (12:33 -0700)

Merge branch 'js/ls-tree-error'

* js/ls-tree-error:
Ensure git ls-tree exits with a non-zero exit code if read_tree_recursive fails.
Add a test to check that git ls-tree sets non-zero exit code on error.

Merge branch 'jn/gitweb-system-config'Junio C Hamano Mon, 8 Aug 2011 19:33:34 +0000 (12:33 -0700)

Merge branch 'jn/gitweb-system-config'

* jn/gitweb-system-config:
gitweb: Introduce common system-wide settings for convenience

Merge branch 'jk/reset-reflog-message-fix'Junio C Hamano Mon, 8 Aug 2011 19:33:33 +0000 (12:33 -0700)

Merge branch 'jk/reset-reflog-message-fix'

* jk/reset-reflog-message-fix:
reset: give better reflog messages

Merge branch 'jc/diff-index-refactor'Junio C Hamano Mon, 8 Aug 2011 19:33:33 +0000 (12:33 -0700)

Merge branch 'jc/diff-index-refactor'

* jc/diff-index-refactor:
diff-lib: refactor run_diff_index() and do_diff_cache()
diff-lib: simplify do_diff_cache()

receive-pack: do not overstep command line argument... Junio C Hamano Mon, 8 Aug 2011 19:31:01 +0000 (12:31 -0700)

receive-pack: do not overstep command line argument array

Previous commit added one element to the command line, without
making sure the result fits there.

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

Merge branch 'maint'Junio C Hamano Mon, 8 Aug 2011 19:24:16 +0000 (12:24 -0700)

Merge branch 'maint'

* maint:
filter-branch: Export variable `workdir' for --commit-filter
Documentation/Makefile: add *.pdf to `clean' target
Documentation: ignore *.pdf files

filter-branch: Export variable `workdir' for --commit... Michael Witten Sun, 7 Aug 2011 02:44:43 +0000 (02:44 +0000)

filter-branch: Export variable `workdir' for --commit-filter

According to `git help filter-branch':

--commit-filter <command>
...
You can use the _map_ convenience function in this filter,
and other convenience functions, too...
...

However, it turns out that `map' hasn't been usable because it depends
on the variable `workdir', which is not propogated to the environment
of the shell that runs the commit-filter <command> because the
shell is created via a simple-command rather than a compound-command
subshell:

@SHELL_PATH@ -c "$filter_commit" "git commit-tree" \
$(git write-tree) $parentstr < ../message > ../map/$commit ||
die "could not write rewritten commit"

One solution is simply to export `workdir'. However, it seems rather
heavy-handed to export `workdir' to the environments of all commands,
so instead this commit exports `workdir' for only the duration of the
shell command in question:

workdir=$workdir @SHELL_PATH@ -c "$filter_commit" "git commit-tree" \
$(git write-tree) $parentstr < ../message > ../map/$commit ||
die "could not write rewritten commit"

Signed-off-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: take advantage of gettextln and eval_gettextln.Jon Seymour Sun, 7 Aug 2011 11:58:17 +0000 (21:58 +1000)

submodule: take advantage of gettextln and eval_gettextln.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stash: take advantage of eval_gettextlnJon Seymour Sun, 7 Aug 2011 11:58:16 +0000 (21:58 +1000)

stash: take advantage of eval_gettextln

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pull: take advantage of eval_gettextlnJon Seymour Sun, 7 Aug 2011 11:58:15 +0000 (21:58 +1000)

pull: take advantage of eval_gettextln

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-am: take advantage of gettextln and eval_gettextln.Jon Seymour Sun, 7 Aug 2011 11:58:14 +0000 (21:58 +1000)

git-am: take advantage of gettextln and eval_gettextln.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gettext: add gettextln, eval_gettextln to encode common... Jon Seymour Sun, 7 Aug 2011 11:58:13 +0000 (21:58 +1000)

gettext: add gettextln, eval_gettextln to encode common idiom

Currently, if you want to use gettext or eval_gettext to format a message
you may have to add a separate echo statement and a surrounding subshell
in order to interpolate the required trailing new line.

This patch introduces two new helper functions, gettextln and eval_gettextln
which append a trailing newline to the gettext output.

This allows constructions of the form:

if test -s "$GIT_DIR/BISECT_START"
then
(
gettext "You need to give me at least one good and one bad revisions.
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" &&
echo
) >&2
else
...

to be expressed more concisely as:

if test -s "$GIT_DIR/BISECT_START"
then
gettextln "You need to give me at least one good and one bad revisions.
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" >&2
else
...

Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: cope better with use of return for errorsJonathan Nieder Mon, 8 Aug 2011 01:17:09 +0000 (03:17 +0200)

test: cope better with use of return for errors

In olden times, tests would quietly exit the script when they failed
at an inconvenient moment, which was a little disconcerting.
Therefore v0.99.5~24^2~4 (Trapping exit in tests, using return for
errors, 2005-08-10) switched to an idiom of using "return" instead,
wrapping evaluation of test code in a function to make that safe:

test_run_ () {
eval >&3 2>&4 "$1"
eval_ret="$?"
return 0
}

Years later, the implementation of test_when_finished (v1.7.1.1~95,
2010-05-02) and v1.7.2-rc2~1^2~13 (test-lib: output a newline before
"ok" under a TAP harness, 2010-06-24) took advantage of test_run_ as a
place to put code shared by all test assertion functions, without
paying attention to the function's former purpose:

test_run_ () {
...
eval >&3 2>&4 "$1"
eval_ret=$?

if should run cleanup
then
eval >&3 2>&4 "$test_cleanup"
fi
if TAP format requires a newline here
then
echo
fi
return 0
}

That means cleanup commands and the newline to put TAP output at
column 0 are skipped when tests use "return" to fail early. Fix it by
introducing a test_eval_ function to catch the "return", with a
comment explaining the new function's purpose for the next person who
might touch this code.

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

test: simplify return value of test_run_Jonathan Nieder Mon, 8 Aug 2011 01:15:34 +0000 (03:15 +0200)

test: simplify return value of test_run_

As v0.99.5~24^2~4 (Trapping exit in tests, using return for errors,
2005-08-10) explains, callers to test_run_ (such as test_expect_code)
used to check the result from eval and the return value separately so
tests that fail early could be distinguished from tests that completed
normally with successful (nonzero) status. Eventually tests that
succeed with nonzero status were phased out (see v1.7.4-rc0~65^2~19,
2010-10-03 and especially v1.5.5-rc0~271, 2008-02-01) but the weird
two-return-value calling convention lives on.

Let's get rid of it. The new rule: test_run_ succeeds (returns 0)
if and only if the test succeeded.

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

Documentation/Makefile: add *.pdf to `clean' targetEmilio G. Cota Mon, 8 Aug 2011 08:33:05 +0000 (04:33 -0400)

Documentation/Makefile: add *.pdf to `clean' target

user-manual.pdf is not removed by `make clean'; fix it.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: ignore *.pdf filesEmilio G. Cota Mon, 8 Aug 2011 08:33:04 +0000 (04:33 -0400)

Documentation: ignore *.pdf files

user-manual.pdf is generated by the build and therefore
should be ignored by git.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-export: quote paths in outputJeff King Fri, 5 Aug 2011 22:36:22 +0000 (16:36 -0600)

fast-export: quote paths in output

Many pathnames in a fast-import stream need to be quoted. In
particular:

1. Pathnames at the end of an "M" or "D" line need quoting
if they contain a LF or start with double-quote.

2. Pathnames on a "C" or "R" line need quoting as above,
but also if they contain spaces.

For (1), we weren't quoting at all. For (2), we put
double-quotes around the paths to handle spaces, but ignored
the possibility that they would need further quoting.

This patch checks whether each pathname needs c-style
quoting, and uses it. This is slightly overkill for (1),
which doesn't actually need to quote many characters that
vanilla c-style quoting does. However, it shouldn't hurt, as
any implementation needs to be ready to handle quoted
strings anyway.

In addition to adding a test, we have to tweak a test which
blindly assumed that case (2) would always use
double-quotes, whether it needed to or not.

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

filter-branch.sh: de-dent usage stringJunio C Hamano Fri, 5 Aug 2011 22:06:21 +0000 (15:06 -0700)

filter-branch.sh: de-dent usage string

"Usage: git filter-branch " that is prefixed to the first line is 25
columns long, so the "[--index-filter ..." on the second line would not
align with "[--env-filter ..." on the first line to begin with. If the
second and subsequent lines do not aim to align with anything on the
first line, it is just fine to indent them with a single HT.

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

misc-sh: fix up whitespace in some other .sh files.Jon Seymour Fri, 5 Aug 2011 13:31:29 +0000 (23:31 +1000)

misc-sh: fix up whitespace in some other .sh files.

I found that the patched 4 files were different when this
filter is applied.

expand -i | unexpand --first-only

This patch contains the corrected files.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'tc/minix'Junio C Hamano Fri, 5 Aug 2011 21:55:00 +0000 (14:55 -0700)

Merge branch 'tc/minix'

* tc/minix:
Makefile: add Minix configuration options.

Merge branch 'jc/pack-order-tweak'Junio C Hamano Fri, 5 Aug 2011 21:54:57 +0000 (14:54 -0700)

Merge branch 'jc/pack-order-tweak'

* jc/pack-order-tweak:
pack-objects: optimize "recency order"
core: log offset pack data accesses happened

bisect: further style nitpicksJunio C Hamano Fri, 5 Aug 2011 17:09:23 +0000 (10:09 -0700)

bisect: further style nitpicks

Fix a few remaining lines that indented with spaces.

Also simplify the logic of checking out the original branch and reporting
error during "bisect reset".

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

bisect: replace "; then" with "\n<tab>*then"Jon Seymour Fri, 5 Aug 2011 11:31:31 +0000 (21:31 +1000)

bisect: replace "; then" with "\n<tab>*then"

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: cleanup whitespace errors in git-bisect.sh.Jon Seymour Fri, 5 Aug 2011 11:31:30 +0000 (21:31 +1000)

bisect: cleanup whitespace errors in git-bisect.sh.

All leading whitespace is now encoded with tabs.

After this patch, the following is true:

RAW=$(cat git-bisect.sh | md5sum) &&
ROUNDTRIP=$(cat git-bisect.sh | expand -i - | unexpand --first-only - | md5sum) &&
LEADING=$(sed -n "/^ */p" < git-bisect.sh | wc -l) &&
test $RAW = $ROUNDTRIP &&
test $LEADING = 0 &&
test -z "$(git diff -w HEAD~1 HEAD)"

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-path-utils: Add subcommand "prefix_path"Michael Haggerty Thu, 4 Aug 2011 04:47:48 +0000 (06:47 +0200)

test-path-utils: Add subcommand "prefix_path"

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

test-path-utils: Add subcommand "absolute_path"Michael Haggerty Thu, 4 Aug 2011 04:47:47 +0000 (06:47 +0200)

test-path-utils: Add subcommand "absolute_path"

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

git-check-attr: Normalize pathsMichael Haggerty Thu, 4 Aug 2011 04:47:46 +0000 (06:47 +0200)

git-check-attr: Normalize paths

Normalize the path arguments (relative to the working tree root, if
applicable) before looking up their attributes. This requires passing
the prefix down the call chain.

This fixes two test cases for different reasons:

* "unnormalized paths" is fixed because the .gitattribute-file-seeking
code is not confused into reading the top-level file twice.

* "relative paths" is fixed because the canonical pathnames are passed
to get_check_attr() or get_all_attrs(), allowing them to match the
pathname patterns as expected.

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

git-check-attr: Demonstrate problems with relative... Michael Haggerty Thu, 4 Aug 2011 04:47:45 +0000 (06:47 +0200)

git-check-attr: Demonstrate problems with relative paths

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

git-check-attr: Demonstrate problems with unnormalized... Michael Haggerty Thu, 4 Aug 2011 04:47:44 +0000 (06:47 +0200)

git-check-attr: Demonstrate problems with unnormalized paths

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

git-check-attr: test that no output is written to stderrMichael Haggerty Thu, 4 Aug 2011 04:47:43 +0000 (06:47 +0200)

git-check-attr: test that no output is written to stderr

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

Rename git_checkattr() to git_check_attr()Michael Haggerty Thu, 4 Aug 2011 04:36:33 +0000 (06:36 +0200)

Rename git_checkattr() to git_check_attr()

Suggested by: Junio Hamano <gitster@pobox.com>

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

git-check-attr: Fix command-line handling to match... Michael Haggerty Thu, 4 Aug 2011 04:36:32 +0000 (06:36 +0200)

git-check-attr: Fix command-line handling to match docs

According to the git-check-attr synopsis, if the '--stdin' option is
used then no pathnames are expected on the command line. Change the
behavior to match this description; namely, if '--stdin' is used but
not '--', then treat all command-line arguments as attribute names.

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

git-check-attr: Drive two tests using the same raw... Michael Haggerty Thu, 4 Aug 2011 04:36:31 +0000 (06:36 +0200)

git-check-attr: Drive two tests using the same raw data

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

git-check-attr: Add an --all option to show all attributesMichael Haggerty Thu, 4 Aug 2011 04:36:30 +0000 (06:36 +0200)

git-check-attr: Add an --all option to show all attributes

Add new usage patterns

git check-attr [-a | --all] [--] pathname...
git check-attr --stdin [-a | --all] < <list-of-paths>

which display all attributes associated with the specified file(s).

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

git-check-attr: Error out if no pathnames are specifiedMichael Haggerty Thu, 4 Aug 2011 04:36:29 +0000 (06:36 +0200)

git-check-attr: Error out if no pathnames are specified

If no pathnames are passed as command-line arguments and the --stdin
option is not specified, fail with the error message "No file
specified". Add tests of this behavior.

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

git-check-attr: Process command-line args more systemat... Michael Haggerty Thu, 4 Aug 2011 04:36:28 +0000 (06:36 +0200)

git-check-attr: Process command-line args more systematically

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

git-check-attr: Handle each error separatelyMichael Haggerty Thu, 4 Aug 2011 04:36:27 +0000 (06:36 +0200)

git-check-attr: Handle each error separately

This will make the code easier to refactor.

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

git-check-attr: Extract a function error_with_usage()Michael Haggerty Thu, 4 Aug 2011 04:36:26 +0000 (06:36 +0200)

git-check-attr: Extract a function error_with_usage()

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

git-check-attr: Introduce a new variableMichael Haggerty Thu, 4 Aug 2011 04:36:25 +0000 (06:36 +0200)

git-check-attr: Introduce a new variable

Avoid reusing variable "doubledash" to mean something other than the
expected "position of a double-dash, if any".

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

git-check-attr: Extract a function output_attr()Michael Haggerty Thu, 4 Aug 2011 04:36:24 +0000 (06:36 +0200)

git-check-attr: Extract a function output_attr()

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

Allow querying all attributes on a fileMichael Haggerty Thu, 4 Aug 2011 04:36:23 +0000 (06:36 +0200)

Allow querying all attributes on a file

Add a function, git_all_attrs(), that reports on all attributes that
are set on a path.

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

Remove redundant checkMichael Haggerty Thu, 4 Aug 2011 04:36:22 +0000 (06:36 +0200)

Remove redundant check

bootstrap_attr_stack() also checks whether attr_stack is already set.

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

Remove redundant call to bootstrap_attr_stack()Michael Haggerty Thu, 4 Aug 2011 04:36:21 +0000 (06:36 +0200)

Remove redundant call to bootstrap_attr_stack()

prepare_attr_stack() does the same thing.

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

Extract a function collect_all_attrs()Michael Haggerty Thu, 4 Aug 2011 04:36:20 +0000 (06:36 +0200)

Extract a function collect_all_attrs()

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

Teach prepare_attr_stack() to figure out dirlen itselfMichael Haggerty Thu, 4 Aug 2011 04:36:19 +0000 (06:36 +0200)

Teach prepare_attr_stack() to figure out dirlen itself

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

git-check-attr: Use git_attr_name()Michael Haggerty Thu, 4 Aug 2011 04:36:18 +0000 (06:36 +0200)

git-check-attr: Use git_attr_name()

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

Provide access to the name attribute of git_attrMichael Haggerty Thu, 4 Aug 2011 04:36:17 +0000 (06:36 +0200)

Provide access to the name attribute of git_attr

It will be present in any likely future reimplementation, and its
availability simplifies other code.

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

git-check-attr: Add tests of command-line parsingMichael Haggerty Thu, 4 Aug 2011 04:36:16 +0000 (06:36 +0200)

git-check-attr: Add tests of command-line parsing

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

git-check-attr: Add missing "&&"Michael Haggerty Thu, 4 Aug 2011 04:36:15 +0000 (06:36 +0200)

git-check-attr: Add missing "&&"

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

Disallow the empty string as an attribute nameMichael Haggerty Thu, 4 Aug 2011 04:36:14 +0000 (06:36 +0200)

Disallow the empty string as an attribute name

Previously, it was possible to have a line like "file.txt =foo" in a
.gitattribute file, after which an invocation like "git check-attr ''
-- file.txt" would succeed. This patch disallows both constructs.

Please note that any existing .gitattributes file that tries to set an
empty attribute will now trigger the error message "error: : not a
valid attribute name" whereas previously the nonsense was allowed
through.

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

Remove anachronism from commentMichael Haggerty Thu, 4 Aug 2011 04:36:13 +0000 (06:36 +0200)

Remove anachronism from comment

Setting attributes to arbitrary values ("attribute=value") is now
supported, so it is no longer necessary for this comment to justify
prohibiting '=' in an attribute name.

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

doc: Correct git_attr() calls in example codeMichael Haggerty Thu, 4 Aug 2011 04:36:12 +0000 (06:36 +0200)

doc: Correct git_attr() calls in example code

Commit 7fb0eaa2 (2010-01-17) changed git_attr() to take a string
instead of a string and a length. Update the documentation
accordingly.

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

doc: Add a link from gitattributes(5) to git-check... Michael Haggerty Thu, 4 Aug 2011 04:36:11 +0000 (06:36 +0200)

doc: Add a link from gitattributes(5) to git-check-attr(1)

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

docs: put listed example commands in backticksJeff King Thu, 4 Aug 2011 02:13:29 +0000 (20:13 -0600)

docs: put listed example commands in backticks

Many examples of git command invocation are given in asciidoc listing
blocks, which makes them monospaced and avoids further interpretation of
special characters. Some manpages make a list of examples, like:

git foo::
Run git foo.

git foo -q::
Use the "-q" option.

to quickly show many variants. However, they can sometimes be hard to
read, because they are shown in a proportional-width font (so, for
example, seeing the difference between "-- foo" and "--foo" can be
difficult).

This patch puts all such examples into backticks, which gives the
equivalent formatting to a listing block (i.e., monospaced and without
character interpretation).

As a bonus, this also fixes an example in the git-push manpage, in which
"git push origin :::" was accidentally considered a newly-indented list,
and not a list item with "git push origin :" in it.

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

bisect: add documentation for --no-checkout option.Jon Seymour Thu, 4 Aug 2011 12:01:03 +0000 (22:01 +1000)

bisect: add documentation for --no-checkout option.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: add tests for the --no-checkout option.Jon Seymour Thu, 4 Aug 2011 12:01:02 +0000 (22:01 +1000)

bisect: add tests for the --no-checkout option.

These tests verify that git-bisect --no-checkout can successfully
bisect commit histories that reference damaged trees.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: introduce --no-checkout support into porcelain.Jon Seymour Thu, 4 Aug 2011 12:01:01 +0000 (22:01 +1000)

bisect: introduce --no-checkout support into porcelain.

git-bisect can now perform bisection of a history without performing
a checkout at each stage of the bisection process. Instead, HEAD is updated.

One use-case for this function is allow git bisect to be used with
damaged repositories where git checkout would fail because the tree
referenced by the commit is damaged.

It can also be used in other cases where actual checkout of the tree
is not required to progress the bisection.

Improved-by: Christian Couder <chriscool@tuxfamily.org>
Improved-by: Junio C Hamano <gitster@pobox.com>
Improved-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: introduce support for --no-checkout option.Jon Seymour Thu, 4 Aug 2011 12:01:00 +0000 (22:01 +1000)

bisect: introduce support for --no-checkout option.

If --no-checkout is specified, then the bisection process uses:

git update-ref --no-deref HEAD <trial>

at each trial instead of:

git checkout <trial>

Improved-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: add tests to document expected behaviour in... Jon Seymour Thu, 4 Aug 2011 12:00:59 +0000 (22:00 +1000)

bisect: add tests to document expected behaviour in presence of broken trees.

If the repo is broken, we expect bisect to fail.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: use && to connect statements that are deferred... Jon Seymour Thu, 4 Aug 2011 12:00:58 +0000 (22:00 +1000)

bisect: use && to connect statements that are deferred with eval.

Christian Couder pointed out that the existing eval strategy
swallows an initial non-zero return. Using && to connect
the statements should fix this.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: move argument parsing before state modification.Jon Seymour Thu, 4 Aug 2011 12:00:57 +0000 (22:00 +1000)

bisect: move argument parsing before state modification.

Currently 'git bisect start' modifies some state prior to checking
that its arguments are valid.

This change moves argument validation before state modification
with the effect that state modification does not occur
unless argument validations succeeds.

An existing test is changed to check that new bisect state
is not created if arguments are invalid.

A new test is added to check that existing bisect state
is not modified if arguments are invalid.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: pass string after encoding in utf-8 to syntax... 张忠山 Thu, 4 Aug 2011 15:52:55 +0000 (23:52 +0800)

gitweb: pass string after encoding in utf-8 to syntax highlighter

Otherwise the highlight filter would work on a corrupt byte sequence.

Signed-off-by: 张忠山 <zzs213@126.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add option hooks.diffopts to customize change summary... Jon Jensen Thu, 4 Aug 2011 03:36:08 +0000 (21:36 -0600)

Add option hooks.diffopts to customize change summary in post-receive-email

This makes it easy to customize the git diff-tree options, for example
to include -p to include inline diffs.

It defaults to the current options "--stat --summary --find-copies-harder"
and thus is backward-compatible.

Signed-off-by: Jon Jensen <jon@endpoint.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff -c/--cc: do not mistake "resolved as deletion... Junio C Hamano Thu, 4 Aug 2011 18:39:10 +0000 (11:39 -0700)

diff -c/--cc: do not mistake "resolved as deletion" as "use working tree"

The combined diff machinery can be used to compare:

- a merge commit with its parent commits;
- a working-tree file with multiple stages in an unmerged index; or
- a working-tree file with the HEAD and the index.

The internal function combine-diff.c:show_patch_diff() checked if it needs
to read the "result" from the working tree by looking at the object name
of the result --- if it is null_sha1, it read from the working tree.

This mistook a merge that records a deletion as the conflict resolution
as if it is a cue to read from the working tree. Pass this information
explicitly from the caller instead.

Noticed and reported by Johan Herland.

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

Merge branch 'maint'Junio C Hamano Wed, 3 Aug 2011 21:16:17 +0000 (14:16 -0700)

Merge branch 'maint'

* maint:
add gitignore entry to description about how to write a builtin
gitattributes: Reword "attribute macro" to "macro attribute"
gitattributes: Clarify discussion of attribute macros

add gitignore entry to description about how to write... Heiko Voigt Wed, 3 Aug 2011 18:06:17 +0000 (20:06 +0200)

add gitignore entry to description about how to write a builtin

If the author forgets the gitignore entry the built result will show up
as new file in the git working directory.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: some changes for http-related flag documentationTay Ray Chuan Wed, 3 Aug 2011 12:07:57 +0000 (20:07 +0800)

Makefile: some changes for http-related flag documentation

Rename git-http-pull to git-http-fetch. This was passed over in 215a7ad
(Big tool rename, Wed Sep 7 17:26:23 2005 -0700).

Also, distinguish between dumb and smart in flag docs, as the "warnings"
in NO_CURL and NO_EXPACT are no longer accurate given the introduction
of smart http(s).

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http.c: fix an invalid free()Tay Ray Chuan Wed, 3 Aug 2011 11:54:03 +0000 (19:54 +0800)

http.c: fix an invalid free()

Remove a free() on the static buffer returned by sha1_file_name().

While we're at it, replace xmalloc() calls on the structs
http_(object|pack)_request with xcalloc() so that pointers in the
structs get initialized to NULL. That way, free()'s are safe - for
example, a free() on the url string member when aborting.

This fixes an invalid free().

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Helped-by: Jeff King peff@peff.net
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

am: pass exclude down to applymaximilian attems Wed, 3 Aug 2011 09:37:29 +0000 (11:37 +0200)

am: pass exclude down to apply

This allows to pass patches around from repositories,
where the other repository doesn't feature certain files.

In the special case this works for dash git sync to klibc dash:
git am --directory="usr/dash" --exclude="usr/dash/configure.ac" \
--exclude="usr/dash/ChangeLog" --exclude="usr/dash/dash.1" \
.. -i -s -k ../dash/000X-foo.patch

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitattributes: Reword "attribute macro" to "macro attri... Michael Haggerty Wed, 3 Aug 2011 13:41:30 +0000 (15:41 +0200)

gitattributes: Reword "attribute macro" to "macro attribute"

The new wording makes it clearer that such a beast is an attribute in
addition to being a macro (as opposed to being only a macro that is
used for attributes).

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

gitattributes: Clarify discussion of attribute macrosMichael Haggerty Wed, 3 Aug 2011 13:41:29 +0000 (15:41 +0200)

gitattributes: Clarify discussion of attribute macros

In particular, make it clear that attribute macros are themselves
recorded as attributes in addition to setting other attributes.

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

Skip archive --remote tests on WindowsJohannes Sixt Wed, 3 Aug 2011 08:20:08 +0000 (10:20 +0200)

Skip archive --remote tests on Windows

These depend on a working git-upload-archive, which is broken on Windows,
because it depends on fork().

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

xdiff: do away with xdl_mmfile_next()Tay Ray Chuan Mon, 1 Aug 2011 04:20:07 +0000 (12:20 +0800)

xdiff: do away with xdl_mmfile_next()

Given our simple mmfile structure, xdl_mmfile_next() calls are
redundant. Do away with calls to them.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make test number uniqueJohannes Sixt Wed, 3 Aug 2011 07:25:31 +0000 (09:25 +0200)

Make test number unique

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit: allow partial commits with relative pathsClemens Buchacher Sat, 30 Jul 2011 17:13:47 +0000 (19:13 +0200)

commit: allow partial commits with relative paths

In order to do partial commits, git-commit overlays a tree on the
cache and checks pathspecs against the result. Currently, the
overlaying is done using "prefix" which prevents relative pathspecs
with ".." and absolute pathspec from matching when they refer to
files not under "prefix" and absent from the index, but still in
the tree (i.e. files staged for removal).

The point of providing a prefix at all is performance optimization.
If we say there is no common prefix for the files of interest, then
we have to read the entire tree into the index.

But even if we cannot use the working directory as a prefix, we can
still figure out if there is a common prefix for all given paths,
and use that instead. The pathspec_prefix() routine from ls-files.c
does exactly that.

Any use of global variables is removed from pathspec_prefix() so
that it can be called from commit.c.

Reported-by: Reuben Thomas <rrt@sc3d.org>
Analyzed-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

notice error exit from pagerClemens Buchacher Mon, 1 Aug 2011 17:59:21 +0000 (19:59 +0200)

notice error exit from pager

If the pager fails to run, git produces no output, e.g.:

$ GIT_PAGER=not-a-command git log

The error reporting fails for two reasons:

(1) start_command: There is a mechanism that detects errors during
execvp introduced in 2b541bf8 (start_command: detect execvp
failures early). The child writes one byte to a pipe only if
execvp fails. The parent waits for either EOF, when the
successful execvp automatically closes the pipe (see
FD_CLOEXEC in fcntl(1)), or it reads a single byte, in which
case it knows that the execvp failed. This mechanism is
incompatible with the workaround introduced in 35ce8622
(pager: Work around window resizing bug in 'less'), which
waits for input from the parent before the exec. Since both
the parent and the child are waiting for input from each
other, that would result in a deadlock. In order to avoid
that, the mechanism is disabled by closing the child_notifier
file descriptor.

(2) finish_command: The parent correctly detects the 127 exit
status from the child, but the error output goes nowhere,
since by that time it is already being redirected to the
child.

No simple solution for (1) comes to mind.

Number (2) can be solved by not sending error output to the pager.
Not redirecting error output to the pager can result in the pager
overwriting error output with standard output, however.

Since there is no reliable way to handle error reporting in the
parent, produce the output in the child instead.

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

grep: long context optionsRené Scharfe Mon, 1 Aug 2011 17:22:52 +0000 (19:22 +0200)

grep: long context options

Take long option names for -A (--after-context), -B (--before-context)
and -C (--context) from GNU grep and add a similar long option name
for -W (--function-context).

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

grep: add option to show whole function as contextRené Scharfe Mon, 1 Aug 2011 17:20:53 +0000 (19:20 +0200)

grep: add option to show whole function as context

Add a new option, -W, to show the whole surrounding function of a match.

It uses the same regular expressions as -p and diff to find the beginning
of sections.

Currently it will not display comments in front of a function, but those
that are following one. Despite this shortcoming it is already useful,
e.g. to simply see a more complete applicable context or to extract whole
functions.

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

pull: remove extra space from reflog messageOri Avtalion Fri, 29 Jul 2011 07:19:26 +0000 (10:19 +0300)

pull: remove extra space from reflog message

When executing "git pull" with no arguments, the reflog message was:
"pull : Fast-forward"

Signed-off-by: Ori Avtalion <ori@avtalion.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/submodule: add command references and... Jens Lehmann Mon, 1 Aug 2011 20:49:21 +0000 (22:49 +0200)

Documentation/submodule: add command references and update options

Reference the "git diff" and "git status" commands where they learned
functionality that in earlier git versions was only available through the
'summary' and 'status' subcommands of "git submodule".

The short option '-n' for '--summary-limit' was missing from the synopsis
and the --init option was missing from the "options" section, add those
there. And while at it, quote all options in backticks so they are
decorated properly in the output formats which support that.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'vi/make-test-vector-less-specific'Junio C Hamano Mon, 1 Aug 2011 22:00:38 +0000 (15:00 -0700)

Merge branch 'vi/make-test-vector-less-specific'

* vi/make-test-vector-less-specific:
tests: cleanup binary test vector files

Merge branch 'jk/clone-detached'Junio C Hamano Mon, 1 Aug 2011 22:00:35 +0000 (15:00 -0700)

Merge branch 'jk/clone-detached'

* jk/clone-detached:
clone: always fetch remote HEAD
make copy_ref globally available
consider only branches in guess_remote_head
t: add tests for cloning remotes with detached HEAD

Merge branch 'jc/streaming-filter'Junio C Hamano Mon, 1 Aug 2011 22:00:29 +0000 (15:00 -0700)

Merge branch 'jc/streaming-filter'

* jc/streaming-filter:
streaming: free git_istream upon closing

Merge branch 'sr/transport-helper-fix'Junio C Hamano Mon, 1 Aug 2011 22:00:14 +0000 (15:00 -0700)

Merge branch 'sr/transport-helper-fix'

* sr/transport-helper-fix: (21 commits)
transport-helper: die early on encountering deleted refs
transport-helper: implement marks location as capability
transport-helper: Use capname for refspec capability too
transport-helper: change import semantics
transport-helper: update ref status after push with export
transport-helper: use the new done feature where possible
transport-helper: check status code of finish_command
transport-helper: factor out push_update_refs_status
fast-export: support done feature
fast-import: introduce 'done' command
git-remote-testgit: fix error handling
git-remote-testgit: only push for non-local repositories
remote-curl: accept empty line as terminator
remote-helpers: export GIT_DIR variable to helpers
git_remote_helpers: push all refs during a non-local export
transport-helper: don't feed bogus refs to export push
git-remote-testgit: import non-HEAD refs
t5800: document some non-functional parts of remote helpers
t5800: use skip_all instead of prereq
t5800: factor out some ref tests
...

Merge branch 'jc/maint-reset-unmerged-path'Junio C Hamano Mon, 1 Aug 2011 22:00:08 +0000 (15:00 -0700)

Merge branch 'jc/maint-reset-unmerged-path'

* jc/maint-reset-unmerged-path:
reset [<commit>] paths...: do not mishandle unmerged paths

Merge branch 'maint'Junio C Hamano Mon, 1 Aug 2011 21:45:02 +0000 (14:45 -0700)

Merge branch 'maint'

* maint:
connect: correctly number ipv6 network adapter

Merge branch 'nk/ref-doc' into maintJunio C Hamano Mon, 1 Aug 2011 21:44:24 +0000 (14:44 -0700)

Merge branch 'nk/ref-doc' into maint

* nk/ref-doc:
glossary: clarify description of HEAD
glossary: update description of head and ref
glossary: update description of "tag"
git.txt: de-emphasize the implementation detail of a ref
check-ref-format doc: de-emphasize the implementation detail of a ref
git-remote.txt: avoid sounding as if loose refs are the only ones in the world
git-remote.txt: fix wrong remote refspec

Merge branch 'jl/maint-fetch-recursive-fix' into maintJunio C Hamano Mon, 1 Aug 2011 21:44:17 +0000 (14:44 -0700)

Merge branch 'jl/maint-fetch-recursive-fix' into maint

* jl/maint-fetch-recursive-fix:
fetch: Also fetch submodules in subdirectories in on-demand mode