Commit graph

3889 commits

Author SHA1 Message Date
Erick Mattos b209995775 t3200: test -l with core.logAllRefUpdates options
By default reflogs are always created for new local branches by
"checkout -b".  But by setting core.logAllRefUpdates to false this will
not be true anymore.

In that case you only create the reflogs when you use -l switch with
"checkout -b".

Added missing tests to check expected behaviors.

Signed-off-by: Erick Mattos <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-03 14:46:19 -07:00
Erick Mattos 3631bf77f7 checkout --orphan: respect -l option always
Added changes to satisfy a corner case: creating reflogs by using -l
when core.logAllRefUpdates is set to false.

Signed-off-by: Erick Mattos <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-03 14:46:14 -07:00
Junio C Hamano 82c531b3b6 Merge branch 'by/log-follow'
* by/log-follow:
  tests: rename duplicate t4205
  Make git log --follow find copies among unmodified files.
  Make diffcore_std only can run once before a diff_flush
  Add a macro DIFF_QUEUE_CLEAR.
2010-05-21 04:02:23 -07:00
Junio C Hamano 82e7ee7351 Merge branch 'mg/advice-statushints'
* mg/advice-statushints:
  wt-status: take advice.statusHints seriously
  t7508: test advice.statusHints

Conflicts:
	wt-status.c
2010-05-21 04:02:23 -07:00
Junio C Hamano b7ef48d5d5 Merge branch 'cb/maint-stash-orphaned-file'
* cb/maint-stash-orphaned-file:
  stash tests: stash can lose data in a file removed from the index
  stash: Don't overwrite files that have gone from the index
2010-05-21 04:02:23 -07:00
Junio C Hamano dfe0171c4e Merge branch 'jn/maint-bundle'
* jn/maint-bundle:
  fix "bundle --stdin" segfault
  t5704 (bundle): add tests for bundle --stdin
2010-05-21 04:02:22 -07:00
Junio C Hamano 4d54494816 Merge branch 'pb/patch-id-plus'
* pb/patch-id-plus:
  patch-id: Add support for mbox format
  patch-id: extract parsing one diff out of generate_id_list
2010-05-21 04:02:22 -07:00
Junio C Hamano 42779124a2 Merge branch 'st/remote-tags-no-tags'
* st/remote-tags-no-tags:
  remote add: add a --[no-]tags option
  Honor "tagopt = --tags" configuration option
2010-05-21 04:02:22 -07:00
Junio C Hamano 4cbf42e151 Merge branch 'jn/fsck-ident'
* jn/fsck-ident:
  fsck: check ident lines in commit objects
2010-05-21 04:02:21 -07:00
Junio C Hamano 921296d3da Merge branch 'jn/gitweb-caching-prep'
* jn/gitweb-caching-prep:
  gitweb: Move generating page title to separate subroutine
  gitweb: Add custom error handler using die_error
  gitweb: Use nonlocal jump instead of 'exit' in die_error
  gitweb: href(..., -path_info => 0|1)
  Export more test-related variables when running external tests
2010-05-21 04:02:21 -07:00
Junio C Hamano 3b65270dcc Merge branch 'jn/request-pull'
* jn/request-pull:
  tests: chmod +x t5150
  adapt request-pull tests for new pull request format
  t5150: protect backslash with backslash in shell
  request-pull: protect against OPTIONS_KEEPDASHDASH from environment
  tests for request-pull
2010-05-21 04:02:20 -07:00
Junio C Hamano 8e3bc1456e Merge branch 'jn/shortlog'
* jn/shortlog:
  pretty: Respect --abbrev option
  shortlog: Document and test --format option
  t4201 (shortlog): Test output format with multiple authors
  t4201 (shortlog): guard setup with test_expect_success
  Documentation/shortlog: scripted users should not rely on implicit HEAD
2010-05-21 04:02:20 -07:00
Junio C Hamano f9a518e884 Merge branch 'jn/t7006-fixup'
* jn/t7006-fixup:
  t7006: guard cleanup with test_expect_success
2010-05-21 04:02:20 -07:00
Junio C Hamano 9215f76fb6 Merge branch 'js/maint-receive-pack-symref-alias'
* js/maint-receive-pack-symref-alias:
  t5516-fetch-push.sh: style cleanup
  receive-pack: detect aliased updates which can occur with symrefs
  receive-pack: switch global variable 'commands' to a parameter

Conflicts:
	t/t5516-fetch-push.sh
