Commit graph

4149 commits

Author SHA1 Message Date
Junio C Hamano 0d0ba03a18 Merge branch 'maint'
* maint:
  gitweb: clarify search results page when no matching commit found
  Documentation: add a FILES section for show-ref
  Makefile: add missing dependency on http.h
  Makefile: add missing dependencies on url.h
  Documentation/git-log: Clarify --full-diff
  git-rebase: fix typo when parsing --force-rebase
  imap-send: Fix sprintf usage
  prune: allow --dry-run for -n and --verbose for -v
  notes: allow --dry-run for -n and --verbose for -v
  Document -B<n>[/<m>], -M<n> and -C<n> variants of -B, -M and -C
  Documentation: cite git-am from git-apply
  t7003: fix subdirectory-filter test
  Allow "check-ref-format --branch" from subdirectory
  check-ref-format: handle subcommands in separate functions
  pretty-options.txt: match --format's documentation with implementation.
2010-08-09 13:05:47 -07:00
Thomas Rast 3c8710aeaa t7003: fix subdirectory-filter test
The test would not fail if the filtering failed to do anything, since
in

  test -z "$(git diff HEAD directorymoved:newsubdir)"'

'directorymoved:newsubdir' is not valid, so git-diff fails without
printing anything on stdout.  But then the exit status of git-diff is
lost, whereas test -z "" succeeds.

Use 'git diff --exit-code' instead, which does the right thing and has
the added bonus of showing the differences if there are any.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09 09:15:01 -07:00
Jonathan Nieder 49cc460d88 Allow "check-ref-format --branch" from subdirectory
check-ref-format --branch requires access to the repository
to resolve refs like @{-1}.

Noticed by Nguyễn Thái Ngọc Duy.

Cc: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-06 10:01:45 -07:00
Junio C Hamano 608169da5b Merge branch 'gp/pack-refs-remove-empty-dirs'
* gp/pack-refs-remove-empty-dirs:
  pack-refs: remove newly empty directories
2010-08-03 15:19:02 -07:00
Junio C Hamano e7bdd1b90b Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
  git svn: fix dcommit to work with touched files
  git svn: add an option to recode pathnames
