summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2010-06-28notes: check number of parameters to "git notes copy"Libravatar Jeff King1-0/+6
Otherwise we may segfault with too few parameters. Signed-off-by: Jeff King <peff@peff.net> Tested-by: Bert Wesarg <Bert.Wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-22Merge branch 'ic/maint-rebase-i-abort' into maintLibravatar Junio C Hamano1-0/+10
* ic/maint-rebase-i-abort: rebase -i: Abort cleanly if new base cannot be checked out
2010-06-22Merge branch 'cc/maint-commit-reflog-msg' into maintLibravatar Junio C Hamano1-2/+4
* cc/maint-commit-reflog-msg: commit: use value of GIT_REFLOG_ACTION env variable as reflog message
2010-06-22Merge branch 'tc/commit-abbrev-fix' into maintLibravatar Junio C Hamano1-0/+68
* tc/commit-abbrev-fix: commit::print_summary(): don't use format_commit_message() t7502-commit: add summary output tests for empty and merge commits t7502-commit: add tests for summary output
2010-06-22Merge branch 'jn/document-rebase-i-p-limitation' into maintLibravatar Junio C Hamano1-0/+6
* jn/document-rebase-i-p-limitation: rebase -i -p: document shortcomings
2010-06-22Merge branch 'cc/maint-diff-CC-binary' into maintLibravatar Junio C Hamano2-0/+82
* cc/maint-diff-CC-binary: diff: fix "git show -C -C" output when renaming a binary file Conflicts: diff.c
2010-06-22Merge branch 'jc/t9129-any-utf8' into maintLibravatar Junio C Hamano1-7/+13
* jc/t9129-any-utf8: t9129: fix UTF-8 locale detection
2010-06-22Merge branch 'cb/ls-files-cdup' into maintLibravatar Junio C Hamano1-8/+4
* cb/ls-files-cdup: ls-files: allow relative pathspec quote.c: separate quoting and relative path generation
2010-06-22Merge branch 'tc/merge-m-log' into maintLibravatar Junio C Hamano1-4/+20
* tc/merge-m-log: merge: --log appends shortlog to message if specified fmt-merge-msg: add function to append shortlog only fmt-merge-msg: refactor merge title formatting fmt-merge-msg: minor refactor of fmt_merge_msg() merge: rename variable merge: update comment t7604-merge-custom-message: show that --log doesn't append to -m t7604-merge-custom-message: shift expected output creation
2010-06-22Merge branch 'jn/maint-amend-missing-name' into maintLibravatar Junio C Hamano1-0/+46
* jn/maint-amend-missing-name: commit --amend: cope with missing display name
2010-06-22Merge branch 'pc/remove-warn' into maintLibravatar Junio C Hamano1-0/+38
* 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-06-21tests: remove unnecessary '^' from 'expr' regular expressionLibravatar Junio C Hamano2-3/+3
As Brandon noticed, a regular expression match given to 'expr' is already anchored at the beginning. Some versions of expr even complain about this. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-21Merge branch 'cb/assume-unchanged-fix' into maintLibravatar Junio C Hamano1-0/+24
* cb/assume-unchanged-fix: Documentation: git-add does not update files marked "assume unchanged" do not overwrite files marked "assume unchanged"
2010-06-21Merge branch 'jn/notes-doc' into maintLibravatar Junio C Hamano1-0/+38
* jn/notes-doc: Documentation/notes: nitpicks Documentation/notes: clean up description of rewriting configuration Documentation/notes: simplify treatment of default display refs Documentation/log: add a CONFIGURATION section Documentation/notes: simplify treatment of default notes ref Documentation/notes: add configuration section Documentation/notes: describe content of notes blobs Documentation/notes: document format of notes trees
2010-06-21Merge branch 'ab/test-cleanup' into maintLibravatar Junio C Hamano5-5/+7
* ab/test-cleanup: Turn setup code in t2007-checkout-symlink.sh into a test Move t6000lib.sh to lib-*
2010-06-21Merge branch 'bg/apply-blank-trailing-context' into maintLibravatar Junio C Hamano1-0/+12
* bg/apply-blank-trailing-context: apply: Allow blank *trailing* context lines to match beyond EOF
2010-06-16Merge branch 'cb/maint-stash-orphaned-file' into maintLibravatar Junio C Hamano1-0/+150
* 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-06-16Merge branch 'mg/advice-statushints' into maintLibravatar Junio C Hamano1-0/+45
* mg/advice-statushints: wt-status: take advice.statusHints seriously t7508: test advice.statusHints
2010-06-16Merge branch 'jn/maint-bundle' into maintLibravatar Junio C Hamano1-0/+16
* jn/maint-bundle: fix "bundle --stdin" segfault t5704 (bundle): add tests for bundle --stdin
2010-06-16Merge branch 'jn/t7006-fixup' into maintLibravatar Junio C Hamano2-48/+117
* jn/t7006-fixup: t7006: guard cleanup with test_expect_success
2010-06-16Merge branch 'jn/shortlog' into maintLibravatar Junio C Hamano2-24/+123
* 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-06-16Merge branch 'sp/maint-dumb-http-pack-reidx' into maintLibravatar Junio C Hamano1-3/+34
* 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-06-16Merge branch 'sp/maint-describe-tiebreak-with-tagger-date' into maintLibravatar Junio C Hamano1-3/+5
* 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-06-16Merge branch 'rc/maint-curl-helper' into maintLibravatar Junio C Hamano1-1/+28
* 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-06-16Merge branch 'hg/maint-attr-fix' into maintLibravatar Junio C Hamano1-0/+15
* 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-06-16Merge branch 'mh/status-optionally-refresh' into maintLibravatar Junio C Hamano1-0/+25
* 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-06-13commit: use value of GIT_REFLOG_ACTION env variable as reflog messageLibravatar Christian Couder1-2/+4
The environment variable GIT_REFLOG_ACTION was used by git-commit.sh, but when it was converted to a builtin (f5bbc3225c4b073a7ff3218164a0c820299bc9c6, Port git commit to C, Nov 8 2007) this was lost. Let's use it again as it is more user friendly when reverting or cherry-picking to see "revert" or "cherry-pick" in the reflog rather than to just see "commit". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-13commit::print_summary(): don't use format_commit_message()Libravatar Tay Ray Chuan1-2/+2
This attempts to fix a regression in git-commit, where non-abbreviated SHA-1s were printed in the summary. One possible fix would be to set ctx.abbrev to DEFAULT_ABBREV in the `if` block, where format_commit_message() is used. Instead, we do away with the format_commit_message() codeblock altogether, replacing it with a re-run of log_tree_commit(). We re-run log_tree_commit() with rev.always_show_header set, to force the invocation of show_log(). The effect of this flag can be seen from this excerpt from log-tree.c:560, the only area that rev.always_show_header is checked: shown = log_tree_diff(opt, commit, &log); if (!shown && opt->loginfo && opt->always_show_header) { log.parent = NULL; show_log(opt); shown = 1; } We also set rev.use_terminator, so that a newline is appended at the end of the log message. Note that callers in builtin/log.c that also set rev.always_show_header don't have to set rev.use_terminator, but still get a newline, because they are wrapped in a pager. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-11t/README: document --root optionLibravatar Thomas Rast1-0/+6
We've had this option since f423ef5 (tests: allow user to specify trash directory location, 2009-08-09). Make it easier to look up :-) Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-11rebase -i: Abort cleanly if new base cannot be checked outLibravatar Ian Ward Comfort1-0/+10
Untracked content in the working tree may prevent rebase -i from checking out the new base onto which it wants to replay commits, if the new base commit includes files at those (now untracked) paths. Currently, rebase -i dies uncleanly in this situation, updating ORIG_HEAD and leaving a useless .git/rebase-merge directory, with which the user can do nothing useful except rebase --abort. Make rebase -i abort the procedure itself instead, as non-interactive rebase already does, and add a test for this behavior. Signed-off-by: Ian Ward Comfort <icomfort@stanford.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-11rebase -i -p: document shortcomingsLibravatar Jonathan Nieder1-0/+6
The rebase --preserve-merges facility presents a list of commits in its instruction sheet and uses a separate table to keep track of their parents. Unfortunately, in practice this means that with -p after most attempts to rearrange patches, some commits have the "wrong" parent and the resulting history is rarely what the caller expected. Yes, it would be nice to fix that. But first, add a warning to the manual to help the uninitiated understand what is going on. Reported-by: Jiří Paleček <jpalecek@web.de> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-06diff: fix "git show -C -C" output when renaming a binary fileLibravatar Christian Couder2-0/+82
A bug was introduced in 3e97c7c6af2901cec63bf35fcd43ae3472e24af8 (No diff -b/-w output for all-whitespace changes, Nov 19 2009) that made the lines: diff --git a/bar b/sub/bar similarity index 100% rename from bar rename to sub/bar disappear from "git show -C -C" output when file bar is a binary file. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-05ls-files: allow relative pathspecLibravatar Clemens Buchacher1-8/+4
git ls-files used to error out if given paths which point outside the current working directory, such as '../'. We now allow such paths and the output is analogous to git grep -l. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-02t9129: fix UTF-8 locale detectionLibravatar Junio C Hamano1-7/+13
The UTF-8 prerequisite test checked explicitly for en_US.utf8 in the output from "locale -a", but the tests that are actually protected by the prerequisite were asking LC_ALL=en_US.UTF-8 from the system. This inconsistency leads the tests to fail on platforms that do not know both en_US.UTF-8 and en_US.utf8 (thanks you, Yann Droneaud, for bringing this up with an initial patch). Instead, pick a locale with ".UTF-8" (with or without hyphen, spelled in either upper or lowercase) in its name from "locale -a" output, and use it for running the test. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-28t7502-commit: add summary output tests for empty and merge commitsLibravatar Tay Ray Chuan1-2/+27
After c197702 (pretty: Respect --abbrev option), non-abbreviated hashes began to appear, leading to failures for these tests. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-28t7502-commit: add tests for summary outputLibravatar Tay Ray Chuan1-0/+43
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-28get_cwd_relative(): do not misinterpret suffix as subdirectoryLibravatar Clemens Buchacher1-2/+10
If the current working directory is the same as the work tree path plus a suffix, e.g. 'work' and 'work-xyz', then the suffix '-xyz' would be interpreted as a subdirectory of 'work'. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-25t7502-commit: fix spellingLibravatar Tay Ray Chuan1-1/+1
s/subdirecotry/subdirectory/ Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-20Fix checkout of large files to network shares on Windows XPLibravatar René Scharfe1-3/+9
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-20start_command: close cmd->err descriptor when fork/spawn failsLibravatar bert Dvornik1-1/+1
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-10merge: --log appends shortlog to message if specifiedLibravatar Tay Ray Chuan1-1/+1
When the user specifies a message, use fmt_merge_msg_shortlog() to append the shortlog. Previously, when a message was specified, we ignored the merge title ("Merge <foo> into <bar>") and shortlog from fmt_merge_msg(). Update the documentation for -m to reflect this too. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-10t7604-merge-custom-message: show that --log doesn't append to -mLibravatar Tay Ray Chuan1-0/+12
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-10t7604-merge-custom-message: shift expected output creationLibravatar Tay Ray Chuan1-4/+8
Squash in a minor rename too. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-10handle "git --bare init <dir>" properlyLibravatar Jeff King1-0/+14
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-08Documentation/notes: describe content of notes blobsLibravatar Jonathan Nieder1-0/+38
stripspace/text-based formatting kicks in when specifying the notes content with -m or -F, or when an editor is used to edit the notes. To binary-safely create notes from files, the following construct is required: git notes add -C $(git hash-object -w <file>) <object> Explain this trick (thanks, Johan!) in the manual. Add an ordinary example, too, to keep this esoteric one company. Cc: Johan Herland <johan@herland.net> Cc: Thomas Rast <trast@student.ethz.ch> Cc: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-07Turn setup code in t2007-checkout-symlink.sh into a testLibravatar Ævar Arnfjörð Bjarmason1-2/+4
Previously the test would print to stdout which interfered with the TAP output. Now this scaffolding code is just a normal test. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-07Move t6000lib.sh to lib-*Libravatar Ævar Arnfjörð Bjarmason4-3/+3
The naming of this test library conflicted with the recommendation in t/README's "Naming Tests" section. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-06wt-status: take advice.statusHints seriouslyLibravatar Michael J Gruber1-1/+1
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-06t7508: test advice.statusHintsLibravatar Michael J Gruber1-0/+45
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-06test-lib: some shells do not let $? propagate into an evalLibravatar Jonathan Nieder2-3/+25
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>