2010-05-21 04:02:19 -07:00
Junio C Hamano 035bf8d7c4 Merge branch 'sp/maint-dumb-http-pack-reidx'
* sp/maint-dumb-http-pack-reidx:
  http.c::new_http_pack_request: do away with the temp variable filename
  http-fetch: Use temporary files for pack-*.idx until verified
  http-fetch: Use index-pack rather than verify-pack to check packs
  Allow parse_pack_index on temporary files
  Extract verify_pack_index for reuse from verify_pack
  Introduce close_pack_index to permit replacement
  http.c: Remove unnecessary strdup of sha1_to_hex result
  http.c: Don't store destination name in request structures
  http.c: Drop useless != NULL test in finish_http_pack_request
  http.c: Tiny refactoring of finish_http_pack_request
  t5550-http-fetch: Use subshell for repository operations
  http.c: Remove bad free of static block
2010-05-21 04:02:19 -07:00
Junio C Hamano 465ef577b5 Merge branch 'jn/submodule-basic-test'
* jn/submodule-basic-test:
  t7400: clarify submodule update tests
  t7400: clarify 'submodule add' tests
  t7400: split setup into multiple tests
2010-05-21 04:02:19 -07:00
Junio C Hamano a660534e06 Merge branch 'jc/maint-no-reflog-expire-unreach-for-head'
* jc/maint-no-reflog-expire-unreach-for-head:
  reflog --expire-unreachable: special case entries in "HEAD" reflog
  more war on "sleep" in tests
  Document gc.<pattern>.reflogexpire variables

Conflicts:
	Documentation/config.txt
2010-05-21 04:02:18 -07:00
Junio C Hamano 1bdd46cd3a Merge branch 'tr/word-diff'
* tr/word-diff:
  diff: add --word-diff option that generalizes --color-words

Conflicts:
	diff.c
2010-05-21 04:02:17 -07:00
Junio C Hamano e22d62d915 Merge branch 'sp/maint-describe-tiebreak-with-tagger-date'
* sp/maint-describe-tiebreak-with-tagger-date:
  describe: Break annotated tag ties by tagger date
  tag.c: Parse tagger date (if present)
  tag.c: Refactor parse_tag_buffer to be saner to program
  tag.h: Remove unused signature field
  tag.c: Correct indentation
2010-05-21 04:02:17 -07:00
Junio C Hamano af655431f5 Merge branch 'sr/remote-helper-export'
* sr/remote-helper-export:
  t5800: testgit helper requires Python support
  Makefile: Simplify handling of python scripts
  remote-helpers: add tests for testgit helper
  remote-helpers: add testgit helper
  remote-helpers: add support for an export command
  remote-helpers: allow requesing the path to the .git directory
  fast-import: always create marks_file directories
  clone: also configure url for bare clones
  clone: pass the remote name to remote_get

Conflicts:
	Makefile
2010-05-21 04:02:15 -07:00
Junio C Hamano 7f3ed824a4 Merge branch 'ar/config-from-command-line'
* ar/config-from-command-line:
  Complete prototype of git_config_from_parameters()
  Use strbufs instead of open-coded string manipulation
  Allow passing of configuration parameters in the command line
2010-05-21 04:02:14 -07:00
Junio C Hamano e2ab0227aa Merge branch 'em/checkout-orphan'
* em/checkout-orphan:
  git checkout: create unparented branch by --orphan
2010-05-21 04:02:14 -07:00
Junio C Hamano 1be270cbdf Merge branch 'maint'
* maint:
  Fix checkout of large files to network shares on Windows XP
  start_command: close cmd->err descriptor when fork/spawn fails
  Fix "Out of memory? mmap failed" for files larger than 4GB on Windows
2010-05-21 03:13:07 -07:00
René Scharfe c8b296450e Fix checkout of large files to network shares on Windows XP
Bigger writes to network drives on Windows XP fail.  Cap them at 31MB to
allow them to succeed.  Callers need to be prepared for write() calls
that do less work than requested anyway.

On local drives, write() calls are translated to WriteFile() calls with
a cap of 64KB on Windows XP and 256KB on Vista.  Thus a cap of 31MB won't
affect the number of WriteFile() calls which do the actual work.  There's
still room for some other version of Windows to use a chunk size of 1MB
without increasing the number of system calls.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-20 16:12:13 -07:00
bert Dvornik fc012c2810 start_command: close cmd->err descriptor when fork/spawn fails
Fix the problem where the cmd->err passed into start_command wasn't
being properly closed when certain types of errors occurr.  (Compare
the affected code with the clean shutdown code later in the function.)