2010-08-02 15:38:55 -07:00
Elijah Newren 9f9aa76130 upload-pack: Improve error message when bad ref requested
When printing an error message saying a ref was requested that we do not
have, only print that ref, rather than the ref and everything sent to us
on the same packet line (e.g. protocol support specifications).

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-02 15:31:59 -07:00
David D. Kilzer 181264ad59 git svn: fix dcommit to work with touched files
The dcommit command fails if an otherwise unmodified file has
been touched in the working directory:

    Cannot dcommit with a dirty index.  Commit your changes
    first, or stash them with `git stash'.

This happens because "git diff-index" reports a difference
between the index and the filesystem:

    :100644 100644 d00491...... 000000...... M      file

The fix is to run "git update-index --refresh" before
"git diff-index" as is done in git-rebase and
git-rebase--interactive before "git diff-files".

This changes dcommit to display a list of modified files before
exiting.

Also add a similar test case for "git svn rebase".

[ew: rearranged commit message subject]

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-08-02 21:21:56 +00:00
Junio C Hamano 9d52f15af7 Merge branch 'maint'
* maint:
  test-lib: Remove 3 year old no-op --no-python option
  test-lib: Ignore --quiet under a TAP harness
  Documentation/rev-parse: quoting is required with --parseopt
  Documentation: reporting bugs
  Fix git rebase --continue to work with touched files
  Document ls-files -t as semi-obsolete.
2010-08-02 12:02:16 -07:00
Junio C Hamano 7d808125a0 Merge branch 'ab/tap' into maint
* ab/tap:
  test-lib: Remove 3 year old no-op --no-python option
  test-lib: Ignore --quiet under a TAP harness
2010-08-02 11:53:58 -07:00
Ævar Arnfjörð Bjarmason d596f33abb test-lib: Remove 3 year old no-op --no-python option
The --no-python option was added to test-lib.sh by Johannes Schindelin
in early 2006 in abb7c7b3. It was later turned into a no-op by Junio C
Hamano in 7cdbff14 the same year.

Over three years is long enough before removing this old wart which
was retained for backwards compatibility. Our tests have been using
NO_PYTHON and "test_have_prereq PYTHON" for a long time now.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-02 11:53:52 -07:00
Ævar Arnfjörð Bjarmason 092c433407 test-lib: Ignore --quiet under a TAP harness
Running the tests with --quiet under a TAP harness will always fail,
since a TAP harness always needs actual test output to go along with
the plan that's being emitted.

Change the test-lib.sh to ignore the --quiet option under
HARNESS_ACTIVE to work around this. Then users that have --quiet in
their GIT_TEST_OPTS can run tests under prove(1) without everything
breaking.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-02 11:53:48 -07:00
David D. Kilzer 25e9325040 Fix git rebase --continue to work with touched files
When performing a non-interactive rebase, sometimes
"git rebase --continue" will fail if an unmodified file is
touched in the working directory:

    You must edit all merge conflicts and then
    mark them as resolved using git add

This is caused by "git diff-files" reporting a difference
between the index and the filesystem:

    :100644 100644 d00491...... 000000...... M	file

The fix is to run "git update-index --refresh" before
"git diff-files" as is done in git-rebase--interactive.

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-28 13:57:36 -07:00
Junio C Hamano ba9523ea80 Sync with 1.7.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-27 16:55:05 -07:00
Junio C Hamano 33a0292e61 Sync with 1.7.1.2 2010-07-27 16:40:23 -07:00
Junio C Hamano e5498e8a9f Sync with 1.7.0 series 2010-07-27 15:01:36 -07:00
Jonathan Nieder 79bf149061 config --get --path: check for unset $HOME
If $HOME is unset (as in some automated build situations),
currently

	git config --path path.home "~"
	git config --path --get path.home

segfaults.  Error out with

	Failed to expand user dir in: '~/'

instead.

Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-27 10:58:46 -07:00
Ævar Arnfjörð Bjarmason 9a3028b987 tests: Ignore the Test::Harness .prove file
We document how to run prove with the --state option in t/README. This
produces a .prove YAML file in the current directory. Change the t/
gitignore to ignore it, and clean it up on `make clean'.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-25 23:14:48 -07:00
Johannes Sixt c1e02b2b38 t3700-add: fix dependence on stdout and stderr buffering
One test case checked the stdout and stderr of 'git add' by constructing a
single 'expect' file that contained both streams. But when the command
runs, the order of stdout and stderr output is unpredictable because it
depends on how the streams are buffered. At least on Windows, the buffering
is different from what the test case expected. Hence, check the two output
texts separately.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-25 23:14:18 -07:00
Brandon Casey 938791cd01 git-rebase--interactive.sh: use printf instead of echo to print commit message
On systems with an echo which defaults to the XSI-conformant behavior
(Solaris, or others using Ksh), echo will interpret certain backslashed
characters as control sequences.  This can cause a problem for interactive
rebase when it is used to rebase commits whose commit "subject" (the first
line) contains any of these backslashed sequences.  In this case, echo will
substitute the control sequence for the backslashed characters and either
the rebased commit message will differ from the original, or the rebase
process will fail.  Neither is desirable.

So work around this issue by replacing the echo statements used to print
out portions of the commit message, with printf.

Also, add a test to test for this breakage.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-25 23:14:18 -07:00
Junio C Hamano 28bf4ba014 Merge branch 'maint-1.6.6' into maint-1.7.0
* maint-1.6.6:
  request-pull.txt: Document -p option
  Check size of path buffer before writing into it
  rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
2010-07-25 21:52:48 -07:00
Junio C Hamano ad33605406 Merge branch 'maint-1.6.5' into maint-1.6.6
* maint-1.6.5:
  request-pull.txt: Document -p option
  Check size of path buffer before writing into it
  rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
2010-07-25 21:52:29 -07:00
Junio C Hamano a07b10c8f9 Merge branch 'maint-1.6.4' into maint-1.6.5
* maint-1.6.4:
  Check size of path buffer before writing into it
  rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
2010-07-25 21:51:58 -07:00
Junio C Hamano 6e6842e36f tests: correct "does reflog exist?" tests
These two tests weren't about how "git reflog show <branch>" exits when
there is no reflog, but were about "checkout" and "branch" create or not
create reflog when creating a new <branch>.  Update the tests to check
what we are interested in, using "git rev-parse --verify".

