Граф коммитов

26317 Коммитов

Автор SHA1 Сообщение Дата
Junio C Hamano b91766295f Update draft release notes to 1.7.7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-11 12:12:22 -07:00
Johannes Sixt 23ce5c39dc t3900: do not reference numbered arguments from the test script
The call to test_expect_success is nested inside a function, whose
arguments the test code wants to access. But it is not specified that any
unexpanded $1, $2, $3, etc in the test code will access the surrounding
function's arguments. Rather, they will access the arguments of the
function that happens to eval the test code.

In this case, the reference is intended to supply '-m message' to a call of
'git commit --squash'. Remove it because -m is optional and the test case
does not check for it. There are tests in t7500 that check combinations of
--squash and -m.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-11 11:11:14 -07:00
Junio C Hamano 0af53e188a Merge branch 'cb/partial-commit-relative-pathspec'
* cb/partial-commit-relative-pathspec:
  commit: allow partial commits with relative paths
2011-08-11 11:04:28 -07:00
Junio C Hamano b81b758d50 Merge branch 'jk/fast-export-quote-path'
* jk/fast-export-quote-path:
  fast-export: quote paths in output
2011-08-11 11:03:16 -07:00
Junio C Hamano 0e9b12f874 Merge branch 'rc/maint-http-wrong-free'
* rc/maint-http-wrong-free:
  Makefile: some changes for http-related flag documentation
  http.c: fix an invalid free()

Conflicts:
	Makefile
2011-08-11 11:03:13 -07:00
Junio C Hamano 5fb249aec7 Merge branch 'rs/grep-function-context'
* rs/grep-function-context:
  grep: long context options
  grep: add option to show whole function as context
2011-08-11 11:03:09 -07:00
Junio C Hamano 1c1b7eed5c Merge branch 'ef/ipv4-connect-error-report'
* ef/ipv4-connect-error-report:
  connect: only log if all attempts failed (ipv4)
2011-08-11 11:03:06 -07:00
maximilian attems 2ae7345ab2 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>
2011-08-09 12:05:24 -07:00
Jon Seymour 24c512803d 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>
2011-08-09 10:26:18 -07:00
Junio C Hamano 051e4005a3 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>
2011-08-08 15:33:28 -07:00
Tay Ray Chuan 6486a84cb8 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>
2011-08-08 13:00:17 -07:00
Tay Ray Chuan 43ca7530df 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>
2011-08-08 13:00:17 -07:00
Tay Ray Chuan 19f7a9c577 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>
2011-08-08 13:00:17 -07:00
Junio C Hamano 1421fd9df4 Merge branch 'oa/pull-reflog'
* oa/pull-reflog:
  pull: remove extra space from reflog message

Conflicts:
	git-pull.sh
2011-08-08 12:33:36 -07:00
Junio C Hamano 68590435c1 Merge branch 'ms/reflog-show-is-default'
* ms/reflog-show-is-default:
  reflog: actually default to subcommand 'show'
2011-08-08 12:33:35 -07:00
Junio C Hamano 460940f997 Merge branch 'jl/submodule-status-summary-doc'
* jl/submodule-status-summary-doc:
  Documentation/submodule: add command references and update options
2011-08-08 12:33:35 -07:00
Junio C Hamano 2728139a62 Merge branch 'jn/gitweb-config-list-case'
* jn/gitweb-config-list-case:
  gitweb: Git config keys are case insensitive, make config search too
2011-08-08 12:33:35 -07:00
Junio C Hamano 86c9cd8d25 Merge branch 'jl/submodule-update-quiet'
* jl/submodule-update-quiet:
  submodule: update and add must honor --quiet flag
2011-08-08 12:33:34 -07:00
Junio C Hamano e85a43bc44 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.
2011-08-08 12:33:34 -07:00
Junio C Hamano 86bd7f9989 Merge branch 'jn/gitweb-system-config'
* jn/gitweb-system-config:
  gitweb: Introduce common system-wide settings for convenience
2011-08-08 12:33:34 -07:00
Junio C Hamano 75745bc704 Merge branch 'jk/reset-reflog-message-fix'
* jk/reset-reflog-message-fix:
  reset: give better reflog messages
2011-08-08 12:33:33 -07:00
Junio C Hamano 54945edbbf 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()
2011-08-08 12:33:33 -07:00
Junio C Hamano 0d086b8e33 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>
2011-08-08 12:31:01 -07:00
Junio C Hamano fca64c80fb Merge branch 'maint'
* maint:
  filter-branch: Export variable `workdir' for --commit-filter
  Documentation/Makefile: add *.pdf to `clean' target
  Documentation: ignore *.pdf files
2011-08-08 12:24:16 -07:00
Michael Witten 0906f6e14e 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>
2011-08-08 12:09:38 -07:00
Jon Seymour 6ff875c52a 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>
2011-08-08 12:05:27 -07:00
Jon Seymour 6fdd50e95c stash: take advantage of eval_gettextln
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-08 12:05:22 -07:00
Jon Seymour c2b1a95c46 pull: take advantage of eval_gettextln
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-08 12:04:42 -07:00
Jon Seymour de88c1ceda 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>
2011-08-08 12:04:21 -07:00
Jon Seymour 3da5c54340 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>
2011-08-08 12:02:16 -07:00
Jonathan Nieder a7c58f280a 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>
2011-08-08 11:28:42 -07:00
Jonathan Nieder aa0bcf962a 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>
2011-08-08 11:26:40 -07:00
Emilio G. Cota ae8044a2f5 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>
2011-08-08 09:30:14 -07:00
Emilio G. Cota 070648e9b7 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>
2011-08-08 09:30:12 -07:00
Jeff King 6280dfdc3b 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>
2011-08-05 15:56:54 -07:00
Junio C Hamano 9dcca58db4 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>
2011-08-05 15:06:21 -07:00
Jon Seymour 285c6cbf3c 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>
2011-08-05 15:04:48 -07:00
Junio C Hamano e7a85be3cf Merge branch 'tc/minix'
* tc/minix:
  Makefile: add Minix configuration options.
2011-08-05 14:55:00 -07:00
Junio C Hamano 96790ca029 Merge branch 'jc/pack-order-tweak'
* jc/pack-order-tweak:
  pack-objects: optimize "recency order"
  core: log offset pack data accesses happened
2011-08-05 14:54:57 -07:00
Junio C Hamano 43b8ff4b14 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>
2011-08-05 10:13:21 -07:00
Jon Seymour eef12a9a77 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>
2011-08-05 10:04:44 -07:00
Jon Seymour 6021be866f 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>
2011-08-05 10:01:30 -07:00
Michael Haggerty 9e8137238d 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>
2011-08-04 15:57:18 -07:00
Michael Haggerty 87a246e1b5 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>
2011-08-04 15:57:18 -07:00
Michael Haggerty f5114a40c0 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>
2011-08-04 15:57:18 -07:00
Michael Haggerty 0216af8356 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>
2011-08-04 15:57:18 -07:00
Michael Haggerty d4d4f8df14 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>
2011-08-04 15:57:17 -07:00
Michael Haggerty fa92f3233c 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>
2011-08-04 15:57:17 -07:00
Michael Haggerty d932f4eb9f 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>
2011-08-04 15:53:21 -07:00
Michael Haggerty ca64d061e0 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>
2011-08-04 15:53:20 -07:00