summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)Author
2014-06-16Merge branch 'jk/do-not-run-httpd-tests-as-root'Junio C Hamano
* jk/do-not-run-httpd-tests-as-root: t/lib-httpd: require SANITY prereq
2014-06-16Merge branch 'cc/replace-edit'Junio C Hamano
"git replace" learns a new "--edit" option. * cc/replace-edit: Documentation: replace: describe new --edit option replace: add --edit to usage string replace: add tests for --edit replace: die early if replace ref already exists replace: refactor checking ref validity replace: make sure --edit results in a different object replace: add --edit option replace: factor object resolution out of replace_object replace: use OPT_CMDMODE to handle modes replace: refactor command-mode determination
2014-06-16Merge branch 'mt/patch-id-stable' (early part)Junio C Hamano
* 'mt/patch-id-stable' (early part): patch-id-test: test stable and unstable behaviour patch-id: make it stable against hunk reordering test doc: test_write_lines does not split its arguments test: add test_write_lines helper
2014-06-10patch-id-test: test stable and unstable behaviourMichael S. Tsirkin
Verify that patch ID supports an algorithm that is stable against diff split and reordering. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-10test doc: test_write_lines does not split its argumentsJonathan Nieder
test_write_lines carefully quotes its arguments as "$@", so test_write_lines "a b" c writes two lines as requested, not three. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-10test: add test_write_lines helperMichael S. Tsirkin
API and implementation as suggested by Junio. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09Merge branch 'jc/shortlog-ref-exclude'Junio C Hamano
"log --exclude=<glob> --all | shortlog" worked as expected, but "shortlog --exclude=<glob> --all" was not accepted at the command line argument parser level. * jc/shortlog-ref-exclude: shortlog: allow --exclude=<glob> to be passed
2014-06-09Merge branch 'pb/trim-trailing-spaces'Junio C Hamano
Fix an error in parsing of .gitignore files that use a trailing "\ " to mark pathnames that end with a SP. * pb/trim-trailing-spaces: dir.c:trim_trailing_spaces(): fix for " \ " sequence
2014-06-09Merge branch 'na/no-http-test-in-the-middle'Junio C Hamano
The mode to run tests with HTTP server tests disabled was broken. * na/no-http-test-in-the-middle: t5538: move http push tests out to t5542
2014-06-09Merge branch 'jc/rev-parse-argh-dashed-multi-words'Junio C Hamano
"update-index --cacheinfo" in 2.0 crashes on a malformed command line. * jc/rev-parse-argh-dashed-multi-words: update-index: fix segfault with missing --cacheinfo argument
2014-06-09Merge branch 'lt/request-pull'Junio C Hamano
A brown-paper-bag bugfix to a test that turned out to be a no-op by mistake. * lt/request-pull: fix brown paper bag breakage in t5150-request-pull.sh
2014-06-06Merge branch 'mc/git-p4-prepare-p4-only'Junio C Hamano
* mc/git-p4-prepare-p4-only: git-p4: Do not include diff in spec file when just preparing p4
2014-06-06Merge branch 'jn/test-lint-unmoor'Junio C Hamano
* jn/test-lint-unmoor: test-lint: find unportable sed, echo, test, and export usage after &&
2014-06-06Merge branch 'ep/shell-assign-and-export-vars'Junio C Hamano
* ep/shell-assign-and-export-vars: scripts: more "export VAR=VALUE" fixes scripts: "export VAR=VALUE" construct is not portable
2014-06-06Merge branch 'nd/status-auto-comment-char'Junio C Hamano
* nd/status-auto-comment-char: commit: allow core.commentChar=auto for character auto selection config: be strict on core.commentChar
2014-06-06Merge branch 'mt/rebase-i-keep-empty-test'Junio C Hamano
* mt/rebase-i-keep-empty-test: rebase --keep-empty -i: add test
2014-06-06Merge branch 'mk/show-s-no-extra-blank-line-for-merges'Junio C Hamano
* mk/show-s-no-extra-blank-line-for-merges: git-show: fix 'git show -s' to not add extra terminator after merge commit
2014-06-06Merge branch 'bc/blame-crlf-test'Junio C Hamano
If a file contained CRLF line endings in a repository with core.autocrlf=input, then blame always marked lines as "Not Committed Yet", even if they were unmodified. * bc/blame-crlf-test: blame: correctly handle files regardless of autocrlf
2014-06-06Merge branch 'dt/merge-recursive-case-insensitive'Junio C Hamano
On a case insensitive filesystem, merge-recursive incorrectly deleted the file that is to be renamed to a name that is the same except for case differences. * dt/merge-recursive-case-insensitive: mv: allow renaming to fix case on case insensitive filesystems merge-recursive.c: fix case-changing merge bug
2014-06-06Merge branch 'rs/reflog-exists'Junio C Hamano
* rs/reflog-exists: checkout.c: use ref_exists instead of file_exist refs.c: add new functions reflog_exists and delete_reflog
2014-06-06Merge branch 'jk/utf8-switch-between-nfd-and-nfc'Junio C Hamano
Document a known breakage with a test. * jk/utf8-switch-between-nfd-and-nfc: t3910: show failure of core.precomposeunicode with decomposed filenames
2014-06-06Merge branch 'jk/commit-C-pick-empty'Junio C Hamano
"git commit --allow-empty-message -C $commit" did not work when the commit did not have any log message. * jk/commit-C-pick-empty: commit: do not complain of empty messages from -C
2014-06-04shortlog: allow --exclude=<glob> to be passedJunio C Hamano
These two commands are supposed to be equivalent: $ git log --exclude=refs/notes/\* --all --no-merges --since=2.days | git shortlog $ git shortlog --exclude=refs/notes/\* --all --no-merges --since=2.days However, the latter does not understand the ref-exclusion command line option, even though other options understood by "log", such as "--all" and "--no-merges", are understood. This was because e7b432c5 (revision: introduce --exclude=<glob> to tame wildcards, 2013-08-30) did not wire the new option fully to the machinery. A new option understood by handle_revision_pseudo_opt() must be told to handle_revision_opt() as well. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-04update-index: fix segfault with missing --cacheinfo argumentJeff King
Running "git update-index --cacheinfo" without any further arguments results in a segfault rather than an error message. Commit ec160ae (update-index: teach --cacheinfo a new syntax "mode,sha1,path", 2014-03-23) added code to examine the format of the argument, but forgot to handle the NULL case. Returning an error from the parser is enough, since we then treat it as an old-style "--cacheinfo <mode> <sha1> <path>", and complain that we have less than 3 arguments to read. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-03Merge branch 'ew/config-protect-mode'Junio C Hamano
* ew/config-protect-mode: config: preserve config file permissions on edits
2014-06-03Merge branch 'jk/commit-date-approxidate'Junio C Hamano
* jk/commit-date-approxidate: commit: accept more date formats for "--date" commit: print "Date" line when the user has set date pretty: make show_ident_date public commit: use split_ident_line to compare author/committer
2014-06-03Merge branch 'ep/shell-command-substitution'Junio C Hamano
Adjust shell scripts to use $(cmd) instead of `cmd`. * ep/shell-command-substitution: (41 commits) t5000-tar-tree.sh: use the $( ... ) construct for command substitution t4204-patch-id.sh: use the $( ... ) construct for command substitution t4119-apply-config.sh: use the $( ... ) construct for command substitution t4116-apply-reverse.sh: use the $( ... ) construct for command substitution t4057-diff-combined-paths.sh: use the $( ... ) construct for command substitution t4038-diff-combined.sh: use the $( ... ) construct for command substitution t4036-format-patch-signer-mime.sh: use the $( ... ) construct for command substitution t4014-format-patch.sh: use the $( ... ) construct for command substitution t4013-diff-various.sh: use the $( ... ) construct for command substitution t4012-diff-binary.sh: use the $( ... ) construct for command substitution t4010-diff-pathspec.sh: use the $( ... ) construct for command substitution t4006-diff-mode.sh: use the $( ... ) construct for command substitution t3910-mac-os-precompose.sh: use the $( ... ) construct for command substitution t3905-stash-include-untracked.sh: use the $( ... ) construct for command substitution t1050-large.sh: use the $( ... ) construct for command substitution t1020-subdirectory.sh: use the $( ... ) construct for command substitution t1004-read-tree-m-u-wf.sh: use the $( ... ) construct for command substitution t1003-read-tree-prefix.sh: use the $( ... ) construct for command substitution t1002-read-tree-m-u-2way.sh: use the $( ... ) construct for command substitution t1001-read-tree-m-2way.sh: use the $( ... ) construct for command substitution ...
2014-06-03Merge branch 'sk/tag-contains-wo-recursion'Junio C Hamano
* sk/tag-contains-wo-recursion: git tag --contains: avoid stack overflow
2014-06-03Merge branch 'jk/external-diff-use-argv-array'Junio C Hamano
Code clean-up (and a bugfix which has been merged for 2.0). * jk/external-diff-use-argv-array: run_external_diff: refactor cmdline setup logic run_external_diff: hoist common bits out of conditional run_external_diff: drop fflush(NULL) run_external_diff: clean up error handling run_external_diff: use an argv_array for the environment
2014-06-03Merge branch 'mh/ref-transaction'Junio C Hamano
Update "update-ref --stdin [-z]" and then introduce a transactional support for (multi-)reference updates. * mh/ref-transaction: (27 commits) ref_transaction_commit(): work with transaction->updates in place struct ref_update: add a type field struct ref_update: add a lock field ref_transaction_commit(): simplify code using temporary variables struct ref_update: store refname as a FLEX_ARRAY struct ref_update: rename field "ref_name" to "refname" refs: remove API function update_refs() update-ref --stdin: reimplement using reference transactions refs: add a concept of a reference transaction update-ref --stdin: harmonize error messages update-ref --stdin: improve the error message for unexpected EOF t1400: test one mistake at a time update-ref --stdin -z: deprecate interpreting the empty string as zeros update-ref.c: extract a new function, parse_next_sha1() t1400: test that stdin -z update treats empty <newvalue> as zeros update-ref --stdin: simplify error messages for missing oldvalues update-ref --stdin: make error messages more consistent update-ref --stdin: improve error messages for invalid values update-ref.c: extract a new function, parse_refname() parse_cmd_verify(): copy old_sha1 instead of evaluating <oldvalue> twice ...
2014-06-03Merge branch 'jc/apply-ignore-whitespace'Junio C Hamano
"--ignore-space-change" option of "git apply" ignored the spaces at the beginning of line too aggressively, which is inconsistent with the option of the same name "diff" and "git diff" have. * jc/apply-ignore-whitespace: apply --ignore-space-change: lines with and without leading whitespaces do not match
2014-06-02dir.c:trim_trailing_spaces(): fix for " \ " sequencePasha Bolokhov
Discard the unnecessary 'nr_spaces' variable, remove 'strlen()' and improve the 'if' structure. Switch to pointers instead of integers to control the loop. Slightly more rare occurrences of 'text \ ' with a backslash in between spaces are handled correctly. Namely, the code in 7e2e4b37 (dir: ignore trailing spaces in exclude patterns, 2014-02-09) does not reset 'last_space' when a backslash is encountered and the above line stays intact as a result. Add a test at the end of t/t0008-ignores.sh to exhibit this behavior. Signed-off-by: Pasha Bolokhov <pasha.bolokhov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-02fix brown paper bag breakage in t5150-request-pull.shJohannes Sixt
The recent addition to the test case 'pull request format' interrupted the single-quoted text, effectively adding a third argument to the test_expect_success command. Since we do not have a prerequisite named "pull request format", the test is skipped, no matter what. Additionally, the file name argument to the grep command is missing. Fix both issues. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-30t5538: move http push tests out to t5542Nick Alcock
As 0232852b, but for the push tests instead: this avoids a start_httpd in the middle of the file, which fails under GIT_TEST_HTTPD=false. Note that we have to munge the test in a few ways while moving it: 1. We drop the `test -z "$GIT_TEST_HTTPD"` check; this is too simplistic since 83d842d, and we should let lib-httpd.sh handle it. 2. We have to port over some of the old setup from t5538. 3. In the final test, we no longer expect the extra commit "1" built on top of "4". This was a side effect from an earlier test in t5538 which was not ported over. Signed-off-by: Nick Alcock <nick.alcock@oracle.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-30t5537: re-drop http testsJeff King
These were originally removed by 0232852 (t5537: move http tests out to t5539, 2014-02-13). However, they were accidentally re-added in 1ddb4d7 (Merge branch 'nd/upload-pack-shallow', 2014-03-21). This looks like an error in manual conflict resolution. Here's what happened: 1. v1.9.0 shipped with the http tests in t5537. 2. We realized that this caused problems, and built 0232852 on top to move the tests to their own file. This fix made it into v1.9.1. 3. We later had another fix in nd/upload-pack-shallow that also touched t5537. It was built directly on v1.9.0. When we merged nd/upload-pack-shallow to master, we got a conflict; it was built on a version with the http tests, but we had since removed them. The correct resolution was to drop the http tests and keep the new ones, but instead we kept everything. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-27git-p4: Do not include diff in spec file when just preparing p4Maxime Coste
The diff information render the spec file unusable as is by p4, do not include it when run with --prepare-p4-only so that the given file can be directly passed to p4. With --prepare-p4-only, git-p4 already tells the user it can use p4 submit with the generated spec file. This fails because of the diff being present in the file. Not including the diff fixes that. Without --prepare-p4-only, keeping the diff makes sense for a quick review of the patch before submitting it. And does not cause problems with p4 as we remove it programmatically. Signed-off-by: Maxime Coste <frrrwww@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-23scripts: more "export VAR=VALUE" fixesJunio C Hamano
Found by git grep '[^-]export [^&]*=' -- \*.sh Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-23test-lint: find unportable sed, echo, test, and export usage after &&Jonathan Nieder
Instead of anchoring these checks with "^\s*", just check that the usage is preceded by a word boundary. So now we can catch test $cond && export foo=bar just like we already catch test $cond && export foo=bar As a side effect, this will detect usage of "sed -i", "echo -n", "test a == b", and "export a=b" in comments. That is not ideal but it's potentially useful because people sometimes copy code from comments so it can be good to also avoid nonportable patterns there. To avoid false positives, keep the checks for 'declare' and 'which' anchored. Those are frequently used words in normal English-language comments. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-20Revert "Merge branch 'jc/graduate-remote-hg-bzr' (early part)"Junio C Hamano
Instead of showing a warning and working as before, fail and show the message and force immediate upgrade from their upstream repositories when these tools are run, per request from their primary author. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-20Merge branch 'jc/graduate-remote-hg-bzr' (early part)Junio C Hamano
* 'jc/graduate-remote-hg-bzr' (early part): remote-helpers: point at their upstream repositories contrib: remote-helpers: add move warnings (v2.0) Revert "Merge branch 'fc/transport-helper-sync-error-fix'"
2014-05-20Revert "Merge branch 'fc/transport-helper-sync-error-fix'"Junio C Hamano
This reverts commit d508e4a8e2391ae2596403b6478d01cf3d5f928f, reversing changes made to e42552135a2a396f37053a89f44952ea907870b2. The author of the original topic says he broke the upcoming 2.0 release with something that relates to "synchronization crash regression" while refusing to give further specifics, so this would unfortunately be the safest option for the upcoming release. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-19Merge branch 'rh/prompt-pcmode-avoid-eval-on-refname'Junio C Hamano
* rh/prompt-pcmode-avoid-eval-on-refname: git-prompt.sh: don't assume the shell expands the value of PS1
2014-05-19git-prompt.sh: don't assume the shell expands the value of PS1Richard Hansen
Not all shells subject the prompt string to parameter expansion. Test whether the shell will expand the value of PS1, and use the result to control whether raw ref names are included directly in PS1. This fixes a regression introduced in commit 8976500 ("git-prompt.sh: don't put unsanitized branch names in $PS1"): zsh does not expand PS1 by default, but that commit assumed it did. The bug resulted in prompts containing the literal string '${__git_ps1_branch_name}' instead of the actual branch name. Reported-by: Caleb Thompson <caleb@calebthompson.io> Signed-off-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-19rebase --keep-empty -i: add testMichael S. Tsirkin
There's some special code in rebase -i to deal with --keep-empty. Add test for this combination. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-19replace: add tests for --editChristian Couder
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-19commit: allow core.commentChar=auto for character auto selectionNguyễn Thái Ngọc Duy
When core.commentChar is "auto", the comment char starts with '#' as in default but if it's already in the prepared message, find another char in a small subset. This should stop surprises because git strips some lines unexpectedly. Note that git is not smart enough to recognize '#' as the comment char in custom templates and convert it if the final comment char is different. It thinks '#' lines in custom templates as part of the commit message. So don't use this with custom templates. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-19config: be strict on core.commentCharNguyễn Thái Ngọc Duy
We don't support comment _strings_ (at least not yet). And multi-byte character encoding could also be misinterpreted. The test with two commas is updated because it violates this. It's added with the patch that introduces core.commentChar in eff80a9 (Allow custom "comment char" - 2013-01-16). It's not clear to me _why_ that behavior is wanted. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-19Merge branch 'lt/request-pull'Junio C Hamano
* lt/request-pull: request-pull: resurrect for-linus -> tags/for-linus DWIM
2014-05-16request-pull: resurrect for-linus -> tags/for-linus DWIMJunio C Hamano
Older versions of Git before v1.7.10 did not DWIM $ git pull $URL for-linus to the tag "tags/for-linus" and the users were required to say $ git pull $URL tags/for-linus instead. Because newer versions of Git works either way, request-pull used to show tags/for-linus when asked $ git request-pull origin/master $URL for-linus The recent updates broke this and in the output we see "for-linus" without the "tags/" prefix. As v1.7.10 is more than 2 years old, this should matter very little in practice, but resurrecting it is very simple. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-15git-show: fix 'git show -s' to not add extra terminator after merge commitMax Kirillov
When git show -s is called for merge commit it prints extra newline after any merge commit. This differs from output for commits with one parent. Fix it by more thorough checking that diff output is disabled. The code in question exists since commit 3969cf7db1. The additional newline is really needed for cases when patch is requested, test t4013-diff-various.sh contains cases which can demonstrate behavior when the condition is restricted further. Tests: Added merge commit to 'set up a bit of history' case in t7007-show.sh to cover the fix. Existing tests are updated to demonstrate the new behaviour. Earlier, the tests that used "git show -s --pretty=format:%s", even though "--pretty=format:%s" calls for item separator semantics and does not ask for the terminating newline after the last item, expected the output to end with such a newline. They were relying on the buggy behaviour. Use of "--format=%s", which is equivalent to "--pretty=tformat:%s" that asks for a terminating newline after each item, is a more realistic way to use the command. In the test 'merge log messages' the expected data is changed, because it was explicitly listing the extra newline. Also the msg.nologff and msg.nolognoff expected files are replaced by one msg.nolog, because they were diffing because of the bug, and now there should be no difference. Signed-off-by: Max Kirillov <max@max630.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>