{"thread":{"id":"17882","subject":"What's cooking in git.git (Feb 2009, #06; Wed, 18)","startedAt":"2009-02-19T01:42:54Z","lastAt":"2009-03-03T07:31:06Z","messageCount":19,"participants":["Junio C Hamano","Thomas Rast","Johannes Schindelin","Sverre Rabbelier","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"105373","messageId":"7v7i3nqk0x.fsf@gitster.siamese.dyndns.org","threadId":"17882","inReplyTo":null,"subject":"What's cooking in git.git (Feb 2009, #06; Wed, 18)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-19T01:42:54Z","receivedAt":"2009-02-19T01:42:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Here are the topics that have been cooking.  Commits prefixed with '-' are\nonly in 'pu' while commits prefixed with '+' are in 'next'.  The ones\nmarked with '.' do not appear in any of the branches, but I am still\nholding onto them.\n\nThe topics list the commits in reverse chronological order.  The topics\nmeant to be merged to the maintenance series have \"maint-\" in their names.\n\nThe master branch is slightly past 1.6.2-rc1.\n\nAs an experiment, 'next' and 'pu' stay open during this release freeze;\nnew topics are accepted as time permits, but people are much more strongly\nencouraged to find issues on what is already on 'master', and patches to\nfix them always takes precedence over what is still on 'next' and will\nnever graduate until 1.6.2 final.\n\n----------------------------------------------------------------\n[New Topics]\n\n* fc/parseopt-config (Tue Feb 17 15:52:56 2009 +0200) 11 commits\n . config: Don't allow extra arguments for -e or -l\n . config: Disallow multiple variable types\n . config: Disallow multiple config file locations\n . config: Disallow --getcolor* and other actions used together\n . config: Use parseopt\n . config: Reorganize get_color*\n . config: Trivial rename in preparation for parseopt\n . ??? config: Make git_config() more flexible\n . config: Cleanup editor action\n . config: style clean-ups\n - config: Add new option to open an editor.\n\nBuilds on top of \"config -e\" change.\n\n* mv/parseopt-ls-files (Tue Feb 17 15:27:11 2009 +0100) 2 commits\n - parse-opt: migrate builtin-ls-files.\n - Turn the flags in struct dir_struct into a single variable\n\n----------------------------------------------------------------\n[Stalled and may need help and prodding to go forward]\n\n* ns/stash-keep (Thu Feb 12 06:25:14 2009 +0900) 1 commit\n - stash: --keep option just saves\n\nDo we want to keep this one?\n\n* lh/submodule-tree-traversal (Sun Jan 25 01:52:06 2009 +0100) 1 commit\n - archive.c: add support for --submodules[=(all|checkedout)]\n\nDiscussion stalled on the submodule selection criteria.\n\n* jc/blame (Wed Jun 4 22:58:40 2008 -0700) 2 commits\n + blame: show \"previous\" information in --porcelain/--incremental\n   format\n + git-blame: refactor code to emit \"porcelain format\" output\n\nThis gives Porcelains (like gitweb) the information on the commit _before_\nthe one that the final blame is laid on, which should save them one\nrev-parse to dig further.  The line number in the \"previous\" information\nmay need refining, and sanity checking code for reference counting may\nneed to be resurrected before this can move forward.\n\nI thought recent tig discussion may blow new life into it, but is this\nunneeded?  If so I'd rather revert it (or discard after 1.6.2).\n\n* db/foreign-scm (Sun Jan 11 15:12:10 2009 -0500) 3 commits\n - Support fetching from foreign VCSes\n - Add specification of git-vcs helpers\n - Add \"vcs\" config option in remotes\n\nThe \"spec\" did not seem quite well cooked yet, but in the longer term I\nthink something like this to allow interoperating with other SCMs as if\nthe other end is a native git repository is a very worthy goal.\n\n* cc/replace (Mon Feb 2 06:13:06 2009 +0100) 11 commits\n - builtin-replace: use \"usage_msg_opt\" to give better error messages\n - parse-options: add new function \"usage_msg_opt\"\n - builtin-replace: teach \"git replace\" to actually replace\n - Add new \"git replace\" command\n - environment: add global variable to disable replacement\n - mktag: call \"check_sha1_signature\" with the replacement sha1\n - replace_object: add a test case\n - object: call \"check_sha1_signature\" with the replacement sha1\n - sha1_file: add a \"read_sha1_file_repl\" function\n - replace_object: add mechanism to replace objects found in\n   \"refs/replace/\"\n - refs: add a \"for_each_replace_ref\" function\n\nI think the code is much cleaner than the first round, but I am not\nconvinced it is doing the right thing in the connectivity traverser.  \nIndependent review sorely needed.\n\n* sc/gitweb-category (Fri Dec 12 00:45:12 2008 +0100) 3 commits\n - gitweb: Optional grouping of projects by category\n - gitweb: Split git_project_list_body in two functions\n - gitweb: Modularized git_get_project_description to be more generic\n\nDesign discussion between Jakub and Sebastien seems to have stalled, but\nJakub seems to be taking this over.\n\n* jc/fsck (Fri Jan 30 02:33:47 2009 -0800) 4 commits\n - fsck: three levels of validation\n - verify-pack: add --quick\n - verify_pack(): allow a quicker verification for a pack with\n   version 2 idx\n - pack-check.c: minor formatting fix to match coding style\n\nJ6t has a good point that if this had any value then medium level should\nreplace the default.  I am tempted to actually dropping this as a failed\nexperiment.\n\n----------------------------------------------------------------\n[Reverted]\n\n* mh/unify-color (Fri Jan 23 01:25:23 2009 -0800) 3 commits\n ? Revert previous two commits\n ? move the color variables to color.c\n ? handle color.ui at a central place\n\nThis broke git-format-patch badly.\n\n* js/rebase-error-a-bit-more-verbose (Sun Feb 8 21:22:18 2009 -0800) 2 commits\n ? Revert \"rebase: explain why when the HEAD could not be detached\"\n ? rebase: explain why when the HEAD could not be detached\n\nThis turned out to be unnecessary.\n\n* rs/maint-1.6.0-windows-ceiling (Sat Feb 7 12:40:40 2009 -0800) 2 commits\n ? Revert \"fix t1504 on Windows\"\n ? fix t1504 on Windows\n\nI'm giving a fresh start to J6t's series which contains this.\n\n* lh/reverted-submodule-tree-traversal (Sun Jan 25 18:39:55 2009 -0800) 4 commits\n ? Revert round #1 of the series\n ? builtin-ls-tree: enable traversal of submodules\n ? archive.c: enable traversal of submodules\n ? tree.c: add support for traversal of submodules\n\nI'm giving a fresh start to Lars's second iteration.\n\n----------------------------------------------------------------\n[Will merge to 'next' soon]\n\n* tr/gcov (Sun Feb 15 23:25:45 2009 +0100) 8 commits\n - Test git-patch-id\n - Test rev-list --parents/--children\n - Test log --decorate\n - Test fsck a bit harder\n - Test log --graph\n - Test diff --dirstat functionality\n - Test that diff can read from stdin\n - Support coverage testing with GCC/gcov\n\n----------------------------------------------------------------\n[Ready for 'master' after 1.6.2]\n\n* jw/imap-preformatted-html (Thu Feb 12 08:58:12 2009 -0600) 1 commit\n + imap.preformattedHTML to tell Thunderbird to send non-flowed text\n\nThe patch text should be identical to Jeremy's \"Virtual Patch\", except\nthat the configuration variable was renamed per list discussion.\n\n* jw/format-patch-attach (Thu Feb 12 09:51:55 2009 -0600) 1 commit\n + Enable setting attach as the default in .gitconfig for git-format-\n   patch.\n\n* sr/force-rebase (Fri Feb 13 23:48:01 2009 +0100) 1 commit\n + Teach rebase to rebase even if upstream is up to date\n\n* fg/exclude-bq (Tue Feb 10 15:20:17 2009 +0100) 1 commit\n + Support \"\\\" in non-wildcard exclusion entries\n\n* dm/add-i-edit-abort (Thu Feb 12 00:19:41 2009 -0500) 1 commit\n + add -i: revisit hunk on editor failure\n\n* tp/completion (Wed Feb 11 13:03:26 2009 -0500) 4 commits\n + completion: More fixes to prevent unbound variable errors\n + completion: Better __git_ps1 support when not in working directory\n + completion: Use consistent if [...] convention, not \"test\"\n + completion: For consistency, change \"git rev-parse\" to __gitdir\n   calls\n\n* js/branch-symref (Wed Feb 18 19:14:59 2009 +0100) 2 commits\n + Avoid segfault with 'git branch' when the HEAD is detached\n + builtin-branch: improve output when displaying remote branches\n\n* al/ansi-color (Fri Feb 13 22:53:41 2009 +0100) 2 commits\n + builtin-branch.c: Rename branch category color names\n + Clean up use of ANSI color sequences\n\n* kb/checkout-optim (Wed Feb 18 23:18:03 2009 +0100) 10 commits\n + check_updates(): effective removal of cache entries marked\n   CE_REMOVE\n + lstat_cache(): print a warning if doing ping-pong between cache\n   types\n + show_patch_diff(): remove a call to fstat()\n + write_entry(): use fstat() instead of lstat() when file is open\n + write_entry(): cleanup of some duplicated code\n + create_directories(): remove some memcpy() and strchr() calls\n + unlink_entry(): introduce schedule_dir_for_removal()\n + lstat_cache(): swap func(length, string) into func(string, length)\n + lstat_cache(): generalise longest_match_lstat_cache()\n + lstat_cache(): small cleanup and optimisation\n\n* js/valgrind (Thu Feb 5 22:03:00 2009 +0100) 9 commits\n + valgrind: do not require valgrind 3.4.0 or newer\n + test-lib: avoid assuming that templates/ are in the GIT_EXEC_PATH\n + Tests: let --valgrind imply --verbose and --tee\n + Add a script to coalesce the valgrind outputs\n + t/Makefile: provide a 'valgrind' target\n + test-lib.sh: optionally output to test-results/$TEST.out, too\n + Valgrind support: check for more than just programming errors\n + valgrind: ignore ldso and more libz errors\n + Add valgrind support in test scripts\n\n----------------------------------------------------------------\n[Actively cooking]\n\n* jc/add-p-unquote (Mon Feb 16 22:43:43 2009 -0800) 1 commit\n + git-add -i/-p: learn to unwrap C-quoted paths\n\n* js/send-email (Sat Feb 14 23:32:15 2009 -0500) 3 commits\n + send-email: --suppress-cc improvements\n + send-email: handle multiple Cc addresses when reading mbox message\n + send-email: allow send-email to run outside a repo\n\n* sg/rerere-cleanup (Sat Feb 14 23:21:04 2009 +0100) 1 commit\n + rerere: remove duplicated functions\n\n* js/notes (Wed Feb 18 11:17:27 2009 -0800) 14 commits\n + tests: fix \"export var=val\"\n + notes: refuse to edit notes outside refs/notes/\n + t3301: use test_must_fail instead of !\n + t3301: fix confusing quoting in test for valid notes ref\n + notes: use GIT_EDITOR and core.editor over VISUAL/EDITOR\n + notes: only clean up message file when editing\n + handle empty notes gracefully\n + git notes show: test empty notes\n + git-notes: fix printing of multi-line notes\n + notes: fix core.notesRef documentation\n + Add an expensive test for git-notes\n + Speed up git notes lookup\n + Add a script to edit/inspect notes\n + Introduce commit notes\n\nEarlier part was merged to master and then reverted there.  I probably\nshould rebase this after 1.6.2 to keep my sanity.\n\n* fc/config-editor (Sat Feb 7 23:53:00 2009 +0200) 1 commit\n - config: Add new option to open an editor.\n\n* js/remote-set-head (Sat Feb 14 05:30:30 2009 -0500) 5 commits\n - builtin-remote: better handling of multiple remote HEADs\n - builtin-remote: add set-head subcommand\n - builtin-remote: teach show to display remote HEAD\n - builtin-remote: move duplicated cleanup code its own function\n - builtin-clone: move locate_head() to remote.c so it can be re-used\n\n* jk/head-lookup (Sun Feb 15 01:18:18 2009 -0500) 5 commits\n - remote: use exact HEAD lookup if it is available\n - remote: refactor guess_remote_head\n - refactor find_refs_by_name to accept const list\n - add basic http clone/fetch tests\n - test scripts: refactor start_httpd helper\n\nBuilds on top of Jay Soffian's js/remote-set-head topic.  How well do\nthese two work in practice in the real world?  Success stories?\n\n----------------------------------------------------------------\n[On Hold]\n\n* jc/deny-delete-current-1.7.0 (Mon Feb 9 00:19:46 2009 -0800) 1 commit\n - receive-pack: default receive.denyDeleteCurrent to refuse\n\n* jc/refuse-push-to-current-1.7.0 (Wed Feb 11 02:28:03 2009 -0800) 1 commit\n - Refuse updating the current branch in a non-bare repository via\n   push\n\nThis is for 1.7.0.\n\n* jc/commit-assume-also-during-merge (Thu Jan 22 22:21:49 2009 -0800) 3 commits\n - git commit: pathspec without -i/-o implies -i semantics during a\n   merge\n - builtin-commit: shorten eye-sore overlong lines\n - Add \"partial commit\" tests during a conflicted merge\n\nThis was only meant as a weatherballoon to help facilitate discussion.\n\n* jc/merge-convert (Mon Jan 26 16:45:01 2009 -0800) 1 commit\n - git-merge-file: allow converting the results for the work tree\n\nThis is a feature waiting for a user.  I do not need it in 1.6.2\n\nWe did not give scripted Porcelains a way to say \"this temporary file I am\nusing for merging is for this path, so use the core.autocrlf and attributes\nrules for that final path\".  Instead, merge-file simply wrote out the\ndata in the canonical repository representation.\n\nrerere has the same issue, but it is a lot worse.  It reads the three\nfiles (preimage, postimage and thisimage) from the work tree in the work\ntree representation, merges them without converting them to the canonical\nrepresentation first but inserts the conflict markers with the canonical\nrepresentation and writes the resulting mess out.  It needs to be fixed to\nread with convert_to_git(), merge them while they are still in the\ncanonical representation and possibly add conflict markers, and then write\nthe results out after convert_to_working_tree().  It also needs to write\nin binary mode as well.\n\n----------------------------------------------------------------\n[Perhaps will discard]\n\n* jk/renamelimit (Sat May 3 13:58:42 2008 -0700) 1 commit\n . diff: enable \"too large a rename\" warning when -M/-C is explicitly\n   asked for\n\n* jc/stripspace (Sun Mar 9 00:30:35 2008 -0800) 6 commits\n . git-am --forge: add Signed-off-by: line for the author\n . git-am: clean-up Signed-off-by: lines\n . stripspace: add --log-clean option to clean up signed-off-by:\n   lines\n . stripspace: use parse_options()\n . Add \"git am -s\" test\n . git-am: refactor code to add signed-off-by line for the committer\n\n* jc/post-simplify (Fri Aug 15 01:34:51 2008 -0700) 2 commits\n . revision --simplify-merges: incremental simplification\n . revision --simplify-merges: prepare for incremental simplification\n"},{"id":"105437","messageId":"cover.1235041345.git.trast@student.ethz.ch","threadId":"17882","inReplyTo":"7v7i3nqk0x.fsf@gitster.siamese.dyndns.org","subject":"[PATCH v2 0/8] Support coverage testing with GCC/gcov","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-19T11:13:34Z","receivedAt":"2009-02-19T11:13:34Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Junio C Hamano wrote:\n> [Will merge to 'next' soon]\n> \n> * tr/gcov (Sun Feb 15 23:25:45 2009 +0100) 8 commits\n>  - Test git-patch-id\n>  - Test rev-list --parents/--children\n>  - Test log --decorate\n>  - Test fsck a bit harder\n>  - Test log --graph\n>  - Test diff --dirstat functionality\n>  - Test that diff can read from stdin\n>  - Support coverage testing with GCC/gcov\n\nI noticed two small things that I'd like to fix before this goes\n'next', so here they are:\n\n* [1/8] Support coverage testing with GCC/gcov\n\n  Changed it so the compilation (but not the testing) uses the same -j\n  flags as the caller, so that compilation can be done in parallel.\n  (It's rather minor compared to the slow testing with optimizations\n  turned off, but still.)\n\n* [5/8] Test fsck a bit harder\n\n  Fixed an invocation of hash-objects that lacked --stdin.  I also\n  added some debugging cats to make it easier to fix the grep\n  invocation when fsck actually starts printing errors for these\n  corruptions.\n\nApart from that it's the same.\n\nThanks!\n\n\nThomas Rast (8):\n  Support coverage testing with GCC/gcov\n  Test that diff can read from stdin\n  Test diff --dirstat functionality\n  Test log --graph\n  Test fsck a bit harder\n  Test log --decorate\n  Test rev-list --parents/--children\n  Test git-patch-id\n\n Makefile                                      |   24 ++++\n t/t1450-fsck.sh                               |   67 +++++++++++\n t/t4002-diff-basic.sh                         |    8 ++\n t/t4013-diff-various.sh                       |    5 +\n t/t4013/diff.diff_--dirstat_master~1_master~2 |    3 +\n t/t4013/diff.log_--decorate_--all             |   34 ++++++\n t/t4013/diff.rev-list_--children_HEAD         |    7 +\n t/t4013/diff.rev-list_--parents_HEAD          |    7 +\n t/t4202-log.sh                                |  148 +++++++++++++++++++++++++\n t/t4203-patch-id.sh                           |   38 +++++++\n 10 files changed, 341 insertions(+), 0 deletions(-)\n create mode 100644 t/t4013/diff.diff_--dirstat_master~1_master~2\n create mode 100644 t/t4013/diff.log_--decorate_--all\n create mode 100644 t/t4013/diff.rev-list_--children_HEAD\n create mode 100644 t/t4013/diff.rev-list_--parents_HEAD\n create mode 100755 t/t4203-patch-id.sh\n"},{"id":"105438","messageId":"fe8993f99f8459f74f704a488cdffbd4cf10b0fd.1235041345.git.trast@student.ethz.ch","threadId":"17882","inReplyTo":"cover.1235041345.git.trast@student.ethz.ch","subject":"[PATCH v2 1/8] Support coverage testing with GCC/gcov","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-19T11:13:35Z","receivedAt":"2009-02-19T11:13:35Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"With gcc's --coverage option, we can perform automatic coverage data\ncollection for the test suite.\n\nAdd a new Makefile target 'coverage' that scraps all previous coverage\nresults, recompiles git with the required compiler/linker flags (in\naddition to any flags you specify manually), then runs the test suite\nand compiles a report.\n\nThe compilation must be done with all optimizations disabled, since\ninlined functions (and for line-by-line coverage, also optimized\nbranches/loops) break coverage tracking.\n\nThe tests are run serially (with -j1).  The coverage code should\ntheoretically allow concurrent access to its data files, but the\nauthor saw random test failures.  Obviously this could be improved.\n\nThe report currently consists of a list of functions that were never\nexecuted during the tests, which is written to\n'coverage-untested-functions'.  Once this list becomes reasonably\nshort, we would also want to look at branches that were never taken.\n\nCurrently only toplevel *.c files are considered.  It would be nice to\nat least include xdiff, but --coverage did not save data to\nsubdirectories on the system used to write this (gcc 4.3.2).\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nLet the 'all' sub-build of 'coverage' run with the caller's -j setting\nso that it can parallelize.\n\nInterdiff:\n\n   --- a/Makefile\n   +++ b/Makefile\n  @@ -21,8 +21,9 @@\n   +COVERAGE_LDFLAGS = $(CFLAGS)  -O0 -lgcov\n   +\n   +coverage-build: coverage-clean\n  ++      $(MAKE) CFLAGS=\"$(COVERAGE_CFLAGS)\" LDFLAGS=\"$(COVERAGE_LDFLAGS)\" all\n   +      $(MAKE) CFLAGS=\"$(COVERAGE_CFLAGS)\" LDFLAGS=\"$(COVERAGE_LDFLAGS)\" \\\n  -+              -j1 all test\n  ++              -j1 test\n   +\n   +coverage-report:\n   +      gcov -b *.c\n\n\n Makefile |   24 ++++++++++++++++++++++++\n 1 files changed, 24 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b040a96..c32881b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1640,3 +1640,27 @@ check-docs::\n check-builtins::\n \t./check-builtins.sh\n\n+### Test suite coverage testing\n+#\n+.PHONY: coverage coverage-clean coverage-build coverage-report\n+\n+coverage:\n+\t$(MAKE) coverage-build\n+\t$(MAKE) coverage-report\n+\n+coverage-clean:\n+\trm -f *.gcda *.gcno\n+\n+COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs\n+COVERAGE_LDFLAGS = $(CFLAGS)  -O0 -lgcov\n+\n+coverage-build: coverage-clean\n+\t$(MAKE) CFLAGS=\"$(COVERAGE_CFLAGS)\" LDFLAGS=\"$(COVERAGE_LDFLAGS)\" all\n+\t$(MAKE) CFLAGS=\"$(COVERAGE_CFLAGS)\" LDFLAGS=\"$(COVERAGE_LDFLAGS)\" \\\n+\t\t-j1 test\n+\n+coverage-report:\n+\tgcov -b *.c\n+\tgrep '^function.*called 0 ' *.c.gcov \\\n+\t\t| sed -e 's/\\([^:]*\\)\\.gcov: *function \\([^ ]*\\) called.*/\\1: \\2/' \\\n+\t\t| tee coverage-untested-functions\n--\n1.6.2.rc1.266.gce6c4\n"},{"id":"105442","messageId":"54ce919e5c1f9c295018ea6e4a0cf2aeaf465591.1235041345.git.trast@student.ethz.ch","threadId":"17882","inReplyTo":"cover.1235041345.git.trast@student.ethz.ch","subject":"[PATCH v2 2/8] Test that diff can read from stdin","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-19T11:13:36Z","receivedAt":"2009-02-19T11:13:36Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Signed-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nSame as v1.\n\n t/t4002-diff-basic.sh |    8 ++++++++\n 1 files changed, 8 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh\nindex cc3681f..18695ce 100755\n--- a/t/t4002-diff-basic.sh\n+++ b/t/t4002-diff-basic.sh\n@@ -258,4 +258,12 @@ test_expect_success \\\n     git diff-tree -r -R $tree_A $tree_B >.test-b &&\n     cmp -s .test-a .test-b'\n \n+test_expect_success \\\n+    'diff can read from stdin' \\\n+    'test_must_fail git diff --no-index -- MN - < NN |\n+        grep -v \"^index\" | sed \"s#/-#/NN#\" >.test-a &&\n+    test_must_fail git diff --no-index -- MN NN |\n+        grep -v \"^index\" >.test-b &&\n+    test_cmp .test-a .test-b'\n+\n test_done\n-- \n1.6.2.rc1.266.gce6c4\n"},{"id":"105439","messageId":"dffae171f72e565d4202e3d4bc0dad05bba8570d.1235041345.git.trast@student.ethz.ch","threadId":"17882","inReplyTo":"cover.1235041345.git.trast@student.ethz.ch","subject":"[PATCH v2 3/8] Test diff --dirstat functionality","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-19T11:13:37Z","receivedAt":"2009-02-19T11:13:37Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"This is only a very rudimentary test, but it was untested before.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nSame as v1.\n\n t/t4013-diff-various.sh                       |    1 +\n t/t4013/diff.diff_--dirstat_master~1_master~2 |    3 +++\n 2 files changed, 4 insertions(+), 0 deletions(-)\n create mode 100644 t/t4013/diff.diff_--dirstat_master~1_master~2\n\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 9c70902..0289336 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -268,6 +268,7 @@ diff --no-index --name-status dir2 dir\n diff --no-index --name-status -- dir2 dir\n diff --no-index dir dir3\n diff master master^ side\n+diff --dirstat master~1 master~2\n EOF\n \n test_done\ndiff --git a/t/t4013/diff.diff_--dirstat_master~1_master~2 b/t/t4013/diff.diff_--dirstat_master~1_master~2\nnew file mode 100644\nindex 0000000..b672e1c\n--- /dev/null\n+++ b/t/t4013/diff.diff_--dirstat_master~1_master~2\n@@ -0,0 +1,3 @@\n+$ git diff --dirstat master~1 master~2\n+  40.0% dir/\n+$\n-- \n1.6.2.rc1.266.gce6c4\n"},{"id":"105441","messageId":"a6cc1b8844a60fc5284ac8e6b93658a041f6bfeb.1235041345.git.trast@student.ethz.ch","threadId":"17882","inReplyTo":"cover.1235041345.git.trast@student.ethz.ch","subject":"[PATCH v2 4/8] Test log --graph","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-19T11:13:38Z","receivedAt":"2009-02-19T11:13:38Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"So far there were no tests checking that log --graph actually works.\n\nNote that the tests strip trailing whitespace, as the current --graph\nemits trailing whitespace on lines that do not contain anything but\ngraph lines.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nSame as v1.\n\n t/t4202-log.sh |  148 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 148 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 7b976ee..93966f7 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -134,5 +134,153 @@ test_expect_success 'log --grep -i' '\n \ttest_cmp expect actual\n '\n \n+cat > expect <<EOF\n+* Second\n+* sixth\n+* fifth\n+* fourth\n+* third\n+* second\n+* initial\n+EOF\n+\n+test_expect_success 'simple log --graph' '\n+\tgit log --graph --pretty=tformat:%s >actual &&\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'set up merge history' '\n+\tgit checkout -b side HEAD~4 &&\n+\ttest_commit side-1 1 1 &&\n+\ttest_commit side-2 2 2 &&\n+\tgit checkout master &&\n+\tgit merge side\n+'\n+\n+cat > expect <<\\EOF\n+*   Merge branch 'side'\n+|\\\n+| * side-2\n+| * side-1\n+* | Second\n+* | sixth\n+* | fifth\n+* | fourth\n+|/\n+* third\n+* second\n+* initial\n+EOF\n+\n+test_expect_success 'log --graph with merge' '\n+\tgit log --graph --date-order --pretty=tformat:%s |\n+\t\tsed \"s/ *$//\" >actual &&\n+\ttest_cmp expect actual\n+'\n+\n+cat > expect <<\\EOF\n+*   commit master\n+|\\  Merge: A B\n+| | Author: A U Thor <author@example.com>\n+| |\n+| |     Merge branch 'side'\n+| |\n+| * commit side\n+| | Author: A U Thor <author@example.com>\n+| |\n+| |     side-2\n+| |\n+| * commit tags/side-1\n+| | Author: A U Thor <author@example.com>\n+| |\n+| |     side-1\n+| |\n+* | commit master~1\n+| | Author: A U Thor <author@example.com>\n+| |\n+| |     Second\n+| |\n+* | commit master~2\n+| | Author: A U Thor <author@example.com>\n+| |\n+| |     sixth\n+| |\n+* | commit master~3\n+| | Author: A U Thor <author@example.com>\n+| |\n+| |     fifth\n+| |\n+* | commit master~4\n+|/  Author: A U Thor <author@example.com>\n+|\n+|       fourth\n+|\n+* commit tags/side-1~1\n+| Author: A U Thor <author@example.com>\n+|\n+|     third\n+|\n+* commit tags/side-1~2\n+| Author: A U Thor <author@example.com>\n+|\n+|     second\n+|\n+* commit tags/side-1~3\n+  Author: A U Thor <author@example.com>\n+\n+      initial\n+EOF\n+\n+test_expect_success 'log --graph with full output' '\n+\tgit log --graph --date-order --pretty=short |\n+\t\tgit name-rev --name-only --stdin |\n+\t\tsed \"s/Merge:.*/Merge: A B/;s/ *$//\" >actual &&\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'set up more tangled history' '\n+\tgit checkout -b tangle HEAD~6 &&\n+\ttest_commit tangle-a tangle-a a &&\n+\tgit merge master~3 &&\n+\tgit merge side~1 &&\n+\tgit checkout master &&\n+\tgit merge tangle\n+'\n+\n+cat > expect <<\\EOF\n+*   Merge branch 'tangle'\n+|\\\n+| *   Merge branch 'side' (early part) into tangle\n+| |\\\n+| * \\   Merge branch 'master' (early part) into tangle\n+| |\\ \\\n+| * | | tangle-a\n+* | | |   Merge branch 'side'\n+|\\ \\ \\ \\\n+| * | | | side-2\n+| | | |/\n+| | |/|\n+| |/| |\n+| * | | side-1\n+* | | | Second\n+* | | | sixth\n+| | |/\n+| |/|\n+|/| |\n+* | | fifth\n+* | | fourth\n+|/ /\n+* | third\n+|/\n+* second\n+* initial\n+EOF\n+\n+test_expect_success 'log --graph with merge' '\n+\tgit log --graph --date-order --pretty=tformat:%s |\n+\t\tsed \"s/ *$//\" >actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_done\n \n-- \n1.6.2.rc1.266.gce6c4\n"},{"id":"105440","messageId":"0599d1b4fe0f243b3d86d9afd9c67858861838aa.1235041345.git.trast@student.ethz.ch","threadId":"17882","inReplyTo":"cover.1235041345.git.trast@student.ethz.ch","subject":"[PATCH v2 5/8] Test fsck a bit harder","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-19T11:13:39Z","receivedAt":"2009-02-19T11:13:39Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"git-fsck, of all tools, has very few tests.  This adds some more:\n* a corrupted object;\n* a branch pointing to a non-commit;\n* a tag pointing to a nonexistent object;\n* and a tag pointing to an object of a type other than what the tag\n  itself claims.\n\nOnly the first two are caught.  At least the third probably should,\ntoo, but currently slips through.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nFixed a missing --stdin when calling git-hash-object.  I also added\nsome debugging 'cat out' to make it easier to fix the 'grep'\ninvocation when fsck actually starts printing errors for these\ncorruptions.\n\n   --- a/t/t1450-fsck.sh\n   +++ b/t/t1450-fsck.sh\n  -@@ -28,4 +28,69 @@ test_expect_success 'loose objects borrowed from alternate are not missing' '\n  +@@ -28,4 +28,71 @@ test_expect_success 'loose objects borrowed from alternate are not missing' '\n          )\n    '\n\n  @@ -79,12 +80,13 @@\n   +      tag=$(git hash-object -w --stdin < invalid-tag) &&\n   +      echo $tag > .git/refs/tags/invalid &&\n   +      git fsck --tags 2>out &&\n  ++      cat out &&\n   +      grep \"could not load tagged object\" out &&\n   +      rm .git/refs/tags/invalid\n   +'\n   +\n   +cat > wrong-tag <<EOF\n  -+object $(echo blob | git hash-object -w)\n  ++object $(echo blob | git hash-object -w --stdin)\n   +type commit\n   +tag wrong\n   +tagger T A Gger <tagger@example.com> 1234567890 -0000\n  @@ -96,6 +98,7 @@\n   +      tag=$(git hash-object -w --stdin < wrong-tag) &&\n   +      echo $tag > .git/refs/tags/wrong &&\n   +      git fsck --tags 2>out &&\n  ++      cat out &&\n   +      grep \"some sane error message\" out &&\n   +      rm .git/refs/tags/wrong\n   +'\n\n\n t/t1450-fsck.sh |   67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 67 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\nindex 4597af0..a22632f 100755\n--- a/t/t1450-fsck.sh\n+++ b/t/t1450-fsck.sh\n@@ -28,4 +28,71 @@ test_expect_success 'loose objects borrowed from alternate are not missing' '\n \t)\n '\n \n+# Corruption tests follow.  Make sure to remove all traces of the\n+# specific corruption you test afterwards, lest a later test trip over\n+# it.\n+\n+test_expect_success 'object with bad sha1' '\n+\tsha=$(echo blob | git hash-object -w --stdin) &&\n+\techo $sha &&\n+\told=$(echo $sha | sed \"s+^..+&/+\") &&\n+\tnew=$(dirname $old)/ffffffffffffffffffffffffffffffffffffff &&\n+\tsha=\"$(dirname $new)$(basename $new)\"\n+\tmv .git/objects/$old .git/objects/$new &&\n+\tgit update-index --add --cacheinfo 100644 $sha foo &&\n+\ttree=$(git write-tree) &&\n+\tcmt=$(echo bogus | git commit-tree $tree) &&\n+\tgit update-ref refs/heads/bogus $cmt &&\n+\t(git fsck 2>out; true) &&\n+\tgrep \"$sha.*corrupt\" out &&\n+\trm -f .git/objects/$new &&\n+\tgit update-ref -d refs/heads/bogus &&\n+\tgit read-tree -u --reset HEAD\n+'\n+\n+test_expect_success 'branch pointing to non-commit' '\n+\tgit rev-parse HEAD^{tree} > .git/refs/heads/invalid &&\n+\tgit fsck 2>out &&\n+\tgrep \"not a commit\" out &&\n+\tgit update-ref -d refs/heads/invalid\n+'\n+\n+cat > invalid-tag <<EOF\n+object ffffffffffffffffffffffffffffffffffffffff\n+type commit\n+tag invalid\n+tagger T A Gger <tagger@example.com> 1234567890 -0000\n+\n+This is an invalid tag.\n+EOF\n+\n+test_expect_failure 'tag pointing to nonexistent' '\n+\ttag=$(git hash-object -w --stdin < invalid-tag) &&\n+\techo $tag > .git/refs/tags/invalid &&\n+\tgit fsck --tags 2>out &&\n+\tcat out &&\n+\tgrep \"could not load tagged object\" out &&\n+\trm .git/refs/tags/invalid\n+'\n+\n+cat > wrong-tag <<EOF\n+object $(echo blob | git hash-object -w --stdin)\n+type commit\n+tag wrong\n+tagger T A Gger <tagger@example.com> 1234567890 -0000\n+\n+This is an invalid tag.\n+EOF\n+\n+test_expect_failure 'tag pointing to something else than its type' '\n+\ttag=$(git hash-object -w --stdin < wrong-tag) &&\n+\techo $tag > .git/refs/tags/wrong &&\n+\tgit fsck --tags 2>out &&\n+\tcat out &&\n+\tgrep \"some sane error message\" out &&\n+\trm .git/refs/tags/wrong\n+'\n+\n+\n+\n test_done\n-- \n1.6.2.rc1.266.gce6c4\n"},{"id":"105443","messageId":"e7a3131051b18403c111d0f202544bd3a8822979.1235041345.git.trast@student.ethz.ch","threadId":"17882","inReplyTo":"cover.1235041345.git.trast@student.ethz.ch","subject":"[PATCH v2 6/8] Test log --decorate","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-19T11:13:40Z","receivedAt":"2009-02-19T11:13:40Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Signed-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nSame as v1.\n\n t/t4013-diff-various.sh           |    1 +\n t/t4013/diff.log_--decorate_--all |   34 ++++++++++++++++++++++++++++++++++\n 2 files changed, 35 insertions(+), 0 deletions(-)\n create mode 100644 t/t4013/diff.log_--decorate_--all\n\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 0289336..ef16f69 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -207,6 +207,7 @@ log --root -c --patch-with-stat --summary master\n log --root --cc --patch-with-stat --summary master\n log -SF master\n log -SF -p master\n+log --decorate --all\n \n whatchanged master\n whatchanged -p master\ndiff --git a/t/t4013/diff.log_--decorate_--all b/t/t4013/diff.log_--decorate_--all\nnew file mode 100644\nindex 0000000..12da8ac\n--- /dev/null\n+++ b/t/t4013/diff.log_--decorate_--all\n@@ -0,0 +1,34 @@\n+$ git log --decorate --all\n+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (refs/heads/master)\n+Merge: 9a6d494 c7a2ab9\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:04:00 2006 +0000\n+\n+    Merge branch 'side'\n+\n+commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a (refs/heads/side)\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:03:00 2006 +0000\n+\n+    Side\n+\n+commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:02:00 2006 +0000\n+\n+    Third\n+\n+commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:01:00 2006 +0000\n+\n+    Second\n+    \n+    This is the second commit.\n+\n+commit 444ac553ac7612cc88969031b02b3767fb8a353a (refs/heads/initial)\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:00:00 2006 +0000\n+\n+    Initial\n+$\n-- \n1.6.2.rc1.266.gce6c4\n"},{"id":"105444","messageId":"5bfd6b118737769e006be12ebda28d198952305d.1235041345.git.trast@student.ethz.ch","threadId":"17882","inReplyTo":"cover.1235041345.git.trast@student.ethz.ch","subject":"[PATCH v2 7/8] Test rev-list --parents/--children","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-19T11:13:41Z","receivedAt":"2009-02-19T11:13:41Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Signed-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nSame as v1.\n\n t/t4013-diff-various.sh               |    3 +++\n t/t4013/diff.rev-list_--children_HEAD |    7 +++++++\n t/t4013/diff.rev-list_--parents_HEAD  |    7 +++++++\n 3 files changed, 17 insertions(+), 0 deletions(-)\n create mode 100644 t/t4013/diff.rev-list_--children_HEAD\n create mode 100644 t/t4013/diff.rev-list_--parents_HEAD\n\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex ef16f69..9cd5a6e 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -209,6 +209,9 @@ log -SF master\n log -SF -p master\n log --decorate --all\n \n+rev-list --parents HEAD\n+rev-list --children HEAD\n+\n whatchanged master\n whatchanged -p master\n whatchanged --root master\ndiff --git a/t/t4013/diff.rev-list_--children_HEAD b/t/t4013/diff.rev-list_--children_HEAD\nnew file mode 100644\nindex 0000000..e7f17d5\n--- /dev/null\n+++ b/t/t4013/diff.rev-list_--children_HEAD\n@@ -0,0 +1,7 @@\n+$ git rev-list --children HEAD\n+59d314ad6f356dd08601a4cd5e530381da3e3c64\n+c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a 59d314ad6f356dd08601a4cd5e530381da3e3c64\n+9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 59d314ad6f356dd08601a4cd5e530381da3e3c64\n+1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0\n+444ac553ac7612cc88969031b02b3767fb8a353a 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a\n+$\ndiff --git a/t/t4013/diff.rev-list_--parents_HEAD b/t/t4013/diff.rev-list_--parents_HEAD\nnew file mode 100644\nindex 0000000..65d2a80\n--- /dev/null\n+++ b/t/t4013/diff.rev-list_--parents_HEAD\n@@ -0,0 +1,7 @@\n+$ git rev-list --parents HEAD\n+59d314ad6f356dd08601a4cd5e530381da3e3c64 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a\n+c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a 444ac553ac7612cc88969031b02b3767fb8a353a\n+9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44\n+1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 444ac553ac7612cc88969031b02b3767fb8a353a\n+444ac553ac7612cc88969031b02b3767fb8a353a\n+$\n-- \n1.6.2.rc1.266.gce6c4\n"},{"id":"105445","messageId":"889fbb648233ddfd5eb03e231d4f5aa7be60e009.1235041345.git.trast@student.ethz.ch","threadId":"17882","inReplyTo":"cover.1235041345.git.trast@student.ethz.ch","subject":"[PATCH v2 8/8] Test git-patch-id","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-19T11:13:42Z","receivedAt":"2009-02-19T11:13:42Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"So far, git-patch-id was untested.  Add some simple checks for output\nformat and patch (in)equality.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nSame as v1.\n\n t/t4203-patch-id.sh |   38 ++++++++++++++++++++++++++++++++++++++\n 1 files changed, 38 insertions(+), 0 deletions(-)\n create mode 100755 t/t4203-patch-id.sh\n\ndiff --git a/t/t4203-patch-id.sh b/t/t4203-patch-id.sh\nnew file mode 100755\nindex 0000000..04f7bae\n--- /dev/null\n+++ b/t/t4203-patch-id.sh\n@@ -0,0 +1,38 @@\n+#!/bin/sh\n+\n+test_description='git patch-id'\n+\n+. ./test-lib.sh\n+\n+test_expect_success 'setup' '\n+\ttest_commit initial foo a &&\n+\ttest_commit first foo b &&\n+\tgit checkout -b same HEAD^ &&\n+\ttest_commit same-msg foo b &&\n+\tgit checkout -b notsame HEAD^ &&\n+\ttest_commit notsame-msg foo c\n+'\n+\n+test_expect_success 'patch-id output is well-formed' '\n+\tgit log -p -1 | git patch-id > output &&\n+\tgrep \"^[a-f0-9]\\{40\\} $(git rev-parse HEAD)$\" output\n+'\n+\n+get_patch_id () {\n+\tgit log -p -1 \"$1\" | git patch-id |\n+\t\tsed \"s# .*##\" > patch-id_\"$1\"\n+}\n+\n+test_expect_success 'patch-id detects equality' '\n+\tget_patch_id master &&\n+\tget_patch_id same &&\n+\ttest_cmp patch-id_master patch-id_same\n+'\n+\n+test_expect_success 'patch-id detects inequality' '\n+\tget_patch_id master &&\n+\tget_patch_id notsame &&\n+\t! test_cmp patch-id_master patch-id_notsame\n+'\n+\n+test_done\n-- \n1.6.2.rc1.266.gce6c4\n"},{"id":"105462","messageId":"alpine.DEB.1.00.0902191227260.6223@intel-tinevez-2-302","threadId":"17882","inReplyTo":"cover.1235041345.git.trast@student.ethz.ch","subject":"Re: [PATCH v2 0/8] Support coverage testing with GCC/gcov","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-19T13:46:09Z","receivedAt":"2009-02-19T13:46:09Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 19 Feb 2009, Thomas Rast wrote:\n\n> Junio C Hamano wrote:\n> > [Will merge to 'next' soon]\n> > \n> > * tr/gcov (Sun Feb 15 23:25:45 2009 +0100) 8 commits\n> >  - Test git-patch-id\n> >  - Test rev-list --parents/--children\n> >  - Test log --decorate\n> >  - Test fsck a bit harder\n> >  - Test log --graph\n> >  - Test diff --dirstat functionality\n> >  - Test that diff can read from stdin\n> >  - Support coverage testing with GCC/gcov\n> \n> I noticed two small things that I'd like to fix before this goes\n> 'next', so here they are:\n> \n> * [1/8] Support coverage testing with GCC/gcov\n> \n>   Changed it so the compilation (but not the testing) uses the same -j\n>   flags as the caller, so that compilation can be done in parallel.\n>   (It's rather minor compared to the slow testing with optimizations\n>   turned off, but still.)\n\nI strongly disagree that it is minor.  _Especially_ since the tests are \nslow, -j makes a huge difference.\n\nAnd also without making the tests slower, -j makes a dramatic difference \nhere:\n\n\t$ /usr/bin/time make -j50 test\n\t...\n\t60.41user 213.92system 2:49.34elapsed 162%CPU\n\t(0avgtext+0avgdata 0maxresident)k\n\t160inputs+401944outputs\n\t(0major+37204627minor)pagefaults 0swaps\n\n\t$ /usr/bin/time make test\n\t...\n\t88.08user 314.96system 7:28.28elapsed 89%CPU\n\t(0avgtext+0avgdata 0maxresident)k\n\t0inputs+401008outputs\n\t(0major+37223584minor)pagefaults 0swaps\n\nCiao,\nDscho\n"},{"id":"105466","messageId":"bd6139dc0902190609r4718ba3as117ab79a5f3679de@mail.gmail.com","threadId":"17882","inReplyTo":"cover.1235041345.git.trast@student.ethz.ch","subject":"Re: [PATCH v2 0/8] Support coverage testing with GCC/gcov","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-02-19T14:09:53Z","receivedAt":"2009-02-19T14:09:53Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Thu, Feb 19, 2009 at 12:13, Thomas Rast <trast@student.ethz.ch> wrote:\n> I noticed two small things that I'd like to fix before this goes\n> 'next', so here they are:\n\n<snip>\n\n> Apart from that it's the same.\n\nI think in this case, where it is the second iteration of the series,\nwith only few, and minor changes to the series as a whole it's better\nto just send the updates as reply to the original version?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"105467","messageId":"200902191512.16755.trast@student.ethz.ch","threadId":"17882","inReplyTo":"alpine.DEB.1.00.0902191227260.6223@intel-tinevez-2-302","subject":"Re: [PATCH v2 0/8] Support coverage testing with GCC/gcov","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-19T14:11:57Z","receivedAt":"2009-02-19T14:11:57Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Johannes Schindelin wrote:\n> On Thu, 19 Feb 2009, Thomas Rast wrote:\n> > I noticed two small things that I'd like to fix before this goes\n> > 'next', so here they are:\n> > \n> > * [1/8] Support coverage testing with GCC/gcov\n> > \n> >   Changed it so the compilation (but not the testing) uses the same -j\n> >   flags as the caller, so that compilation can be done in parallel.\n> >   (It's rather minor compared to the slow testing with optimizations\n> >   turned off, but still.)\n> \n> I strongly disagree that it is minor.  _Especially_ since the tests are \n> slow, -j makes a huge difference.\n> \n> And also without making the tests slower, -j makes a dramatic difference \n> here:\n> \n> \t$ /usr/bin/time make -j50 test\n\nThat's not the point.\n\nI agree that for the test suite, -j makes a huge impact, since it\ntakes so long.  But even though the docs claim it should be possible,\nI've been getting \"random\" test failures when compiled with coverage\nsupport, that went away with -j1.  So the tests still run with -j1, as\nwith the first version of the series.\n\nHowever, the first version used a single make invocation for the'all'\nand 'test' targets, which of course also means that the _compilation_\n('all') happens with -j1.  That's not necessary as far as I can see,\nand I split them into separate commands in v2, where 'all' doesn't\npass a -j option any more (so that the caller's choice remains in\neffect).\n\nWhat I meant by the above remark is that the maybe 30 seconds you gain\nby compiling in parallel are a very minor gain when compared to the\nenormous running time of the _sequential_ test suite _without\noptimizations_, which feels like 15-20min here, I haven't even timed\nit.  (I always mount t/ on a tmpfs which does away with the fsync()\nbottleneck and lets me do ordinary test runs, with NO_SVN_TESTS, in\nunder 3min.)\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"105641","messageId":"effac809336c1e05613eed315483ec32f3a4c75b.1235158438.git.trast@student.ethz.ch","threadId":"17882","inReplyTo":"0599d1b4fe0f243b3d86d9afd9c67858861838aa.1235041345.git.trast@student.ethz.ch","subject":"[PATCH v3] Test fsck a bit harder","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-20T19:40:03Z","receivedAt":"2009-02-20T19:40:03Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"git-fsck, of all tools, has very few tests.  This adds some more:\n* a corrupted object;\n* a branch pointing to a non-commit;\n* a tag pointing to a nonexistent object;\n* and a tag pointing to an object of a type other than what the tag\n  itself claims.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nI investigated the test failures with v2, and it turns out the problem\nwas in my use of hash-object.  When correctly passing '-t tag' for the\ntags, fsck does detect the breakage.  So here's an updated version of\nthis test.  Interdiff:\n\n  diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\n  index 628db19..a22632f 100755\n  --- a/t/t1450-fsck.sh\n  +++ b/t/t1450-fsck.sh\n  @@ -66,13 +66,13 @@ tagger T A Gger <tagger@example.com> 1234567890 -0000\n   This is an invalid tag.\n   EOF\n\n  -test_expect_success 'tag pointing to nonexistent' '\n  -       tag=$(git hash-object -t tag -w --stdin < invalid-tag) &&\n  +test_expect_failure 'tag pointing to nonexistent' '\n  +       tag=$(git hash-object -w --stdin < invalid-tag) &&\n          echo $tag > .git/refs/tags/invalid &&\n  -       git fsck 2>&1 | tee out &&\n  -       grep \"missing commit ffffffffffffffffffffffffffffffffffffffff\" out &&\n  -       rm .git/refs/tags/invalid &&\n  -       rm -f .git/objects/$(echo $tag | sed \"s#^..#&/#\")\n  +       git fsck --tags 2>out &&\n  +       cat out &&\n  +       grep \"could not load tagged object\" out &&\n  +       rm .git/refs/tags/invalid\n   '\n\n   cat > wrong-tag <<EOF\n  @@ -84,11 +84,12 @@ tagger T A Gger <tagger@example.com> 1234567890 -0000\n   This is an invalid tag.\n   EOF\n\n  -test_expect_success 'tag pointing to something else than its type' '\n  -       tag=$(git hash-object -t tag -w --stdin < wrong-tag) &&\n  +test_expect_failure 'tag pointing to something else than its type' '\n  +       tag=$(git hash-object -w --stdin < wrong-tag) &&\n          echo $tag > .git/refs/tags/wrong &&\n  -       git fsck 2>&1 | tee out &&\n  -       grep \"Object.*is a blob, not a commit\" out &&\n  +       git fsck --tags 2>out &&\n  +       cat out &&\n  +       grep \"some sane error message\" out &&\n          rm .git/refs/tags/wrong\n   '\n\n t/t1450-fsck.sh |   66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 66 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\nindex 4597af0..628db19 100755\n--- a/t/t1450-fsck.sh\n+++ b/t/t1450-fsck.sh\n@@ -28,4 +28,70 @@ test_expect_success 'loose objects borrowed from alternate are not missing' '\n \t)\n '\n \n+# Corruption tests follow.  Make sure to remove all traces of the\n+# specific corruption you test afterwards, lest a later test trip over\n+# it.\n+\n+test_expect_success 'object with bad sha1' '\n+\tsha=$(echo blob | git hash-object -w --stdin) &&\n+\techo $sha &&\n+\told=$(echo $sha | sed \"s+^..+&/+\") &&\n+\tnew=$(dirname $old)/ffffffffffffffffffffffffffffffffffffff &&\n+\tsha=\"$(dirname $new)$(basename $new)\"\n+\tmv .git/objects/$old .git/objects/$new &&\n+\tgit update-index --add --cacheinfo 100644 $sha foo &&\n+\ttree=$(git write-tree) &&\n+\tcmt=$(echo bogus | git commit-tree $tree) &&\n+\tgit update-ref refs/heads/bogus $cmt &&\n+\t(git fsck 2>out; true) &&\n+\tgrep \"$sha.*corrupt\" out &&\n+\trm -f .git/objects/$new &&\n+\tgit update-ref -d refs/heads/bogus &&\n+\tgit read-tree -u --reset HEAD\n+'\n+\n+test_expect_success 'branch pointing to non-commit' '\n+\tgit rev-parse HEAD^{tree} > .git/refs/heads/invalid &&\n+\tgit fsck 2>out &&\n+\tgrep \"not a commit\" out &&\n+\tgit update-ref -d refs/heads/invalid\n+'\n+\n+cat > invalid-tag <<EOF\n+object ffffffffffffffffffffffffffffffffffffffff\n+type commit\n+tag invalid\n+tagger T A Gger <tagger@example.com> 1234567890 -0000\n+\n+This is an invalid tag.\n+EOF\n+\n+test_expect_success 'tag pointing to nonexistent' '\n+\ttag=$(git hash-object -t tag -w --stdin < invalid-tag) &&\n+\techo $tag > .git/refs/tags/invalid &&\n+\tgit fsck 2>&1 | tee out &&\n+\tgrep \"missing commit ffffffffffffffffffffffffffffffffffffffff\" out &&\n+\trm .git/refs/tags/invalid &&\n+\trm -f .git/objects/$(echo $tag | sed \"s#^..#&/#\")\n+'\n+\n+cat > wrong-tag <<EOF\n+object $(echo blob | git hash-object -w --stdin)\n+type commit\n+tag wrong\n+tagger T A Gger <tagger@example.com> 1234567890 -0000\n+\n+This is an invalid tag.\n+EOF\n+\n+test_expect_success 'tag pointing to something else than its type' '\n+\ttag=$(git hash-object -t tag -w --stdin < wrong-tag) &&\n+\techo $tag > .git/refs/tags/wrong &&\n+\tgit fsck 2>&1 | tee out &&\n+\tgrep \"Object.*is a blob, not a commit\" out &&\n+\trm .git/refs/tags/wrong\n+'\n+\n+\n+\n test_done\n-- \n1.6.2.rc1.310.g364d6\n"},{"id":"105649","messageId":"499F12BF.4080405@kdbg.org","threadId":"17882","inReplyTo":"effac809336c1e05613eed315483ec32f3a4c75b.1235158438.git.trast@student.ethz.ch","subject":"Re: [PATCH v3] Test fsck a bit harder","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-02-20T20:29:51Z","receivedAt":"2009-02-20T20:29:51Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Thomas Rast schrieb:\n> +test_expect_success 'object with bad sha1' '\n> +\tsha=$(echo blob | git hash-object -w --stdin) &&\n> +\techo $sha &&\n> +\told=$(echo $sha | sed \"s+^..+&/+\") &&\n> +\tnew=$(dirname $old)/ffffffffffffffffffffffffffffffffffffff &&\n\n\tnew=${old%/*}/ffffffffffffffffffffffffffffffffffffff &&\n\n> +\tsha=\"$(dirname $new)$(basename $new)\"\n\n\tsha=${new%/*}${new##*/} &&\n\nnote the '&&'!\n\n> +\tmv .git/objects/$old .git/objects/$new &&\n> +\tgit update-index --add --cacheinfo 100644 $sha foo &&\n> +\ttree=$(git write-tree) &&\n> +\tcmt=$(echo bogus | git commit-tree $tree) &&\n> +\tgit update-ref refs/heads/bogus $cmt &&\n> +\t(git fsck 2>out; true) &&\n\nAny particular reason not to use\n\n\ttest_must_fail git fsck 2>out &&\n\nhere?\n\n> +\tgrep \"$sha.*corrupt\" out &&\n> +\trm -f .git/objects/$new &&\n> +\tgit update-ref -d refs/heads/bogus &&\n> +\tgit read-tree -u --reset HEAD\n> +'\n\nShouldn't the cleanup be outside the test_expect_success so that later \ntests work even if this one fails? (Ditto for subsequent tests.)\n\n> +test_expect_success 'tag pointing to nonexistent' '\n> +\ttag=$(git hash-object -t tag -w --stdin < invalid-tag) &&\n> +\techo $tag > .git/refs/tags/invalid &&\n> +\tgit fsck 2>&1 | tee out &&\n\n\ttest_must_fail git fsck > out 2>&1 &&\n\n> +\tgrep \"missing commit ffffffffffffffffffffffffffffffffffffffff\" out &&\n...\n> +test_expect_success 'tag pointing to something else than its type' '\n> +\ttag=$(git hash-object -t tag -w --stdin < wrong-tag) &&\n> +\techo $tag > .git/refs/tags/wrong &&\n> +\tgit fsck 2>&1 | tee out &&\n\n\ttest_must_fail git fsck > out 2>&1 &&\n\n> +\tgrep \"Object.*is a blob, not a commit\" out &&\n...\n\n-- Hannes\n"},{"id":"105704","messageId":"5d214c5180b20fa90d76cf0c2f064a14be1fb195.1235213803.git.trast@student.ethz.ch","threadId":"17882","inReplyTo":"499F12BF.4080405@kdbg.org","subject":"[PATCH v4] Test fsck a bit harder","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-21T11:25:38Z","receivedAt":"2009-02-21T11:25:38Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"git-fsck, of all tools, has very few tests.  This adds some more:\n* a corrupted object;\n* a branch pointing to a non-commit;\n* a tag pointing to a nonexistent object;\n* and a tag pointing to an object of a type other than what the tag\n  itself claims.\n\nSome of the involved shell programming is due to Johannes Sixt.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nJohannes Sixt wrote:\n> Any particular reason not to use\n> \n> \ttest_must_fail git fsck 2>out &&\n> \n> here?\n\nI thought I had seen instances where it notices something wrong, but\nstill exits with success.\n\nI checked again, and apparently I was dreaming.  I changed the tests\nto use\n\n\ttest_must_fail git fsck 2>&1 | tee out\n\ninstead, which both checks the exit status and makes the tests more\nverbose with -v.\n\n> Shouldn't the cleanup be outside the test_expect_success so that later \n> tests work even if this one fails? (Ditto for subsequent tests.)\n\nIndeed.  I have a tendency to try and wrap as much as possible into\nthe tests so that it's visible with -v, but here I clearly overshot.\n\nI also used all your shell programming suggestions, thanks a lot.\n\n\n t/t1450-fsck.sh |   69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 69 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\nindex 4597af0..0906b1d 100755\n--- a/t/t1450-fsck.sh\n+++ b/t/t1450-fsck.sh\n@@ -28,4 +28,73 @@ test_expect_success 'loose objects borrowed from alternate are not missing' '\n \t)\n '\n \n+# Corruption tests follow.  Make sure to remove all traces of the\n+# specific corruption you test afterwards, lest a later test trip over\n+# it.\n+\n+test_expect_success 'object with bad sha1' '\n+\tsha=$(echo blob | git hash-object -w --stdin) &&\n+\techo $sha &&\n+\told=$(echo $sha | sed \"s+^..+&/+\") &&\n+\tnew=${old%/*}/ffffffffffffffffffffffffffffffffffffff &&\n+\tsha=${new%/*}${new##*/} &&\n+\tmv .git/objects/$old .git/objects/$new &&\n+\tgit update-index --add --cacheinfo 100644 $sha foo &&\n+\ttree=$(git write-tree) &&\n+\tcmt=$(echo bogus | git commit-tree $tree) &&\n+\tgit update-ref refs/heads/bogus $cmt &&\n+\ttest_must_fail git fsck 2>&1 | tee out &&\n+\tgrep \"$sha.*corrupt\" out\n+'\n+\n+rm -f .git/objects/$new\n+git update-ref -d refs/heads/bogus\n+git read-tree -u --reset HEAD\n+\n+test_expect_success 'branch pointing to non-commit' '\n+\tgit rev-parse HEAD^{tree} > .git/refs/heads/invalid &&\n+\tgit fsck 2>&1 | tee out &&\n+\tgrep \"not a commit\" out\n+'\n+\n+git update-ref -d refs/heads/invalid\n+\n+cat > invalid-tag <<EOF\n+object ffffffffffffffffffffffffffffffffffffffff\n+type commit\n+tag invalid\n+tagger T A Gger <tagger@example.com> 1234567890 -0000\n+\n+This is an invalid tag.\n+EOF\n+\n+test_expect_success 'tag pointing to nonexistent' '\n+\ttag=$(git hash-object -t tag -w --stdin < invalid-tag) &&\n+\techo $tag > .git/refs/tags/invalid &&\n+\ttest_must_fail git fsck 2>&1 | tee out &&\n+\tgrep \"missing commit ffffffffffffffffffffffffffffffffffffffff\" out\n+'\n+\n+rm .git/refs/tags/invalid\n+rm -f .git/objects/$(echo $tag | sed \"s#^..#&/#\")\n+\n+cat > wrong-tag <<EOF\n+object $(echo blob | git hash-object -w --stdin)\n+type commit\n+tag wrong\n+tagger T A Gger <tagger@example.com> 1234567890 -0000\n+\n+This is an invalid tag.\n+EOF\n+\n+test_expect_success 'tag pointing to something else than its type' '\n+\ttag=$(git hash-object -t tag -w --stdin < wrong-tag) &&\n+\techo $tag > .git/refs/tags/wrong &&\n+\ttest_must_fail git fsck 2>&1 | tee out &&\n+\tgrep \"Object.*is a blob, not a commit\" out\n+'\n+\n+rm .git/refs/tags/wrong\n+\n+\n test_done\n-- \n1.6.2.rc1.310.ga3b4a\n"},{"id":"105736","messageId":"200902212021.37807.j6t@kdbg.org","threadId":"17882","inReplyTo":"5d214c5180b20fa90d76cf0c2f064a14be1fb195.1235213803.git.trast@student.ethz.ch","subject":"Re: [PATCH v4] Test fsck a bit harder","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-02-21T19:21:37Z","receivedAt":"2009-02-21T19:21:37Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Samstag, 21. Februar 2009, Thomas Rast wrote:\n> I changed the tests\n> to use\n>\n> \ttest_must_fail git fsck 2>&1 | tee out\n>\n> instead, which both checks the exit status and makes the tests more\n> verbose with -v.\n\nThis is wrong: It does not test the exist status. In a pipeline, the shell \nlooks only at the exit status of the last command. You really want this as\n\n \ttest_must_fail git fsck >out 2>&1 &&\n\nIf you want to have it more verbose, add 'cat out &&'. But IMHO that is \noverengineered. If the test detects a regression in the future, it is easy to \ninspect the file out if necessary.\n\n-- Hannes\n"},{"id":"106655","messageId":"1235946763-15252-1-git-send-email-trast@student.ethz.ch","threadId":"17882","inReplyTo":"200902212021.37807.j6t@kdbg.org","subject":"[PATCH v5] Test fsck a bit harder","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-03-01T22:32:43Z","receivedAt":"2009-03-01T22:32:43Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"git-fsck, of all tools, has very few tests.  This adds some more:\n* a corrupted object;\n* a branch pointing to a non-commit;\n* a tag pointing to a nonexistent object;\n* and a tag pointing to an object of a type other than what the tag\n  itself claims.\n\nSome of the involved shell programming is due to Johannes Sixt.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nSorry for taking so long to fix this.\n\nJohannes Sixt wrote:\n> This is wrong: It does not test the exist status. In a pipeline, the shell \n> looks only at the exit status of the last command. You really want this as\n> \n>  \ttest_must_fail git fsck >out 2>&1 &&\n\nYou're right.\n\n> If you want to have it more verbose, add 'cat out &&'. But IMHO that is \n> overengineered. If the test detects a regression in the future, it is easy to \n> inspect the file out if necessary.\n\nI usually try to write the tests such that the cause of failure should\nbe reasonably obvious from the verbose output.  But I don't really\ncare enough to insert stray cats either...\n\n\n t/t1450-fsck.sh |   69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 69 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\nindex 4597af0..d4a83a1 100755\n--- a/t/t1450-fsck.sh\n+++ b/t/t1450-fsck.sh\n@@ -28,4 +28,73 @@ test_expect_success 'loose objects borrowed from alternate are not missing' '\n \t)\n '\n \n+# Corruption tests follow.  Make sure to remove all traces of the\n+# specific corruption you test afterwards, lest a later test trip over\n+# it.\n+\n+test_expect_success 'object with bad sha1' '\n+\tsha=$(echo blob | git hash-object -w --stdin) &&\n+\techo $sha &&\n+\told=$(echo $sha | sed \"s+^..+&/+\") &&\n+\tnew=${old%/*}/ffffffffffffffffffffffffffffffffffffff &&\n+\tsha=${new%/*}${new##*/} &&\n+\tmv .git/objects/$old .git/objects/$new &&\n+\tgit update-index --add --cacheinfo 100644 $sha foo &&\n+\ttree=$(git write-tree) &&\n+\tcmt=$(echo bogus | git commit-tree $tree) &&\n+\tgit update-ref refs/heads/bogus $cmt &&\n+\ttest_must_fail git fsck >out 2>&1 &&\n+\tgrep \"$sha.*corrupt\" out\n+'\n+\n+rm -f .git/objects/$new\n+git update-ref -d refs/heads/bogus\n+git read-tree -u --reset HEAD\n+\n+test_expect_success 'branch pointing to non-commit' '\n+\tgit rev-parse HEAD^{tree} > .git/refs/heads/invalid &&\n+\tgit fsck 2>&1 | tee out &&\n+\tgrep \"not a commit\" out\n+'\n+\n+git update-ref -d refs/heads/invalid\n+\n+cat > invalid-tag <<EOF\n+object ffffffffffffffffffffffffffffffffffffffff\n+type commit\n+tag invalid\n+tagger T A Gger <tagger@example.com> 1234567890 -0000\n+\n+This is an invalid tag.\n+EOF\n+\n+test_expect_success 'tag pointing to nonexistent' '\n+\ttag=$(git hash-object -t tag -w --stdin < invalid-tag) &&\n+\techo $tag > .git/refs/tags/invalid &&\n+\ttest_must_fail git fsck >out 2>&1 &&\n+\tgrep \"missing commit ffffffffffffffffffffffffffffffffffffffff\" out\n+'\n+\n+rm .git/refs/tags/invalid\n+rm -f .git/objects/$(echo $tag | sed \"s#^..#&/#\")\n+\n+cat > wrong-tag <<EOF\n+object $(echo blob | git hash-object -w --stdin)\n+type commit\n+tag wrong\n+tagger T A Gger <tagger@example.com> 1234567890 -0000\n+\n+This is an invalid tag.\n+EOF\n+\n+test_expect_success 'tag pointing to something else than its type' '\n+\ttag=$(git hash-object -t tag -w --stdin < wrong-tag) &&\n+\techo $tag > .git/refs/tags/wrong &&\n+\ttest_must_fail git fsck >out 2>&1 &&\n+\tgrep \"Object.*is a blob, not a commit\" out\n+'\n+\n+rm .git/refs/tags/wrong\n+\n+\n test_done\n-- \n1.6.2.rc2.289.g2fa25\n"},{"id":"106774","messageId":"7v3advgj0l.fsf@gitster.siamese.dyndns.org","threadId":"17882","inReplyTo":"1235946763-15252-1-git-send-email-trast@student.ethz.ch","subject":"Re: [PATCH v5] Test fsck a bit harder","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-03T07:31:06Z","receivedAt":"2009-03-03T07:31:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Rast <trast@student.ethz.ch> writes:\n\n> Johannes Sixt wrote:\n>> This is wrong: It does not test the exist status. In a pipeline, the shell \n>> looks only at the exit status of the last command. You really want this as\n>> \n>>  \ttest_must_fail git fsck >out 2>&1 &&\n>\n> You're right.\n\nAnd you still write this after the lesson?\n\n> +test_expect_success 'branch pointing to non-commit' '\n> +\tgit rev-parse HEAD^{tree} > .git/refs/heads/invalid &&\n> +\tgit fsck 2>&1 | tee out &&\n> +\tgrep \"not a commit\" out\n> +'\n\n> +git update-ref -d refs/heads/invalid\n> +\n> +cat > invalid-tag <<EOF\n> +object ffffffffffffffffffffffffffffffffffffffff\n> +type commit\n> +tag invalid\n> +tagger T A Gger <tagger@example.com> 1234567890 -0000\n> +\n> +This is an invalid tag.\n> +EOF\n\nTechnically speaking, the tag is perfectly valid.  It just points to a\ncommit you do not have.\n\n> +cat > wrong-tag <<EOF\n> +object $(echo blob | git hash-object -w --stdin)\n> +type commit\n> +tag wrong\n> +tagger T A Gger <tagger@example.com> 1234567890 -0000\n> +\n> +This is an invalid tag.\n> +EOF\n\nThis is indeed invalid.\n\n> +test_expect_success 'tag pointing to something else than its type' '\n> +\ttag=$(git hash-object -t tag -w --stdin < wrong-tag) &&\n> +\techo $tag > .git/refs/tags/wrong &&\n> +\ttest_must_fail git fsck >out 2>&1 &&\n> +\tgrep \"Object.*is a blob, not a commit\" out\n> +'\n> +\n> +rm .git/refs/tags/wrong\n\nI'd rather want to see test_expect_success around this \"rm\", and replace\nthat rm with something more git-ish, like \"tag -d\" or \"update-ref -d\".\n\nBy the way, is it just me or would we want to reword the subject of the\ncommit to tame it a little bit?\n"}]}