Also lose tests based on "test -f .git/logs/refs/heads/<branch>" from
nearby, to avoid exposing this particular implementation detail
unnecessarily.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-21 12:54:48 -07:00
Brandon Casey b1edaf669d t/: work around one-shot variable assignment with test_must_fail
See e200783255

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-21 11:54:34 -07:00
Jonathan Nieder bdcaa325b4 t/README: correct an exception when breaking a && chain in tests
The correct advice should have been taken from c289c31 (t/t7006: ignore
return status of shell's unset builtin, 2010-06-02).  A real-life issue
we experienced was with "unset", not with "export" (exporting an
unset variable may have similar portability issues, though).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-21 11:52:26 -07:00
Brandon Casey 77b5be2aba t/{t5541,lib-httpd}: replace problematic '!()' notation with test_must_fail
The '!()' notation is interpreted as a pattern-list on Ksh.  The Ksh man
page describe it as follows:

   !(pattern-list)
      Matches anything except one of the given patterns.

Ksh performs a file glob using the pattern-list and then tries to execute
the first file in the list.  If a space is added between the '!' and the
open parens, then Ksh will not interpret it as a pattern list, but in this
case, it is preferred to use test_must_fail, so lets do so.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-20 11:37:45 -07:00
Brandon Casey 460d562eab t/t3700: convert two uses of negation operator '!' to use test_must_fail
These two lines use the negation '!' operator to negate the result of a
simple command.  Since these commands do not contain any pipes or other
complexities, the test_must_fail function can be used and is preferred
since it will additionally detect termination due to a signal.

This was noticed because the second use of '!' does not include a space
between the '!' and the opening parens.  Ksh interprets this as follows:

   !(pattern-list)
      Matches anything except one of the given patterns.

Ksh performs a file glob using the pattern-list and then tries to execute
the first file in the list.  If a space is added between the '!' and the
open parens, then Ksh will not interpret it as a pattern list, but in this
case, it is preferred to use test_must_fail, so lets do so.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-20 11:37:26 -07:00
Junio C Hamano 5f7baac1e3 Merge branch 'maint'
* maint:
  t/README: clarify test_must_fail description
  Check size of path buffer before writing into it

Conflicts:
	t/README
2010-07-20 11:29:30 -07:00
Brandon Casey 971ecbd1f8 t/README: clarify test_must_fail description
Some have found the wording of the description to be somewhat ambiguous
with respect to when it is desirable to use test_must_fail instead of
"! <git-command>".  Tweak the wording somewhat to hopefully clarify that
it is _because_ test_must_fail can detect segmentation fault that it is
desirable to use it instead of "! <git-command>".

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-20 11:26:39 -07:00
Jens Lehmann d27b876b28 git submodule add: Require the new --force option to add ignored paths
To make the behavior of "git submodule add" more consistent with "git add"
ignored submodule paths should not be silently added when they match an
entry in a .gitignore file. To be able to override that default behavior
in the same way as we can do that for "git add", the new option "--force"
is introduced.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-19 11:10:43 -07:00
Junio C Hamano 8fbe9b32ce Merge branch 'jl/add-n-ignore-missing'
* jl/add-n-ignore-missing:
  git add: Add the "--ignore-missing" option for the dry run
2010-07-19 11:09:38 -07:00
Thomas Rast 7ea3ddf818 Only run aggregate-results over actual counts
The current make target 'aggregate-results' scanned all files matching
test-results/t*-*.  Normally these are only the test counts (and the
exit values, which are ignored), but with --tee the suite also dumps
all output.  Furthermore, with --verbose t1450 contains several lines
starting with "broken link from ..." which matches the criteria used
by aggregate-results.sh.

Rename the counts output files to *.counts, and only scan those.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-16 13:25:01 -07:00
Junio C Hamano 53b304224a Merge branch 'jn/paginate-fix'
* jn/paginate-fix:
  git --paginate: paginate external commands again
  git --paginate: do not commit pager choice too early
  tests: local config file should be honored from subdirs of toplevel
  t7006: test pager configuration for several git commands
  t7006 (pager): introduce helper for parameterized tests

Conflicts:
	t/t7006-pager.sh
2010-07-15 12:09:14 -07:00
Junio C Hamano ea56a7ed97 Merge branch 'wp/merge-tree-fix'
* wp/merge-tree-fix:
  merge-tree: fix where two branches share no changes
  add basic tests for merge-tree
2010-07-15 12:08:41 -07:00
Junio C Hamano 4bd874c8f3 Merge branch 'js/merge-rr-fix'
* js/merge-rr-fix:
  MERGE_RR is in .git, not .git/rr-cache
2010-07-15 12:08:36 -07:00
Junio C Hamano c257bbb559 Merge branch 'jn/tests'
* jn/tests:
  t3000 (ls-files -o): modernize style
2010-07-15 12:08:04 -07:00
Junio C Hamano a7d7853463 Merge branch 'jn/grep-open'
* jn/grep-open:
  grep -O: Do not pass color sequences as filenames to pager
2010-07-15 12:07:18 -07:00
Junio C Hamano 754e66b7a0 Merge branch 'jc/rebase-i-commit-msg-fix'
* jc/rebase-i-commit-msg-fix:
  rebase-i: do not get fooled by a log message ending with backslash
  rebase-i: style fix
2010-07-15 12:06:48 -07:00
Junio C Hamano 849865733f Merge branch 'ab/submodule-add-f'
* ab/submodule-add-f:
  git submodule: add submodules with git add -f <path>
2010-07-15 12:06:25 -07:00
Jonathan Nieder 030149a4dc git --paginate: paginate external commands again
73e25e7c (git --paginate: do not commit pager choice too early,
2010-06-26) failed to take some cases into account.

1b. Builtins that do not use RUN_SETUP (like git config) do
    not find GIT_DIR set correctly when the pager is launched
    from run_builtin().  So the core.pager configuration is
    not honored from subdirectories of the toplevel for them.

4a. External git commands (like git request-pull) relied on the
    early pager launch to take care of handling the -p option.
    Ever since 73e25e7c, they do not honor the -p option at all.

4b. Commands invoked through ! aliases (like ls) were also relying
    on the early pager launch.

Fix (4a) by launching the pager (if requested) before running such a
“dashed external”.  For simplicity, this still does not search for a
.git directory before running the external command; when run from a
subdirectory of the toplevel, therefore, the “[core] pager”
configuration is still not honored.

Fix (4b) by launching pager if requested before carrying out such an
alias.  Actually doing this has no effect, since the pager (if any)
would have already been launched in a failed attempt to try a
dashed external first.  The choice-of-pager-not-honored-from-
subdirectory bug still applies here, too.

(1b) is not a regression.  There is no need to fix it yet.

Noticed by Junio.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14 16:07:34 -07:00
Jay Soffian 3ca399d40a MERGE_RR is in .git, not .git/rr-cache
0af0ac7 (Move MERGE_RR from .git/rr-cache/ into .git/) moved the
location of MERGE_RR but I found a few references to the old
location.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14 13:04:25 -07:00
Will Palmer 21baa6e0c5 merge-tree: fix where two branches share no changes
15b4f7a (merge-tree: use ll_merge() not xdl_merge(), 2010-01-16)
introduced a regression to merge-tree to cause it to segfault when merging
files which existed in one branch, but not in the other or in the
merge-base. This was caused by referencing entry->path at a time when
entry was known to be possibly-NULL.

To correct the problem, we save the path of the entry we came in with,
as the path should be the same among all the stages no matter which
sides are involved in the merge.

Signed-off-by: Will Palmer <wmpalmer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14 12:56:49 -07:00
Will Palmer f32e9852d4 add basic tests for merge-tree
merge-tree had no test cases, so here we add some very basic tests for
it, including some known-breakages.

[jc: with obvious/trivial fixups]

Signed-off-by: Will Palmer <wmpalmer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14 12:55:15 -07:00
Junio C Hamano c9a9766328 Merge branch 'jc/read-tree-cache-tree-fix'
* jc/read-tree-cache-tree-fix:
  Fix "read-tree -m A B" priming the cache-tree
2010-07-14 09:34:23 -07:00
Jens Lehmann 108da0db12 git add: Add the "--ignore-missing" option for the dry run
Sometimes it is useful to know if a file or directory will be ignored
before it is added to the work tree. An example is "git submodule add",
where it would be really nice to be able to fail with an appropriate
error message before the submodule is cloned and checked out.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-12 15:13:54 -07:00
Michael J Gruber 637ab29b86 test-lib: TAP compliance for skipping tests on request
Make the output TAP compliant for tests skipped on request (GIT_SKIP_TESTS).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-12 07:53:08 -07:00
Michael J Gruber 47e67d479b test-lib: simplify GIT_SKIP_TESTS loop
04ece59 (GIT_SKIP_TESTS: allow users to omit tests that are known to break, 2006-12-28)
introduced GIT_SKIP_TESTS, and since then we have had two nested loops
iterating over GIT_SKIP_TESTS with the same loop variable.

Reduce this to one loop.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-12 07:52:52 -07:00
Junio C Hamano 609eb9f7ff Merge branch 'maint'
* maint:
  Documentation: Spelling fix in protocol-capabilities.txt
  checkout: accord documentation to what git does
  t0005: work around strange $? in ksh when program terminated by a signal
2010-07-11 23:47:29 -07:00
Jonathan Nieder bcefed419a t3000 (ls-files -o): modernize style
This script is part of the second batch of tests, from the same day
the test infrastructure was added to git.  Update it to use a more
modern style in the spirit of v1.6.4-rc0~45^2~2 (2009-05-22).
In particular:

 - Put setup code inside test assertions, to avoid unexpected
   breakages and avoid stray output without -v (as t/README
   recommends); and

 - Put the test title on the same line as the "test_expect_success",
   and end the line with a single-quote to begin the body of the test
   which is one multi-line string.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-11 23:14:17 -07:00
Johannes Sixt 0e418e568f t0005: work around strange $? in ksh when program terminated by a signal
ksh93 is known to report $? of programs that terminated by a signal as
256 + signal number instead of 128 + signal number like other POSIX
compliant shells (ksh's behavior is still POSIX compliant in this regard).

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-09 16:27:31 -07:00