On Windows, this problem would be triggered if mingw_spawnvpe()
failed, which would happen if the command to be executed was malformed
(e.g. a text file that didn't start with a #! line).  If cmd->err was
a pipe, the failure to close it could result in a hang while the other
side was waiting (forever) for either input or pipe close, e.g. while
trying to shove the output into the side band.  On msysGit, this
problem was causing a hang in t5516-fetch-push.

[J6t: With a slight adjustment of the test case, the hang is also
observed on Linux.]

Signed-off-by: bert Dvornik <dvornik+git@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-20 16:11:29 -07:00
Michael J Gruber 67687feae5 for-each-ref: Field with abbreviated objectname
Introduce a :short modifier to objectname which outputs the abbreviated
object name.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-18 21:49:04 -07:00
Junio C Hamano d92f844610 Merge branch 'maint'
* maint:
  handle "git --bare init <dir>" properly
2010-05-10 18:34:03 -07:00
Jeff King bf4d382615 tests: chmod +x t5150
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-10 11:52:16 -07:00
Jeff King 9feeaa2bf3 tests: rename duplicate t4205
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-10 11:52:03 -07:00
Jeff King 87a074df24 handle "git --bare init <dir>" properly
If we know we are creating a bare repository, we use setenv
to set the GIT_DIR directory to the current directory
(either where we already were, or one we created and chdir'd
into with "git init --bare <dir>").

However, with "git --bare init <dir>" (note the --bare as a
git wrapper option), the setup code actually sets GIT_DIR
for us, but it uses the wrong, original cwd when a directory
is given. Because our setenv does not use the overwrite
flag, it is ignored.

We need to set the overwrite flag, but only when we are
given a directory on the command line. That still allows:

  GIT_DIR=foo.git git init --bare

to work. The behavior is changed for:

  GIT_DIR=foo.git git init --bare bar.git

which used to create the repository in foo.git, but now will
use bar.git. This is more sane, as command line options
should generally override the environment.

Noticed by Oliver Hoffmann.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-10 11:25:37 -07:00
Torsten Schmutzler 73d419558d git-svn: mangle refnames forbidden in git
git-check-ref-format(1) describes names which
cannot be used as refnames for git.  Some are
legal branchnames in subversion however.
Mangle the not yet handled cases.

Signed-off-by: Torsten Schmutzler <git-ts@theblacksun.eu>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-05-09 01:25:19 -07:00
Junio C Hamano b7511571e3 Merge branch 'bg/apply-blank-trailing-context'
* bg/apply-blank-trailing-context:
  apply: Allow blank *trailing* context lines to match beyond EOF
2010-05-08 22:37:41 -07:00
Junio C Hamano 909376a1c9 Merge branch 'rc/ls-remote-default'
* rc/ls-remote-default:
  ls-remote: fall-back to default remotes when no remote specified
2010-05-08 22:37:28 -07:00
Junio C Hamano 3cc9caadf7 Merge branch 'rc/maint-curl-helper'
* rc/maint-curl-helper:
  remote-curl: ensure that URLs have a trailing slash
  http: make end_url_with_slash() public
  t5541-http-push: add test for URLs with trailing slash

Conflicts:
	remote-curl.c
2010-05-08 22:37:24 -07:00
Junio C Hamano b7d0da858b Merge branch 'hg/maint-attr-fix'
* hg/maint-attr-fix:
  attr: Expand macros immediately when encountered.
  attr: Allow multiple changes to an attribute on the same line.
  attr: Fixed debug output for macro expansion.
2010-05-08 22:37:05 -07:00
Junio C Hamano 67e5c87cd6 Merge branch 'eb/unpretty-b-format'
* eb/unpretty-b-format:
  Add `%B' in format strings for raw commit body in `git log' and friends
2010-05-08 22:36:40 -07:00
Junio C Hamano ea28baed79 Merge branch 'ab/commit-empty-message'
* ab/commit-empty-message:
  Add option to git-commit to allow empty log messages
2010-05-08 22:36:31 -07:00
Junio C Hamano 301c4f9709 Merge branch 'jc/test-sleepless'
* jc/test-sleepless:
  war on "sleep" in tests
2010-05-08 22:36:23 -07:00
Junio C Hamano 72d9b222a9 Merge branch 'sd/log-decorate'
* sd/log-decorate:
  log.decorate: only ignore it under "log --pretty=raw"
  script with rev-list instead of log
  log --pretty/--oneline: ignore log.decorate
  log.decorate: usability fixes
  Add `log.decorate' configuration variable.
  git_config_maybe_bool()

Conflicts:
	builtin/log.c
2010-05-08 22:36:14 -07:00
Junio C Hamano e251a7b34a Merge branch 'mh/status-optionally-refresh'
* mh/status-optionally-refresh:
  t7508: add a test for "git status" in a read-only repository
  git status: refresh the index if possible
  t7508: add test for "git status" refreshing the index
2010-05-08 22:35:39 -07:00
Junio C Hamano c58c5129d6 Merge branch 'cw/ws-indent-with-tab'
* cw/ws-indent-with-tab:
  whitespace: tests for git-apply --whitespace=fix with tab-in-indent
  whitespace: add tab-in-indent support for --whitespace=fix
  whitespace: replumb ws_fix_copy to take a strbuf *dst instead of char *dst
  whitespace: tests for git-diff --check with tab-in-indent error class
  whitespace: add tab-in-indent error class
  whitespace: we cannot "catch all errors known to git" anymore
2010-05-08 22:35:35 -07:00
Junio C Hamano dd75d07899 Merge branch 'jk/cached-textconv'
* jk/cached-textconv:
  diff: avoid useless filespec population
  diff: cache textconv output
  textconv: refactor calls to run_textconv
  introduce notes-cache interface
  make commit_tree a library function
2010-05-08 22:33:08 -07:00
Junio C Hamano 3ecaa3b6a5 Merge branch 'pc/remove-warn'
* pc/remove-warn:
  Remove a redundant errno test in a usage of remove_path
  Introduce remove_or_warn function
  Implement the rmdir_or_warn function
  Generalise the unlink_or_warn function
2010-05-08 22:32:59 -07:00
Jonathan Nieder f2cabf6abf adapt request-pull tests for new pull request format
10eb0007 (request-pull: avoid mentioning that the start point is a
single commit, 2010-01-29), changed the pull request format, so the
test needs some changes to still pass:

 - tolerate a missing blank line between “in the git repository at:”
   and the name of repository and branch

 - recognize subject and date in the new request format

 - update the expected request template to match the new format

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-07 21:33:19 -07:00
Junio C Hamano ea0edad58f Merge branch 'jn/maint-request-pull' into jn/request-pull 2010-05-07 21:33:08 -07:00
Junio C Hamano 5bab69172f t5150: protect backslash with backslash in shell
At least /bin/sh on FreeBSD 8 interprets backslash followed by newline in an
unquoted here text as "empty".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-07 21:30:29 -07:00
Bo Yang 0cdca133ec Make git log --follow find copies among unmodified files.
'git log --follow <path>' don't track copies from unmodified
files, and this patch fix it.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-07 09:34:29 -07:00
Michael J Gruber 980bde3894 wt-status: take advice.statusHints seriously
Currently, status gives a lot of hints even when advice.statusHints is
false. Change this so that all hints depend on the config variable.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-06 13:22:44 -07:00
Michael J Gruber 18f3b5a9d3 t7508: test advice.statusHints
edf563f (status: make "how to stage" messages optional, 2009-09-09)
introduced advice.statusHints without tests. Add a few tests to describe
and test the status quo.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-06 13:22:37 -07:00
Jonathan Nieder b6b0afdc30 test-lib: some shells do not let $? propagate into an eval
In 3bf7886 (test-lib: Let tests specify commands to be run at end of
test, 2010-05-02), the git test harness learned to run cleanup
commands unconditionally at the end of a test.  During each test,
the intended cleanup actions are collected in the test_cleanup variable
and evaluated.  That variable looks something like this:

	eval_ret=$?; clean_something && (exit "$eval_ret")
	eval_ret=$?; clean_something_else && (exit "$eval_ret")
	eval_ret=$?; final_cleanup && (exit "$eval_ret")
	eval_ret=$?

All cleanup actions are run unconditionally but if one of them fails
it is properly reported through $eval_ret.

On FreeBSD, unfortunately, $? is set at the beginning of an ‘eval’
to 0 instead of the exit status of the previous command.  This results
in tests using test_expect_code appearing to fail and all others
appearing to pass, unless their cleanup fails.  Avoid the problem by
setting eval_ret before the ‘eval’ begins.

Thanks to Jeff King for the explanation.

Cc: Jeff King <peff@peff.net>
Cc: Johannes Sixt <j6t@kdbg.org>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-06 13:16:14 -07:00