diff options
| author | David Bremner <bremner@debian.org> | 2019-02-17 07:30:33 -0400 |
|---|---|---|
| committer | David Bremner <bremner@debian.org> | 2019-02-17 07:30:33 -0400 |
| commit | f7130468d27c4f37d45e6aa60baacfc3329ccff4 (patch) | |
| tree | f26a901f6e28185d60200c9111de30e1c15b4996 /test | |
Import notmuch_0.28.2.orig.tar.gz
[dgit import orig notmuch_0.28.2.orig.tar.gz]
Diffstat (limited to 'test')
433 files changed, 41806 insertions, 0 deletions
diff --git a/test/.gitignore b/test/.gitignore new file mode 100644 index 00000000..73fe7e24 --- /dev/null +++ b/test/.gitignore @@ -0,0 +1,11 @@ +/arg-test +/corpora.mail +/hex-xcode +/parse-time +/random-corpus +/smtp-dummy +/symbol-test +/make-db-version +/test-results +/ghost-report +/tmp.* diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 00000000..de492a7c --- /dev/null +++ b/test/Makefile @@ -0,0 +1,7 @@ +# See Makefile.local for the list of files to be compiled in this +# directory. +all: + $(MAKE) -C .. all + +.DEFAULT: + $(MAKE) -C .. $@ diff --git a/test/Makefile.local b/test/Makefile.local new file mode 100644 index 00000000..1cf09778 --- /dev/null +++ b/test/Makefile.local @@ -0,0 +1,84 @@ +# -*- makefile -*- + +dir := test + +# save against changes in $(dir) +test_src_dir := $(dir) +extra_cflags += -I$(srcdir) + +smtp_dummy_srcs = \ + $(notmuch_compat_srcs) \ + $(dir)/smtp-dummy.c + +smtp_dummy_modules = $(smtp_dummy_srcs:.c=.o) + +$(dir)/arg-test: $(dir)/arg-test.o command-line-arguments.o util/libnotmuch_util.a + $(call quiet,CC) $^ -o $@ $(LDFLAGS) + +$(dir)/message-id-parse: $(dir)/message-id-parse.o lib/libnotmuch.a util/libnotmuch_util.a + $(call quiet,CC) $^ -o $@ $(LDFLAGS) $(TALLOC_LDFLAGS) + +$(dir)/hex-xcode: $(dir)/hex-xcode.o command-line-arguments.o util/libnotmuch_util.a + $(call quiet,CC) $^ -o $@ $(LDFLAGS) $(TALLOC_LDFLAGS) + +random_corpus_deps = $(dir)/random-corpus.o $(dir)/database-test.o \ + notmuch-config.o status.o command-line-arguments.o \ + lib/libnotmuch.a util/libnotmuch_util.a \ + parse-time-string/libparse-time-string.a + +$(dir)/random-corpus: $(random_corpus_deps) + $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(CONFIGURE_LDFLAGS) + +$(dir)/smtp-dummy: $(smtp_dummy_modules) + $(call quiet,CC) $^ -o $@ $(LDFLAGS) + +$(dir)/symbol-test: $(dir)/symbol-test.o lib/$(LINKER_NAME) + $(call quiet,CXX) $^ -o $@ $(LDFLAGS) -Llib -lnotmuch $(XAPIAN_LDFLAGS) + +$(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o + $(call quiet,CC) $^ -o $@ $(LDFLAGS) + +$(dir)/make-db-version: $(dir)/make-db-version.o + $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS) + +$(dir)/ghost-report: $(dir)/ghost-report.o + $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS) + +.PHONY: test check + +test_main_srcs=$(dir)/arg-test.c \ + $(dir)/hex-xcode.c \ + $(dir)/random-corpus.c \ + $(dir)/parse-time.c \ + $(dir)/smtp-dummy.c \ + $(dir)/symbol-test.cc \ + $(dir)/make-db-version.cc \ + $(dir)/ghost-report.cc \ + $(dir)/message-id-parse.c + +test_srcs=$(test_main_srcs) $(dir)/database-test.c + +TEST_BINARIES := $(test_main_srcs:.c=) +TEST_BINARIES := $(TEST_BINARIES:.cc=) + +test-binaries: $(TEST_BINARIES) + +test: all test-binaries +ifeq ($V,) + @echo 'Use "$(MAKE) V=1" to see the details for passing and known broken tests.' + @env NOTMUCH_TEST_QUIET=1 $(NOTMUCH_SRCDIR)/$(test_src_dir)/notmuch-test $(OPTIONS) +else +# The user has explicitly enabled quiet execution. +ifeq ($V,0) + @env NOTMUCH_TEST_QUIET=1 $(NOTMUCH_SRCDIR)/$(test_src_dir)/notmuch-test $(OPTIONS) +else + @$(NOTMUCH_SRCDIR)/$(test_src_dir)/notmuch-test $(OPTIONS) +endif +endif + +check: test + +SRCS := $(SRCS) $(test_srcs) +CLEAN += $(TEST_BINARIES) $(addsuffix .o,$(TEST_BINARIES)) \ + $(dir)/database-test.o \ + $(dir)/corpora.mail $(dir)/test-results $(dir)/tmp.* diff --git a/test/README b/test/README new file mode 100644 index 00000000..b378c3ff --- /dev/null +++ b/test/README @@ -0,0 +1,324 @@ +Notmuch test suite +================== +This directory contains the test suite for notmuch. + +When fixing bugs or enhancing notmuch, you are strongly encouraged to +add tests in this directory to cover what you are trying to fix or +enhance. + +Prerequisites +------------- +The test system itself requires: + + - bash(1) version 4.0 or newer + +Without bash 4.0+ the tests just refuse to run. + +Some tests require external dependencies to run. Without them, they +will be skipped, or (rarely) marked failed. Please install these, so +that you know if you break anything. + + - GNU tar(1) + - dtach(1) + - emacs(1) + - emacsclient(1) + - gdb(1) + - gpg(1) + - python(1) + +If your system lacks these tools or have older, non-upgradable versions +of these, please (possibly compile and) install these to some other +path, for example /usr/local/bin or /opt/gnu/bin. Then prepend the +chosen directory to your PATH before running the tests. + +e.g. env PATH=/opt/gnu/bin:$PATH make test + +For FreeBSD you need to install latest gdb from ports or packages and +provide path to it in TEST_GDB environment variable before executing +the tests, native FreeBSD gdb does not not work. If you install +coreutils, which provides GNU versions of basic utils like 'date' and +'base64' on FreeBSD, the test suite will use these instead of the +native ones. This provides robustness against portability issues with +these system tools. Most often the tests are written, reviewed and +tested on Linux system so such portability issues arise from time to +time. + + +Running Tests +------------- +The easiest way to run tests is to say "make test", (or simply run the +notmuch-test script). Either command will run all available tests. + +Alternately, you can run a specific subset of tests by simply invoking +one of the executable scripts in this directory, (such as ./T*-search.sh, +./T*-reply.sh, etc). Note that you will probably want "make test-binaries" +before running individual tests. + +The following command-line options are available when running tests: + +--debug:: + This may help the person who is developing a new test. + It causes the command defined with test_debug to run. + +--immediate:: + This causes the test to immediately exit upon the first + failed test. + +--valgrind:: + Execute notmuch with valgrind and exit with status + 126 on errors (just like regular tests, this will only stop + the test script when running under -i). Valgrind errors + go to stderr, so you might want to pass the -v option, too. + + Since it makes no sense to run the tests with --valgrind and + not see any output, this option implies --verbose. For + convenience, it also implies --tee. + +--tee:: + In addition to printing the test output to the terminal, + write it to files named 't/test-results/$TEST_NAME.out'. + As the names depend on the tests' file names, it is safe to + run the tests with this option in parallel. + +Certain tests require precomputed databases to complete. You can fetch these +databases with + + make download-test-databases + +If you do not download the test databases, the relevant tests will be +skipped. + +When invoking the test suite via "make test" any of the above options +can be specified as follows: + + make test OPTIONS="--verbose" + +You can choose an emacs binary (and corresponding emacsclient) to run +the tests in one of the following ways. + + TEST_EMACS=my-emacs TEST_EMACSCLIENT=my-emacsclient make test + TEST_EMACS=my-emacs TEST_EMACSCLIENT=my-emacsclient ./T*-emacs.sh + make test TEST_EMACS=my-emacs TEST_EMACSCLIENT=my-emacsclient + +Some tests may require a c compiler. You can choose the name and flags similarly +to with emacs, e.g. + + make test TEST_CC=gcc TEST_CFLAGS="-g -O2" + +Quiet Execution +--------------- + +Normally, when new script starts and when test PASSes you get a message +printed on screen. This printing can be disabled by setting the +NOTMUCH_TEST_QUIET variable to a non-null value. Message on test +failures and skips are still printed. + +Skipping Tests +-------------- +If, for any reason, you need to skip one or more tests, you can do so +by setting the NOTMUCH_SKIP_TESTS variable to the name of one or more +sections of tests. + +For example: + + $ NOTMUCH_SKIP_TESTS="search reply" make test + +Even more fine-grained skipping is possible by appending a test number +(or glob pattern) after the section name. For example, the first +search test and the second reply test could be skipped with: + + $ NOTMUCH_SKIP_TESTS="search.1 reply.2" make test + +Note that some tests in the existing test suite rely on previous test +items, so you cannot arbitrarily skip any test and expect the +remaining tests to be unaffected. + +Currently we do not consider skipped tests as build failures. For +maximum robustness, when setting up automated build processes, you +should explicitly skip tests, rather than relying on notmuch's +detection of missing prerequisites. In the future we may treat tests +unable to run because of missing prerequisites, but not explicitly +skipped by the user, as failures. + +Writing Tests +------------- +The test script is written as a shell script. It is to be named as +Tddd-testname.sh where 'ddd' is three digits and 'testname' the "bare" +name of your test. Tests will be run in order the 'ddd' part determines. + +The test script should start with the standard "#!/usr/bin/env bash" +and an assignment to variable 'test_description', like this: + + #!/usr/bin/env bash + + test_description='xxx test (option --frotz) + + This test exercises the "notmuch xxx" command when + given the option --frotz.' + +Source 'test-lib.sh' +-------------------- +After assigning test_description, the test script should source +test-lib.sh like this: + + . ./test-lib.sh || exit 1 + +This test harness library does the following things: + + - If the script is invoked with command line argument --help + (or -h), it shows the test_description and exits. + + - Creates a temporary directory with default notmuch-config and a + mail store with a corpus of mail, (initially, 50 early messages + sent to the notmuch list). This directory is + test/tmp.<test-basename>. The path to notmuch-config is exported in + NOTMUCH_CONFIG environment variable and mail store path is stored + in MAIL_DIR variable. + + - Defines standard test helper functions for your scripts to + use. These functions are designed to make all scripts behave + consistently when command line arguments --verbose (or -v), + --debug (or -d), and --immediate (or -i) is given. + +End with test_done +------------------ +Your script will be a sequence of tests, using helper functions +from the test harness library. At the end of the script, call +'test_done'. + +Test harness library +-------------------- +There are a handful helper functions defined in the test harness +library for your script to use. + + test_begin_subtest <message> + + Set the test description message for a subsequent test_expect_* + invocation (see below). + + test_expect_success <script> + + This takes a string as parameter, and evaluates the + <script>. If it yields success, test is considered + successful. + + test_expect_code <code> <script> + + This takes two strings as parameter, and evaluates the <script>. + If it yields <code> exit status, test is considered successful. + + test_subtest_known_broken + + Mark the current test as broken. Such tests are expected to fail. + Unlike the normal tests, which say "PASS" on success and "FAIL" on + failure, these will say "FIXED" on success and "BROKEN" on failure. + Failures from these tests won't cause -i (immediate) to stop. A + test must call this before any test_expect_* function. + + test_expect_equal <output> <expected> + + This is an often-used convenience function built on top of + test_expect_success. It uses the message from the last + test_begin_subtest call, so call before calling + test_expect_equal. This function generates a successful test if + both the <output> and <expected> strings are identical. If not, it + will generate a failure and print the difference of the two + strings. + + test_expect_equal_file <file1> <file2> + + Identical to test_expect_equal, except that <file1> and <file2> + are files instead of strings. This is a much more robust method to + compare formatted textual information, since it also notices + whitespace and closing newline differences. + + test_expect_equal_json <output> <expected> + + Identical to test_expect_equal, except that the two strings are + treated as JSON and canonicalized before equality testing. This is + useful to abstract away from whitespace differences in the expected + output and that generated by running a notmuch command. + + test_debug <script> + + This takes a single argument, <script>, and evaluates it only + when the test script is started with --debug command line + argument. This is primarily meant for use during the + development of a new test script. + + test_emacs <emacs-lisp-expressions> + + This function executes the provided emacs lisp script within + emacs. The script can be a sequence of emacs lisp expressions, + (that is, they will be evaluated within a progn form). Emacs + stdout and stderr is not available, the common way to get output + is to save it to a file. There are some auxiliary functions + useful in emacs tests provided in test-lib.el. Do not use `setq' + for setting variables in Emacs tests because it affects other + tests that may run in the same Emacs instance. Use `let' instead + so the scope of the changed variables is limited to a single test. + + test_emacs_expect_t <emacs-lisp-expressions> + + This function executes the provided emacs lisp script within + emacs in a manner similar to 'test_emacs'. The expressions should + return the value `t' to indicate that the test has passed. If the + test does not return `t' then it is considered failed and all data + returned by the test is reported to the tester. + + test_done + + Your test script must have test_done at the end. Its purpose + is to summarize successes and failures in the test script and + exit with an appropriate error code. + +There are also a number of notmuch-specific auxiliary functions and +variables which are useful in writing tests: + + generate_message + + Generates a message with an optional template. Most tests will + actually prefer to call add_message. See below. + + add_message + + Generate a message and add it to the database (by calling "notmuch + new"). It is sufficient to simply call add_message with no + arguments if you don't care about the content of the message. If + more control is needed, arguments can be provide to specify many + different header values for the new message. See the documentation + within test-lib.sh or refer to many example calls within existing + tests. + + add_email_corpus + + This function should be called at the beginning of a test file + when a test needs to operate on a non-empty body of messages. It + will initialize the mail database to a known state of 50 sample + messages, (culled from the early history of the notmuch mailing + list). + + notmuch_counter_reset + $notmuch_counter_command + notmuch_counter_value + + These allow to count how many times notmuch binary is called. + notmuch_counter_reset() function generates a script that counts + how many times it is called and resets the counter to zero. The + function sets $notmuch_counter_command variable to the path to the + generated script that should be called instead of notmuch to do + the counting. The notmuch_counter_value() function prints the + current counter value. + +There are also functions which remove various environment-dependent +values from notmuch output; these are useful to ensure that test +results remain consistent across different machines. + + notmuch_search_sanitize + notmuch_show_sanitize + notmuch_show_sanitize_all + notmuch_json_show_sanitize + + All these functions should receive the text to be sanitized as the + input of a pipe, e.g. + output=`notmuch search "..." | notmuch_search_sanitize` diff --git a/test/T000-basic.sh b/test/T000-basic.sh new file mode 100755 index 00000000..7fbdcfa3 --- /dev/null +++ b/test/T000-basic.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2005 Junio C Hamano +# + +test_description='the test framework itself.' +. $(dirname "$0")/test-lib.sh || exit 1 + +################################################################ +# Test harness +test_begin_subtest 'success is reported like this' +test_expect_success ':' + +test_begin_subtest 'test runs if prerequisite is satisfied' +test_set_prereq HAVEIT +test_expect_success 'test_have_prereq HAVEIT' + +test_begin_subtest 'tests clean up after themselves' +clean=no +test_expect_success 'test_when_finished clean=yes' + +test_begin_subtest 'tests clean up even after a failure' +cleaner=no +test_expect_code 1 'test_when_finished cleaner=yes && (exit 1)' + +if test $clean$cleaner != yesyes +then + say "bug in test framework: cleanup commands do not work reliably" + exit 1 +fi + +test_begin_subtest 'failure to clean up causes the test to fail' +test_expect_code 2 'test_when_finished "(exit 2)"' + +EXPECTED=$NOTMUCH_SRCDIR/test/test.expected-output +suppress_diff_date() { + sed -e 's/\(.*\-\-\- test-verbose\.4\.\expected\).*/\1/' \ + -e 's/\(.*\+\+\+ test-verbose\.4\.\output\).*/\1/' +} + +test_begin_subtest "Ensure that test output is suppressed unless the test fails" +output=$(cd $TEST_DIRECTORY; NOTMUCH_TEST_QUIET= $NOTMUCH_SRCDIR/test/test-verbose 2>&1 | suppress_diff_date) +expected=$(cat $EXPECTED/test-verbose-no | suppress_diff_date) +test_expect_equal "$output" "$expected" + +test_begin_subtest "Ensure that -v does not suppress test output" +output=$(cd $TEST_DIRECTORY; NOTMUCH_TEST_QUIET= $NOTMUCH_SRCDIR/test/test-verbose -v 2>&1 | suppress_diff_date) +expected=$(cat $EXPECTED/test-verbose-yes | suppress_diff_date) +# Do not include the results of test-verbose in totals +rm $TEST_DIRECTORY/test-results/test-verbose +rm -r $TEST_DIRECTORY/tmp.test-verbose +test_expect_equal "$output" "$expected" + + +################################################################ +# Test mail store prepared in test-lib.sh + +test_begin_subtest 'test that mail store was created' +test_expect_success 'test -d "${MAIL_DIR}"' + +test_begin_subtest 'mail store should be empty' +find "${MAIL_DIR}" -type f -print >should-be-empty +test_expect_success 'cmp -s /dev/null should-be-empty' + +test_begin_subtest 'NOTMUCH_CONFIG is set and points to an existing file' +test_expect_success 'test -f "${NOTMUCH_CONFIG}"' + +test_begin_subtest 'PATH is set to build directory' +test_expect_equal \ + "$(dirname ${TEST_DIRECTORY})" \ + "$(echo $PATH|cut -f1 -d: | sed -e 's,/test/valgrind/bin$,,')" + +test_begin_subtest 'notmuch is compiled with debugging symbols' +readelf --sections $(command -v notmuch) | grep \.debug +test_expect_equal 0 $? + +test_done diff --git a/test/T010-help-test.sh b/test/T010-help-test.sh new file mode 100755 index 00000000..da45d3ae --- /dev/null +++ b/test/T010-help-test.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +test_description="online help" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest 'notmuch --help' +test_expect_success 'notmuch --help' + +test_begin_subtest 'notmuch help' +test_expect_success 'notmuch help' + +test_begin_subtest 'notmuch --version' +test_expect_success 'notmuch --version' + +if [ $NOTMUCH_HAVE_MAN -eq 1 ]; then + test_begin_subtest 'notmuch --help tag' + test_expect_success 'notmuch --help tag' + + test_begin_subtest 'notmuch help tag' + test_expect_success 'notmuch help tag' +else + test_begin_subtest 'notmuch --help tag (man pages not available)' + test_expect_success 'test_must_fail notmuch --help tag >/dev/null' + + test_begin_subtest 'notmuch help tag (man pages not available)' + test_expect_success 'test_must_fail notmuch help tag >/dev/null' +fi + +test_done diff --git a/test/T020-compact.sh b/test/T020-compact.sh new file mode 100755 index 00000000..58cd2ba7 --- /dev/null +++ b/test/T020-compact.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +test_description='"notmuch compact"' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_message '[subject]=One' +add_message '[subject]=Two' +add_message '[subject]=Three' + +notmuch tag +tag1 \* +notmuch tag +tag2 subject:Two +notmuch tag -tag1 +tag3 subject:Three + +if [ $NOTMUCH_HAVE_XAPIAN_COMPACT -eq 0 ]; then + test_begin_subtest "Compact unsupported: error message" + output=$(notmuch compact --quiet 2>&1) + test_expect_equal "$output" "notmuch was compiled against a xapian version lacking compaction support. +Compaction failed: Unsupported operation" + + test_begin_subtest "Compact unsupported: status code" + test_expect_code 1 "notmuch compact" + + test_done +fi + +test_begin_subtest "Running compact" +test_expect_success "notmuch compact --backup=${TEST_DIRECTORY}/xapian.old" + +test_begin_subtest "Compact preserves database" +output=$(notmuch search \* | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 tag2 unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Three (inbox tag3 unread)" + +test_begin_subtest "Restoring Backup" +test_expect_success 'rm -Rf ${MAIL_DIR}/.notmuch/xapian && + mv ${TEST_DIRECTORY}/xapian.old ${MAIL_DIR}/.notmuch/xapian' + +test_begin_subtest "Checking restored backup" +output=$(notmuch search \* | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 tag2 unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Three (inbox tag3 unread)" + +test_done diff --git a/test/T030-config.sh b/test/T030-config.sh new file mode 100755 index 00000000..f36695c6 --- /dev/null +++ b/test/T030-config.sh @@ -0,0 +1,112 @@ +#!/usr/bin/env bash + +test_description='"notmuch config"' +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Get string value" +test_expect_equal "$(notmuch config get user.name)" "Notmuch Test Suite" + +test_begin_subtest "Get list value" +test_expect_equal "$(notmuch config get new.tags)" "\ +unread +inbox" + +test_begin_subtest "Set string value" +notmuch config set foo.string "this is a string value" +test_expect_equal "$(notmuch config get foo.string)" "this is a string value" + +test_begin_subtest "Set string value again" +notmuch config set foo.string "this is another string value" +test_expect_equal "$(notmuch config get foo.string)" "this is another string value" + +test_begin_subtest "Set list value" +notmuch config set foo.list this "is a" "list value" +test_expect_equal "$(notmuch config get foo.list)" "\ +this +is a +list value" + +test_begin_subtest "Set list value again" +notmuch config set foo.list this "is another" "list value" +test_expect_equal "$(notmuch config get foo.list)" "\ +this +is another +list value" + +test_begin_subtest "Remove key" +notmuch config set foo.remove baz +notmuch config set foo.remove +test_expect_equal "$(notmuch config get foo.remove)" "" + +test_begin_subtest "Remove non-existent key" +notmuch config set foo.nonexistent +test_expect_equal "$(notmuch config get foo.nonexistent)" "" + +test_begin_subtest "List all items" +notmuch config list 2>&1 | notmuch_config_sanitize > OUTPUT + +if [ "${NOTMUCH_GMIME_MAJOR}" -lt 3 ]; then + config_gpg_path="crypto.gpg_path=gpg +" +fi + +cat <<EOF > EXPECTED +Error opening database at MAIL_DIR/.notmuch: No such file or directory +database.path=MAIL_DIR +user.name=Notmuch Test Suite +user.primary_email=test_suite@notmuchmail.org +user.other_email=test_suite_other@notmuchmail.org;test_suite@otherdomain.org +new.tags=unread;inbox; +new.ignore= +search.exclude_tags= +maildir.synchronize_flags=true +${config_gpg_path}foo.string=this is another string value +foo.list=this;is another;list value; +built_with.compact=something +built_with.field_processor=something +built_with.retry_lock=something +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Top level --config=FILE option" +cp "${NOTMUCH_CONFIG}" alt-config +notmuch --config=alt-config config set user.name "Another Name" +test_expect_equal "$(notmuch --config=alt-config config get user.name)" \ + "Another Name" + +test_begin_subtest "Top level --config:FILE option" +test_expect_equal "$(notmuch --config:alt-config config get user.name)" \ + "Another Name" + +test_begin_subtest "Top level --config<space>FILE option" +test_expect_equal "$(notmuch --config alt-config config get user.name)" \ + "Another Name" + +test_begin_subtest "Top level --config=FILE option changed the right file" +test_expect_equal "$(notmuch config get user.name)" \ + "Notmuch Test Suite" + +test_begin_subtest "Read config file through a symlink" +ln -s alt-config alt-config-link +test_expect_equal "$(notmuch --config=alt-config-link config get user.name)" \ + "Another Name" + +test_begin_subtest "Write config file through a symlink" +notmuch --config=alt-config-link config set user.name "Link Name" +test_expect_equal "$(notmuch --config=alt-config-link config get user.name)" \ + "Link Name" + +test_begin_subtest "Writing config file through symlink follows symlink" +test_expect_equal "$(readlink alt-config-link)" "alt-config" + +test_begin_subtest "Absolute database path returned" +notmuch config set database.path ${HOME}/Maildir +test_expect_equal "$(notmuch config get database.path)" \ + "${HOME}/Maildir" + +test_begin_subtest "Relative database path properly expanded" +notmuch config set database.path Maildir +test_expect_equal "$(notmuch config get database.path)" \ + "${HOME}/Maildir" + +test_done diff --git a/test/T040-setup.sh b/test/T040-setup.sh new file mode 100755 index 00000000..56efe1d5 --- /dev/null +++ b/test/T040-setup.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +test_description='"notmuch setup"' +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Notmuch new without a config suggests notmuch setup" +output=$(notmuch --config=new-notmuch-config new 2>&1) +test_expect_equal "$output" "\ +Configuration file new-notmuch-config not found. +Try running 'notmuch setup' to create a configuration." + +test_begin_subtest "Create a new config interactively" +notmuch --config=new-notmuch-config > /dev/null <<EOF +Test Suite +test.suite@example.com +another.suite@example.com + +/path/to/maildir +foo bar +baz +EOF + +if [ "${NOTMUCH_GMIME_MAJOR}" -lt 3 ]; then + config_gpg_path="crypto.gpg_path=gpg +" +fi + +output=$(notmuch --config=new-notmuch-config config list | notmuch_built_with_sanitize) +test_expect_equal "$output" "\ +database.path=/path/to/maildir +user.name=Test Suite +user.primary_email=test.suite@example.com +user.other_email=another.suite@example.com; +new.tags=foo;bar; +new.ignore= +search.exclude_tags=baz; +maildir.synchronize_flags=true +""${config_gpg_path}""\ +built_with.compact=something +built_with.field_processor=something +built_with.retry_lock=something" + +test_done diff --git a/test/T050-new.sh b/test/T050-new.sh new file mode 100755 index 00000000..dfc8508f --- /dev/null +++ b/test/T050-new.sh @@ -0,0 +1,396 @@ +#!/usr/bin/env bash +test_description='"notmuch new" in several variations' +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "No new messages" +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "No new mail." + + +test_begin_subtest "Single new message" +generate_message +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Single message (full-scan)" +generate_message +output=$(NOTMUCH_NEW --debug --full-scan 2>&1) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Multiple new messages" +generate_message +generate_message +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "Added 2 new messages to the database." + +test_begin_subtest "Multiple new messages (full-scan)" +generate_message +generate_message +output=$(NOTMUCH_NEW --debug --full-scan 2>&1) +test_expect_equal "$output" "Added 2 new messages to the database." + +test_begin_subtest "No new messages (non-empty DB)" +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "No new mail." + +test_begin_subtest "No new messages (full-scan)" +output=$(NOTMUCH_NEW --debug --full-scan 2>&1) +test_expect_equal "$output" "No new mail." + +test_begin_subtest "New directories" +rm -rf "${MAIL_DIR}"/* "${MAIL_DIR}"/.notmuch +mkdir "${MAIL_DIR}"/def +mkdir "${MAIL_DIR}"/ghi +generate_message [dir]=def + +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "Added 1 new message to the database." + + +test_begin_subtest "Alternate inode order" + +rm -rf "${MAIL_DIR}"/.notmuch +mv "${MAIL_DIR}"/ghi "${MAIL_DIR}"/abc +rm "${MAIL_DIR}"/def/* +generate_message [dir]=abc + +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "Added 1 new message to the database." + + +test_begin_subtest "Message moved in" +rm -rf "${MAIL_DIR}"/* "${MAIL_DIR}"/.notmuch +generate_message +tmp_msg_filename=tmp/"$gen_msg_filename" +mkdir -p "$(dirname "$tmp_msg_filename")" +mv "$gen_msg_filename" "$tmp_msg_filename" +notmuch new > /dev/null +mv "$tmp_msg_filename" "$gen_msg_filename" +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "Added 1 new message to the database." + + +test_begin_subtest "Renamed message" + +generate_message +notmuch new > /dev/null +mv "$gen_msg_filename" "${gen_msg_filename}"-renamed +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "(D) add_files, pass 2: queuing passed file ${gen_msg_filename} for deletion from database +No new mail. Detected 1 file rename." + + +test_begin_subtest "Deleted message" + +rm "${gen_msg_filename}"-renamed +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "(D) add_files, pass 3: queuing leftover file ${gen_msg_filename}-renamed for deletion from database +No new mail. Removed 1 message." + + + +test_begin_subtest "Renamed directory" + +generate_message [dir]=dir +generate_message [dir]=dir +generate_message [dir]=dir + +notmuch new > /dev/null + +mv "${MAIL_DIR}"/dir "${MAIL_DIR}"/dir-renamed + +output=$(NOTMUCH_NEW --debug --full-scan) +test_expect_equal "$output" "(D) add_files, pass 2: queuing passed directory ${MAIL_DIR}/dir for deletion from database +No new mail. Detected 3 file renames." + + +test_begin_subtest "Deleted directory" +rm -rf "${MAIL_DIR}"/dir-renamed + +output=$(NOTMUCH_NEW --debug --full-scan) +test_expect_equal "$output" "(D) add_files, pass 2: queuing passed directory ${MAIL_DIR}/dir-renamed for deletion from database +No new mail. Removed 3 messages." + + +test_begin_subtest "New directory (at end of list)" + +generate_message [dir]=zzz +generate_message [dir]=zzz +generate_message [dir]=zzz + +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "Added 3 new messages to the database." + + +test_begin_subtest "Deleted directory (end of list)" + +rm -rf "${MAIL_DIR}"/zzz + +output=$(NOTMUCH_NEW --debug --full-scan) +test_expect_equal "$output" "(D) add_files, pass 3: queuing leftover directory ${MAIL_DIR}/zzz for deletion from database +No new mail. Removed 3 messages." + + +test_begin_subtest "New symlink to directory" + +rm -rf "${MAIL_DIR}"/.notmuch +mv "${MAIL_DIR}" "${TMP_DIRECTORY}"/actual_maildir + +mkdir "${MAIL_DIR}" +ln -s "${TMP_DIRECTORY}"/actual_maildir "${MAIL_DIR}"/symlink + +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "Added 1 new message to the database." + + +test_begin_subtest "New symlink to a file" +generate_message +external_msg_filename="${TMP_DIRECTORY}"/external/"$(basename "$gen_msg_filename")" +mkdir -p "$(dirname "$external_msg_filename")" +mv "$gen_msg_filename" "$external_msg_filename" +ln -s "$external_msg_filename" "$gen_msg_filename" +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "Added 1 new message to the database." + + +test_begin_subtest "Broken symlink aborts" +ln -s does-not-exist "${MAIL_DIR}/broken" +output=$(NOTMUCH_NEW --debug 2>&1) +test_expect_equal "$output" \ +"Error reading file ${MAIL_DIR}/broken: No such file or directory +Note: A fatal error was encountered: Something went wrong trying to read or write a file +No new mail." +rm "${MAIL_DIR}/broken" + + +test_begin_subtest "New two-level directory" + +generate_message [dir]=two/levels +generate_message [dir]=two/levels +generate_message [dir]=two/levels + +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "Added 3 new messages to the database." + + +test_begin_subtest "Deleted two-level directory" + +rm -rf "${MAIL_DIR}"/two + +output=$(NOTMUCH_NEW --debug --full-scan) +test_expect_equal "$output" "(D) add_files, pass 3: queuing leftover directory ${MAIL_DIR}/two for deletion from database +No new mail. Removed 3 messages." + +test_begin_subtest "One character directory at top level" + +generate_message [dir]=A +generate_message [dir]=A/B +generate_message [dir]=A/B/C + +output=$(NOTMUCH_NEW --debug) +test_expect_equal "$output" "Added 3 new messages to the database." + +test_begin_subtest "Support single-message mbox" +cat > "${MAIL_DIR}"/mbox_file1 <<EOF +From test_suite@notmuchmail.org Fri Jan 5 15:43:57 2001 +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Test mbox message 1 + +Body. +EOF +output=$(NOTMUCH_NEW --debug 2>&1) +test_expect_equal "$output" "Added 1 new message to the database." + +# This test requires that notmuch new has been run at least once. +test_begin_subtest "Skip and report non-mail files" +generate_message +mkdir -p "${MAIL_DIR}"/.git && touch "${MAIL_DIR}"/.git/config +touch "${MAIL_DIR}"/ignored_file +touch "${MAIL_DIR}"/.ignored_hidden_file +cat > "${MAIL_DIR}"/mbox_file <<EOF +From test_suite@notmuchmail.org Fri Jan 5 15:43:57 2001 +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Test mbox message 1 + +Body. + +From test_suite@notmuchmail.org Fri Jan 5 15:43:57 2001 +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Test mbox message 2 + +Body 2. +EOF +output=$(NOTMUCH_NEW --debug --full-scan 2>&1) +test_expect_equal "$output" \ +"Note: Ignoring non-mail file: ${MAIL_DIR}/.git/config +Note: Ignoring non-mail file: ${MAIL_DIR}/.ignored_hidden_file +Note: Ignoring non-mail file: ${MAIL_DIR}/ignored_file +Note: Ignoring non-mail file: ${MAIL_DIR}/mbox_file +Added 1 new message to the database." +rm "${MAIL_DIR}"/mbox_file + +test_begin_subtest "Ignore files and directories specified in new.ignore" +generate_message +notmuch config set new.ignore .git ignored_file .ignored_hidden_file +touch "${MAIL_DIR}"/.git # change .git's mtime for notmuch new to rescan. +NOTMUCH_NEW --debug 2>&1 | sort > OUTPUT +cat <<EOF > EXPECTED +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/.git +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/.ignored_hidden_file +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/ignored_file +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/.git +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/.ignored_hidden_file +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/ignored_file +Added 1 new message to the database. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Ignore files and directories specified in new.ignore (full-scan)" +generate_message +notmuch config set new.ignore .git ignored_file .ignored_hidden_file +NOTMUCH_NEW --debug --full-scan 2>&1 | sort > OUTPUT +# reuse EXPECTED from previous test +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Ignore files and directories specified in new.ignore (multiple occurrences)" +notmuch config set new.ignore .git ignored_file .ignored_hidden_file +notmuch new > /dev/null # ensure that files/folders will be printed in ASCII order. +mkdir -p "${MAIL_DIR}"/one/two/three/.git +touch "${MAIL_DIR}"/{one,one/two,one/two/three}/ignored_file +output=$(NOTMUCH_NEW --debug --full-scan 2>&1 | sort) +test_expect_equal "$output" \ +"(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/.git +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/.ignored_hidden_file +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/ignored_file +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/one/ignored_file +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/one/two/ignored_file +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/one/two/three/.git +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/one/two/three/ignored_file +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/.git +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/.ignored_hidden_file +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/ignored_file +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/one/ignored_file +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/ignored_file +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/.git +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/ignored_file +No new mail." + + +test_begin_subtest "Don't stop for ignored broken symlinks" +notmuch config set new.ignore .git ignored_file .ignored_hidden_file broken_link +ln -s i_do_not_exist "${MAIL_DIR}"/broken_link +output=$(NOTMUCH_NEW 2>&1) +test_expect_equal "$output" "No new mail." + +test_begin_subtest "Ignore files and directories specified in new.ignore (regexp)" +notmuch config set new.ignore ".git" "/^bro.*ink\$/" "/ignored.*file/" +output=$(NOTMUCH_NEW --debug --full-scan 2>&1 | sort) +test_expect_equal "$output" \ +"(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/.git +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/.ignored_hidden_file +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/broken_link +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/ignored_file +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/one/ignored_file +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/one/two/ignored_file +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/one/two/three/.git +(D) add_files, pass 1: explicitly ignoring ${MAIL_DIR}/one/two/three/ignored_file +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/.git +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/.ignored_hidden_file +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/broken_link +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/ignored_file +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/one/ignored_file +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/ignored_file +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/.git +(D) add_files, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/ignored_file +No new mail." + +test_begin_subtest "Quiet: No new mail." +output=$(NOTMUCH_NEW --quiet) +test_expect_equal "$output" "" + +test_begin_subtest "Quiet: new, removed and renamed messages." +# new +generate_message +# deleted +notmuch search --format=text0 --output=files --limit=1 '*' | xargs -0 rm +# moved +mkdir "${MAIL_DIR}"/moved_messages +notmuch search --format=text0 --output=files --offset=1 --limit=1 '*' | xargs -0 -I {} mv {} "${MAIL_DIR}"/moved_messages +output=$(NOTMUCH_NEW --quiet) +test_expect_equal "$output" "" + +OLDCONFIG=$(notmuch config get new.tags) + +test_begin_subtest "Empty tags in new.tags are forbidden" +notmuch config set new.tags "foo;;bar" +output=$(NOTMUCH_NEW --debug 2>&1) +test_expect_equal "$output" "Error: tag '' in new.tags: empty tag forbidden" + +test_begin_subtest "Tags starting with '-' in new.tags are forbidden" +notmuch config set new.tags "-foo;bar" +output=$(NOTMUCH_NEW --debug 2>&1) +test_expect_equal "$output" "Error: tag '-foo' in new.tags: tag starting with '-' forbidden" + +test_begin_subtest "Invalid tags set exit code" +test_expect_code 1 "NOTMUCH_NEW --debug 2>&1" + +notmuch config set new.tags $OLDCONFIG + + +test_begin_subtest "Xapian exception: read only files" +chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.${db_ending} +output=$(NOTMUCH_NEW --debug 2>&1 | sed 's/: .*$//' ) +chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.${db_ending} +test_expect_equal "$output" "A Xapian exception occurred opening database" + + +test_begin_subtest "Handle files vanishing between scandir and add_file" + +# A file for scandir to find. It won't get indexed, so can be empty. +touch ${MAIL_DIR}/vanish + +# Breakpoint to remove the file before indexing +cat <<EOF > notmuch-new-vanish.gdb +set breakpoint pending on +set logging file notmuch-new-vanish-gdb.log +set logging on +break notmuch_database_index_file +commands +shell rm -f ${MAIL_DIR}/vanish +continue +end +run +EOF + +${TEST_GDB} --batch-silent --return-child-result -x notmuch-new-vanish.gdb \ + --args notmuch new 2>OUTPUT 1>/dev/null +echo "exit status: $?" >> OUTPUT + +# Clean up the file in case gdb isn't available. +rm -f ${MAIL_DIR}/vanish + +cat <<EOF > EXPECTED +Unexpected error with file ${MAIL_DIR}/vanish +add_file: Something went wrong trying to read or write a file +Error opening ${MAIL_DIR}/vanish: No such file or directory +exit status: 75 +EOF +test_expect_equal_file EXPECTED OUTPUT + +add_email_corpus broken +test_begin_subtest "reference loop does not crash" +test_expect_code 0 "notmuch show --format=json id:mid-loop-12@example.org id:mid-loop-21@example.org > OUTPUT" + +test_begin_subtest "reference loop ordered by date" +threadid=$(notmuch search --output=threads id:mid-loop-12@example.org) +notmuch show --format=mbox $threadid | grep '^Date' > OUTPUT +cat <<EOF > EXPECTED +Date: Thu, 16 Jun 2016 22:14:41 -0400 +Date: Fri, 17 Jun 2016 22:14:41 -0400 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T060-count.sh b/test/T060-count.sh new file mode 100755 index 00000000..0c0bf473 --- /dev/null +++ b/test/T060-count.sh @@ -0,0 +1,156 @@ +#!/usr/bin/env bash +test_description='"notmuch count" for messages and threads' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +# Note: The 'wc -l' results below are wrapped in arithmetic evaluation +# $((...)) to strip whitespace. This is for portability, as 'wc -l' +# emits whitespace on some BSD variants. + +test_begin_subtest "message count is the default for notmuch count" +test_expect_equal \ + "$((`notmuch search --output=messages '*' | wc -l`))" \ + "`notmuch count '*'`" + +test_begin_subtest "message count with --output=messages" +test_expect_equal \ + "$((`notmuch search --output=messages '*' | wc -l`))" \ + "`notmuch count --output=messages '*'`" + +test_begin_subtest "thread count with --output=threads" +test_expect_equal \ + "$((`notmuch search --output=threads '*' | wc -l`))" \ + "`notmuch count --output=threads '*'`" + +test_begin_subtest "thread count is the default for notmuch search" +test_expect_equal \ + "$((`notmuch search '*' | wc -l`))" \ + "`notmuch count --output=threads '*'`" + +test_begin_subtest "files count" +test_expect_equal \ + "$((`notmuch search --output=files '*' | wc -l`))" \ + "`notmuch count --output=files '*'`" + +test_begin_subtest "files count for a duplicate message-id" +test_expect_equal \ + "2" \ + "`notmuch count --output=files id:20091117232137.GA7669@griffis1.net`" + +test_begin_subtest "count with no matching messages" +test_expect_equal \ + "0" \ + "`notmuch count --output=messages from:cworth and not from:cworth`" + +test_begin_subtest "count with no matching threads" +test_expect_equal \ + "0" \ + "`notmuch count --output=threads from:cworth and not from:cworth`" + +test_begin_subtest "message count is the default for batch count" +notmuch count --batch >OUTPUT <<EOF + +from:cworth +EOF +notmuch count --output=messages >EXPECTED +notmuch count --output=messages from:cworth >>EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "batch message count" +notmuch count --batch --output=messages >OUTPUT <<EOF +from:cworth + +tag:inbox +EOF +notmuch count --output=messages from:cworth >EXPECTED +notmuch count --output=messages >>EXPECTED +notmuch count --output=messages tag:inbox >>EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "batch thread count" +notmuch count --batch --output=threads >OUTPUT <<EOF + +from:cworth +from:cworth and not from:cworth +foo +EOF +notmuch count --output=threads >EXPECTED +notmuch count --output=threads from:cworth >>EXPECTED +notmuch count --output=threads from:cworth and not from:cworth >>EXPECTED +notmuch count --output=threads foo >>EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "batch message count with input file" +cat >INPUT <<EOF +from:cworth + +tag:inbox +EOF +notmuch count --input=INPUT --output=messages >OUTPUT +notmuch count --output=messages from:cworth >EXPECTED +notmuch count --output=messages >>EXPECTED +notmuch count --output=messages tag:inbox >>EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +backup_database +test_begin_subtest "error message for database open" +dd if=/dev/zero of="${MAIL_DIR}/.notmuch/xapian/postlist.${db_ending}" count=3 +notmuch count '*' 2>OUTPUT 1>/dev/null +output=$(sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' OUTPUT) +test_expect_equal "${output}" "A Xapian exception occurred opening database" +restore_database + +cat <<EOF > count-files.gdb +set breakpoint pending on +set logging file count-files-gdb.log +set logging on +break count_files +commands +shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.${db_ending} +continue +end +run +EOF + +backup_database +test_begin_subtest "error message from query_search_messages" +${TEST_GDB} --batch-silent --return-child-result -x count-files.gdb \ + --args notmuch count --output=files '*' 2>OUTPUT 1>/dev/null +cat <<EOF > EXPECTED +notmuch count: A Xapian exception occurred +A Xapian exception occurred performing query +Query string was: * +EOF +sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' < OUTPUT > OUTPUT.clean +test_expect_equal_file EXPECTED OUTPUT.clean +restore_database + +test_begin_subtest "count library function is non-destructive" +cat<<EOF > EXPECTED +1: 52 messages +2: 52 messages +Exclude 'spam' +3: 52 messages +4: 52 messages +EOF +test_python <<EOF +import sys +import notmuch + +query_string = 'tag:inbox or tag:spam' +tag_string = 'spam' + +database = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY) +query = notmuch.Query(database, query_string) + +print("1: {} messages".format(query.count_messages())) +print("2: {} messages".format(query.count_messages())) +print("Exclude '{}'".format(tag_string)) +query.exclude_tag(tag_string) +print("3: {} messages".format(query.count_messages())) +print("4: {} messages".format(query.count_messages())) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T070-insert.sh b/test/T070-insert.sh new file mode 100755 index 00000000..05be473a --- /dev/null +++ b/test/T070-insert.sh @@ -0,0 +1,294 @@ +#!/usr/bin/env bash +test_description='"notmuch insert"' +. $(dirname "$0")/test-lib.sh || exit 1 + +test_require_external_prereq gdb + +# subtests about file permissions assume that we're working with umask +# 022 by default. +umask 022 + +# Create directories and database before inserting. +mkdir -p "$MAIL_DIR"/{cur,new,tmp} +mkdir -p "$MAIL_DIR"/Drafts/{cur,new,tmp} +notmuch new > /dev/null + +# We use generate_message to create the temporary message files. +# They happen to be in the mail directory already but that is okay +# since we do not call notmuch new hereafter. + +gen_insert_msg() { + generate_message \ + "[subject]=\"insert-subject\"" \ + "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" \ + "[body]=\"insert-message\"" +} + +test_begin_subtest "Insert zero-length file" +test_expect_code 1 "notmuch insert < /dev/null" + +# This test is a proxy for other errors that may occur while trying to +# add a message to the notmuch database, e.g. database locked. +test_begin_subtest "Insert non-message" +test_expect_code 1 "echo bad_message | notmuch insert" + +test_begin_subtest "Database empty so far" +test_expect_equal "0" "`notmuch count --output=messages '*'`" + +test_begin_subtest "Insert message" +gen_insert_msg +notmuch insert < "$gen_msg_filename" +cur_msg_filename=$(notmuch search --output=files "subject:insert-subject") +test_expect_equal_file "$cur_msg_filename" "$gen_msg_filename" + +test_begin_subtest "Permissions on inserted message should be 0600" +test_expect_equal "600" "$(stat -c %a "$cur_msg_filename")" + +test_begin_subtest "Insert message adds default tags" +output=$(notmuch show --format=json "subject:insert-subject") +expected='[[[{ + "id": "'"${gen_msg_id}"'", + "match": true, + "excluded": false, + "filename": ["'"${cur_msg_filename}"'"], + "timestamp": 946728000, + "date_relative": "2000-01-01", + "tags": ["inbox","unread"], + "headers": { + "Subject": "insert-subject", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, + "body": [{"id": 1, + "content-type": "text/plain", + "content": "insert-message\n"}]}, + []]]]' +test_expect_equal_json "$output" "$expected" + +test_begin_subtest "Insert duplicate message" +notmuch insert +duptag -unread < "$gen_msg_filename" +output=$((`notmuch search --output=files "subject:insert-subject" | wc -l`)) +test_expect_equal "$output" 2 + +test_begin_subtest "Duplicate message does not change tags" +output=$(notmuch search --format=json --output=tags "subject:insert-subject") +test_expect_equal_json "$output" '["inbox", "unread"]' + +test_begin_subtest "Insert message, add tag" +gen_insert_msg +notmuch insert +custom < "$gen_msg_filename" +output=$(notmuch search --output=messages tag:custom) +test_expect_equal "$output" "id:$gen_msg_id" + +test_begin_subtest "Insert tagged world-readable message" +gen_insert_msg +notmuch insert --world-readable +world-readable-test < "$gen_msg_filename" +cur_msg_filename=$(notmuch search --output=files "tag:world-readable-test") +test_expect_equal_file "$cur_msg_filename" "$gen_msg_filename" + +test_begin_subtest "Permissions on inserted world-readable message should be 0644" +test_expect_equal "644" "$(stat -c %a "$cur_msg_filename")" + +test_begin_subtest "Insert tagged world-readable message with group-only umask" +oldumask=$(umask) +umask 027 +gen_insert_msg +notmuch insert --world-readable +world-readable-umask-test < "$gen_msg_filename" +cur_msg_filename=$(notmuch search --output=files "tag:world-readable-umask-test") +umask "$oldumask" +test_expect_equal_file "$cur_msg_filename" "$gen_msg_filename" + +test_begin_subtest "Permissions on inserted world-readable message with funny umask should be 0640" +test_expect_equal "640" "$(stat -c %a "$cur_msg_filename")" + +test_begin_subtest "Insert message, add/remove tags" +gen_insert_msg +notmuch insert +custom -unread < "$gen_msg_filename" +output=$(notmuch search --output=messages tag:custom NOT tag:unread) +test_expect_equal "$output" "id:$gen_msg_id" + +test_begin_subtest "Insert message with default tags stays in new/" +gen_insert_msg +notmuch insert < "$gen_msg_filename" +output=$(notmuch search --output=files id:$gen_msg_id) +dirname=$(dirname "$output") +test_expect_equal "$dirname" "$MAIL_DIR/new" + +test_begin_subtest "Insert message with non-maildir synced tags stays in new/" +gen_insert_msg +notmuch insert +custom -inbox < "$gen_msg_filename" +output=$(notmuch search --output=files id:$gen_msg_id) +dirname=$(dirname "$output") +test_expect_equal "$dirname" "$MAIL_DIR/new" + +test_begin_subtest "Insert message with custom new.tags goes to cur/" +OLDCONFIG=$(notmuch config get new.tags) +notmuch config set new.tags test +gen_insert_msg +notmuch insert < "$gen_msg_filename" +output=$(notmuch search --output=files id:$gen_msg_id) +dirname=$(dirname "$output") +notmuch config set new.tags $OLDCONFIG +test_expect_equal "$dirname" "$MAIL_DIR/cur" + +# additional check on the previous message +test_begin_subtest "Insert message with custom new.tags actually gets the tags" +output=$(notmuch search --output=tags id:$gen_msg_id) +test_expect_equal "$output" "test" + +test_begin_subtest "Insert message with maildir synced tags goes to cur/" +gen_insert_msg +notmuch insert +flagged < "$gen_msg_filename" +output=$(notmuch search --output=files id:$gen_msg_id) +dirname=$(dirname "$output") +test_expect_equal "$dirname" "$MAIL_DIR/cur" + +test_begin_subtest "Insert message with maildir sync off goes to new/" +OLDCONFIG=$(notmuch config get maildir.synchronize_flags) +notmuch config set maildir.synchronize_flags false +gen_insert_msg +notmuch insert +flagged < "$gen_msg_filename" +output=$(notmuch search --output=files id:$gen_msg_id) +dirname=$(dirname "$output") +notmuch config set maildir.synchronize_flags $OLDCONFIG +test_expect_equal "$dirname" "$MAIL_DIR/new" + +test_begin_subtest "Insert message into folder" +gen_insert_msg +notmuch insert --folder=Drafts < "$gen_msg_filename" +output=$(notmuch search --output=files path:Drafts/new) +dirname=$(dirname "$output") +test_expect_equal "$dirname" "$MAIL_DIR/Drafts/new" + +test_begin_subtest "Insert message into top level folder" +gen_insert_msg +notmuch insert --folder="" < "$gen_msg_filename" +output=$(notmuch search --output=files id:${gen_msg_id}) +dirname=$(dirname "$output") +test_expect_equal "$dirname" "$MAIL_DIR/new" + +test_begin_subtest "Insert message into folder with trailing /" +gen_insert_msg +notmuch insert --folder=Drafts/ < "$gen_msg_filename" +output=$(notmuch search --output=files id:${gen_msg_id}) +dirname=$(dirname "$output") +test_expect_equal "$dirname" "$MAIL_DIR/Drafts/new" + +test_begin_subtest "Insert message into folder, add/remove tags" +gen_insert_msg +notmuch insert --folder=Drafts +draft -unread < "$gen_msg_filename" +output=$(notmuch search --output=messages path:Drafts/cur tag:draft NOT tag:unread) +test_expect_equal "$output" "id:$gen_msg_id" + +test_begin_subtest "Insert message into non-existent folder" +gen_insert_msg +test_expect_code 1 "notmuch insert --folder=nonesuch < $gen_msg_filename" + +test_begin_subtest "Insert message, create folder" +gen_insert_msg +notmuch insert --folder=F --create-folder +folder < "$gen_msg_filename" +output=$(notmuch search --output=files path:F/new tag:folder) +basename=$(basename "$output") +test_expect_equal_file "$gen_msg_filename" "$MAIL_DIR/F/new/${basename}" + +test_begin_subtest "Insert message, create subfolder" +gen_insert_msg +notmuch insert --folder=F/G/H/I/J --create-folder +folder < "$gen_msg_filename" +output=$(notmuch search --output=files path:F/G/H/I/J/new tag:folder) +basename=$(basename "$output") +test_expect_equal_file "$gen_msg_filename" "${MAIL_DIR}/F/G/H/I/J/new/${basename}" + +test_begin_subtest "Created subfolder should have permissions 0700" +test_expect_equal "700" "$(stat -c %a "${MAIL_DIR}/F/G/H/I/J")" +test_begin_subtest "Created subfolder new/ should also have permissions 0700" +test_expect_equal "700" "$(stat -c %a "${MAIL_DIR}/F/G/H/I/J/new")" + +test_begin_subtest "Insert message, create world-readable subfolder" +gen_insert_msg +notmuch insert --folder=F/G/H/I/J/K --create-folder --world-readable +folder-world-readable < "$gen_msg_filename" +output=$(notmuch search --output=files path:F/G/H/I/J/K/new tag:folder-world-readable) +basename=$(basename "$output") +test_expect_equal_file "$gen_msg_filename" "${MAIL_DIR}/F/G/H/I/J/K/new/${basename}" + +test_begin_subtest "Created world-readable subfolder should have permissions 0755" +test_expect_equal "755" "$(stat -c %a "${MAIL_DIR}/F/G/H/I/J/K")" +test_begin_subtest "Created world-readable subfolder new/ should also have permissions 0755" +test_expect_equal "755" "$(stat -c %a "${MAIL_DIR}/F/G/H/I/J/K/new")" + +test_begin_subtest "Insert message, create existing subfolder" +gen_insert_msg +notmuch insert --folder=F/G/H/I/J --create-folder +folder < "$gen_msg_filename" +output=$(notmuch count path:F/G/H/I/J/new tag:folder) +test_expect_equal "$output" "2" + +test_begin_subtest "Insert message, create invalid subfolder" +gen_insert_msg +test_expect_code 1 "notmuch insert --folder=../G --create-folder $gen_msg_filename" + +OLDCONFIG=$(notmuch config get new.tags) + +test_begin_subtest "Empty tags in new.tags are forbidden" +notmuch config set new.tags "foo;;bar" +gen_insert_msg +output=$(notmuch insert $gen_msg_filename 2>&1) +test_expect_equal "$output" "Error: tag '' in new.tags: empty tag forbidden" + +test_begin_subtest "Tags starting with '-' in new.tags are forbidden" +notmuch config set new.tags "-foo;bar" +gen_insert_msg +output=$(notmuch insert $gen_msg_filename 2>&1) +test_expect_equal "$output" "Error: tag '-foo' in new.tags: tag starting with '-' forbidden" + +test_begin_subtest "Invalid tags set exit code" +test_expect_code 1 "notmuch insert $gen_msg_filename 2>&1" + +notmuch config set new.tags $OLDCONFIG + +# DUPLICATE_MESSAGE_ID is not tested here, because it should actually pass. + +for code in OUT_OF_MEMORY XAPIAN_EXCEPTION FILE_NOT_EMAIL \ + READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR; do +cat <<EOF > index-file-$code.gdb +set breakpoint pending on +set logging file index-file-$code.log +set logging on +break notmuch_database_index_file +commands +return NOTMUCH_STATUS_$code +continue +end +run +EOF +done + +gen_insert_msg + +for code in FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR; do + test_begin_subtest "EXIT_FAILURE when index_file returns $code" + test_expect_code 1 \ + "${TEST_GDB} --batch-silent --return-child-result \ + -ex 'set args insert < $gen_msg_filename' \ + -x index-file-$code.gdb notmuch" + + test_begin_subtest "success exit with --keep when index_file returns $code" + test_expect_code 0 \ + "${TEST_GDB} --batch-silent --return-child-result \ + -ex 'set args insert --keep < $gen_msg_filename' \ + -x index-file-$code.gdb notmuch" +done + +for code in OUT_OF_MEMORY XAPIAN_EXCEPTION ; do + test_begin_subtest "EX_TEMPFAIL when index_file returns $code" + test_expect_code 75 \ + "${TEST_GDB} --batch-silent --return-child-result \ + -ex 'set args insert < $gen_msg_filename' \ + -x index-file-$code.gdb notmuch" + + test_begin_subtest "success exit with --keep when index_file returns $code" + test_expect_code 0 \ + "${TEST_GDB} --batch-silent --return-child-result \ + -ex 'set args insert --keep < $gen_msg_filename' \ + -x index-file-$code.gdb notmuch" +done + +test_done diff --git a/test/T080-search.sh b/test/T080-search.sh new file mode 100755 index 00000000..a3f0dead --- /dev/null +++ b/test/T080-search.sh @@ -0,0 +1,192 @@ +#!/usr/bin/env bash +test_description='"notmuch search" in several variations' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +test_begin_subtest "Search body" +add_message '[subject]="body search"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [body]=bodysearchtest +output=$(notmuch search bodysearchtest | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (inbox unread)" + +test_begin_subtest "Search by from:" +add_message '[subject]="search by from"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [from]=searchbyfrom +output=$(notmuch search from:searchbyfrom | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] searchbyfrom; search by from (inbox unread)" + +test_begin_subtest "Search by to:" +add_message '[subject]="search by to"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [to]=searchbyto +output=$(notmuch search to:searchbyto | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (inbox unread)" + +test_begin_subtest "Search by subject:" +add_message [subject]=subjectsearchtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(notmuch search subject:subjectsearchtest | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subjectsearchtest (inbox unread)" + +test_begin_subtest "Search by subject (utf-8):" +add_message [subject]=utf8-sübjéct '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(notmuch search subject:utf8-sübjéct | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; utf8-sübjéct (inbox unread)" + +test_begin_subtest "Search by id:" +add_message '[subject]="search by id"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(notmuch search id:${gen_msg_id} | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by id (inbox unread)" + +test_begin_subtest "Search by mid:" +add_message '[subject]="search by mid"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(notmuch search mid:${gen_msg_id} | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by mid (inbox unread)" + +test_begin_subtest "Search by tag:" +add_message '[subject]="search by tag"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +notmuch tag +searchbytag id:${gen_msg_id} +output=$(notmuch search tag:searchbytag | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by tag (inbox searchbytag unread)" + +test_begin_subtest "Search by thread:" +add_message '[subject]="search by thread"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +thread_id=$(notmuch search id:${gen_msg_id} | sed -e "s/thread:\([a-f0-9]*\).*/\1/") +output=$(notmuch search thread:${thread_id} | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by thread (inbox unread)" + +test_begin_subtest "Search body (phrase)" +add_message '[subject]="body search (phrase)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="body search (phrase)"' +add_message '[subject]="negative result"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="This phrase should not match the body search"' +output=$(notmuch search '"body search (phrase)"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (phrase) (inbox unread)" + +test_begin_subtest "Search by from: (address)" +add_message '[subject]="search by from (address)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [from]=searchbyfrom@example.com +output=$(notmuch search from:searchbyfrom@example.com | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] searchbyfrom@example.com; search by from (address) (inbox unread)" + +test_begin_subtest "Search by from: (name)" +add_message '[subject]="search by from (name)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[from]="Search By From Name <test@example.com>"' +output=$(notmuch search 'from:"Search By From Name"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread)" + +test_begin_subtest "Search by from: (name and address)" +output=$(notmuch search 'from:"Search By From Name <test@example.com>"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread)" + +test_begin_subtest "Search by from: without prefix (name and address)" +output=$(notmuch search '"Search By From Name <test@example.com>"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread)" + +test_begin_subtest "Search by to: (address)" +add_message '[subject]="search by to (address)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [to]=searchbyto@example.com +output=$(notmuch search to:searchbyto@example.com | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (address) (inbox unread)" + +test_begin_subtest "Search by to: (name)" +add_message '[subject]="search by to (name)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[to]="Search By To Name <test@example.com>"' +output=$(notmuch search 'to:"Search By To Name"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inbox unread)" + +test_begin_subtest "Search by to: (name and address)" +output=$(notmuch search 'to:"Search By To Name <test@example.com>"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inbox unread)" + +test_begin_subtest "Search by to: without prefix (name and address)" +output=$(notmuch search '"Search By To Name <test@example.com>"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inbox unread)" + +test_begin_subtest "Search by subject: (phrase)" +add_message '[subject]="subject search test (phrase)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +add_message '[subject]="this phrase should not match the subject search test"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(notmuch search 'subject:"subject search test (phrase)"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subject search test (phrase) (inbox unread)" + +test_begin_subtest 'Search for all messages ("*")' +notmuch search '*' | notmuch_search_sanitize > OUTPUT +cat <<EOF >EXPECTED +thread:XXX 2010-12-29 [1/1] François Boulogne; [aur-general] Guidelines: cp, mkdir vs install (inbox unread) +thread:XXX 2010-12-16 [1/1] Olivier Berger; Essai accentué (inbox unread) +thread:XXX 2009-11-18 [1/1] Chris Wilson; [notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once (inbox unread) +thread:XXX 2009-11-18 [2/2] Alex Botero-Lowry, Carl Worth; [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) +thread:XXX 2009-11-18 [2/2] Ingmar Vanhassel, Carl Worth; [notmuch] [PATCH] Typsos (inbox unread) +thread:XXX 2009-11-18 [3/3] Adrian Perez de Castro, Keith Packard, Carl Worth; [notmuch] Introducing myself (inbox signed unread) +thread:XXX 2009-11-18 [3/3] Israel Herraiz, Keith Packard, Carl Worth; [notmuch] New to the list (inbox unread) +thread:XXX 2009-11-18 [3/3] Jan Janak, Carl Worth; [notmuch] What a great idea! (inbox unread) +thread:XXX 2009-11-18 [2/2] Jan Janak, Carl Worth; [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) +thread:XXX 2009-11-18 [3/3(4)] Aron Griffis, Keith Packard, Carl Worth; [notmuch] archive (inbox unread) +thread:XXX 2009-11-18 [2/2] Keith Packard, Carl Worth; [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) +thread:XXX 2009-11-18 [7/7] Lars Kellogg-Stedman, Mikhail Gusarov, Keith Packard, Carl Worth; [notmuch] Working with Maildir storage? (inbox signed unread) +thread:XXX 2009-11-18 [5/5] Mikhail Gusarov, Carl Worth, Keith Packard; [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) +thread:XXX 2009-11-18 [2/2] Keith Packard, Alexander Botero-Lowry; [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) +thread:XXX 2009-11-18 [1/1] Alexander Botero-Lowry; [notmuch] request for pull (inbox unread) +thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) +thread:XXX 2009-11-18 [1/1] Rolland Santimano; [notmuch] Link to mailing list archives ? (inbox unread) +thread:XXX 2009-11-18 [1/1] Jan Janak; [notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) +thread:XXX 2009-11-18 [1/1] Stewart Smith; [notmuch] [PATCH] count_files: sort directory in inode order before statting (inbox unread) +thread:XXX 2009-11-18 [1/1] Stewart Smith; [notmuch] [PATCH 2/2] Read mail directory in inode number order (inbox unread) +thread:XXX 2009-11-18 [1/1] Stewart Smith; [notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (inbox unread) +thread:XXX 2009-11-18 [2/2] Lars Kellogg-Stedman; [notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) +thread:XXX 2009-11-17 [1/1] Mikhail Gusarov; [notmuch] [PATCH] Handle rename of message file (inbox unread) +thread:XXX 2009-11-17 [2/2] Alex Botero-Lowry, Carl Worth; [notmuch] preliminary FreeBSD support (attachment inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (inbox unread) +thread:XXX 2000-01-01 [1/1] searchbyfrom; search by from (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subjectsearchtest (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; utf8-sübjéct (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by id (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by mid (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by tag (inbox searchbytag unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by thread (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (phrase) (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; negative result (inbox unread) +thread:XXX 2000-01-01 [1/1] searchbyfrom@example.com; search by from (address) (inbox unread) +thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (address) (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subject search test (phrase) (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; this phrase should not match the subject search test (inbox unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Search body (utf-8):" +add_message '[subject]="utf8-message-body-subject"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="message body utf8: bödý"' +output=$(notmuch search "bödý" | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; utf8-message-body-subject (inbox unread)" + + +cat <<EOF > ${MAIL_DIR}/termpos +From: Source <source@example.com> +To: Dest <dest@example.com> +Subject: part overlap test +Date: Sat, 01 January 2000 00:00:00 +0000 +Message-ID: <termpos> +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="==-==" + +--==-== +Content-Type: text/plain + +a b c + +--==-== +Content-Type: text/plain + +x y z + +--==-==-- +EOF +notmuch new > /dev/null + +test_begin_subtest "headers do not have adjacent term positions" +# Regression test for a bug where term positions for non-prefixed +# terms weren't updated +output=$(notmuch search id:termpos and '"com dest"') +test_expect_equal "$output" "" + +test_begin_subtest "parts have non-overlapping term positions" +output=$(notmuch search id:termpos and '"a y c"') +test_expect_equal "$output" "" + +test_begin_subtest "parts do not have adjacent term positions" +output=$(notmuch search id:termpos and '"c x"') +test_expect_equal "$output" "" + +test_done diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh new file mode 100755 index 00000000..bf28d220 --- /dev/null +++ b/test/T090-search-output.sh @@ -0,0 +1,446 @@ +#!/usr/bin/env bash +test_description='various settings for "notmuch search --output="' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +test_begin_subtest "--output=threads" +notmuch search --output=threads '*' | sed -e s/thread:.*/thread:THREADID/ >OUTPUT +cat <<EOF >EXPECTED +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +thread:THREADID +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=threads --format=json" +notmuch search --format=json --output=threads '*' | sed -e s/\".*\"/\"THREADID\"/ >OUTPUT +cat <<EOF >EXPECTED +["THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID", +"THREADID"] +EOF +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" + +test_begin_subtest "--output=messages" +notmuch search --output=messages '*' >OUTPUT +cat <<EOF >EXPECTED +id:4EFC743A.3060609@april.org +id:877h1wv7mg.fsf@inf-8657.int-evry.fr +id:1258544095-16616-1-git-send-email-chris@chris-wilson.co.uk +id:877htoqdbo.fsf@yoom.home.cworth.org +id:878we4qdqf.fsf@yoom.home.cworth.org +id:87aaykqe24.fsf@yoom.home.cworth.org +id:87bpj0qeng.fsf@yoom.home.cworth.org +id:87fx8cqf8v.fsf@yoom.home.cworth.org +id:87hbssqfix.fsf@yoom.home.cworth.org +id:87iqd8qgiz.fsf@yoom.home.cworth.org +id:87k4xoqgnl.fsf@yoom.home.cworth.org +id:87ocn0qh6d.fsf@yoom.home.cworth.org +id:87pr7gqidx.fsf@yoom.home.cworth.org +id:867hto2p0t.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me +id:1258532999-9316-1-git-send-email-keithp@keithp.com +id:86aayk2rbj.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me +id:86d43g2w3y.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me +id:ddd65cda0911172214t60d22b63hcfeb5a19ab54a39b@mail.gmail.com +id:86einw2xof.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me +id:736613.51770.qm@web113505.mail.gq1.yahoo.com +id:1258520223-15328-1-git-send-email-jan@ryngle.com +id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com +id:1258510940-7018-1-git-send-email-stewart@flamingspork.com +id:yunzl6kd1w0.fsf@aiko.keithp.com +id:yun1vjwegii.fsf@aiko.keithp.com +id:yun3a4cegoa.fsf@aiko.keithp.com +id:1258509400-32511-1-git-send-email-stewart@flamingspork.com +id:1258506353-20352-1-git-send-email-stewart@flamingspork.com +id:20091118010116.GC25380@dottiness.seas.harvard.edu +id:20091118005829.GB25380@dottiness.seas.harvard.edu +id:20091118005040.GA25380@dottiness.seas.harvard.edu +id:cf0c4d610911171623q3e27a0adx802e47039b57604b@mail.gmail.com +id:1258500222-32066-1-git-send-email-ingmar@exherbo.org +id:20091117232137.GA7669@griffis1.net +id:20091118002059.067214ed@hikari +id:1258498485-sup-142@elly +id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com +id:f35dbb950911171435ieecd458o853c873e35f4be95@mail.gmail.com +id:1258496327-12086-1-git-send-email-jan@ryngle.com +id:1258493565-13508-1-git-send-email-keithp@keithp.com +id:yunaayketfm.fsf@aiko.keithp.com +id:yunbpj0etua.fsf@aiko.keithp.com +id:1258491078-29658-1-git-send-email-dottedmag@dottedmag.net +id:87fx8can9z.fsf@vertex.dottedmag +id:20091117203301.GV3165@dottiness.seas.harvard.edu +id:87lji4lx9v.fsf@yoom.home.cworth.org +id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com +id:87iqd9rn3l.fsf@vertex.dottedmag +id:20091117190054.GU3165@dottiness.seas.harvard.edu +id:87lji5cbwo.fsf@yoom.home.cworth.org +id:1258471718-6781-2-git-send-email-dottedmag@dottedmag.net +id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=messages --duplicate=1" +notmuch search --output=messages --duplicate=1 '*' >OUTPUT +# reuse same EXPECTED as above +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=messages --duplicate=2" +notmuch search --output=messages --duplicate=2 '*' >OUTPUT +cat <<EOF >EXPECTED +id:20091117232137.GA7669@griffis1.net +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=messages --duplicate=3" +notmuch search --output=messages --duplicate=3 '*' >OUTPUT +cat <<EOF >EXPECTED +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=messages --format=json" +notmuch search --format=json --output=messages '*' >OUTPUT +cat <<EOF >EXPECTED +["4EFC743A.3060609@april.org", +"877h1wv7mg.fsf@inf-8657.int-evry.fr", +"1258544095-16616-1-git-send-email-chris@chris-wilson.co.uk", +"877htoqdbo.fsf@yoom.home.cworth.org", +"878we4qdqf.fsf@yoom.home.cworth.org", +"87aaykqe24.fsf@yoom.home.cworth.org", +"87bpj0qeng.fsf@yoom.home.cworth.org", +"87fx8cqf8v.fsf@yoom.home.cworth.org", +"87hbssqfix.fsf@yoom.home.cworth.org", +"87iqd8qgiz.fsf@yoom.home.cworth.org", +"87k4xoqgnl.fsf@yoom.home.cworth.org", +"87ocn0qh6d.fsf@yoom.home.cworth.org", +"87pr7gqidx.fsf@yoom.home.cworth.org", +"867hto2p0t.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me", +"1258532999-9316-1-git-send-email-keithp@keithp.com", +"86aayk2rbj.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me", +"86d43g2w3y.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me", +"ddd65cda0911172214t60d22b63hcfeb5a19ab54a39b@mail.gmail.com", +"86einw2xof.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me", +"736613.51770.qm@web113505.mail.gq1.yahoo.com", +"1258520223-15328-1-git-send-email-jan@ryngle.com", +"ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com", +"1258510940-7018-1-git-send-email-stewart@flamingspork.com", +"yunzl6kd1w0.fsf@aiko.keithp.com", +"yun1vjwegii.fsf@aiko.keithp.com", +"yun3a4cegoa.fsf@aiko.keithp.com", +"1258509400-32511-1-git-send-email-stewart@flamingspork.com", +"1258506353-20352-1-git-send-email-stewart@flamingspork.com", +"20091118010116.GC25380@dottiness.seas.harvard.edu", +"20091118005829.GB25380@dottiness.seas.harvard.edu", +"20091118005040.GA25380@dottiness.seas.harvard.edu", +"cf0c4d610911171623q3e27a0adx802e47039b57604b@mail.gmail.com", +"1258500222-32066-1-git-send-email-ingmar@exherbo.org", +"20091117232137.GA7669@griffis1.net", +"20091118002059.067214ed@hikari", +"1258498485-sup-142@elly", +"f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com", +"f35dbb950911171435ieecd458o853c873e35f4be95@mail.gmail.com", +"1258496327-12086-1-git-send-email-jan@ryngle.com", +"1258493565-13508-1-git-send-email-keithp@keithp.com", +"yunaayketfm.fsf@aiko.keithp.com", +"yunbpj0etua.fsf@aiko.keithp.com", +"1258491078-29658-1-git-send-email-dottedmag@dottedmag.net", +"87fx8can9z.fsf@vertex.dottedmag", +"20091117203301.GV3165@dottiness.seas.harvard.edu", +"87lji4lx9v.fsf@yoom.home.cworth.org", +"cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com", +"87iqd9rn3l.fsf@vertex.dottedmag", +"20091117190054.GU3165@dottiness.seas.harvard.edu", +"87lji5cbwo.fsf@yoom.home.cworth.org", +"1258471718-6781-2-git-send-email-dottedmag@dottedmag.net", +"1258471718-6781-1-git-send-email-dottedmag@dottedmag.net"] +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=messages --format=json --duplicate=1" +notmuch search --output=messages --format=json --duplicate=1 '*' >OUTPUT +# reuse same EXPECTED as above +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=messages --format=json --duplicate=2" +notmuch search --output=messages --format=json --duplicate=2 '*' >OUTPUT +cat <<EOF >EXPECTED +["20091117232137.GA7669@griffis1.net"] +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=messages --format=json --duplicate=3" +notmuch search --output=messages --format=json --duplicate=3 '*' >OUTPUT +cat <<EOF >EXPECTED +[] +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=files" +notmuch search --output=files '*' | notmuch_search_files_sanitize | sort >OUTPUT +cat <<EOF >EXPECTED +MAIL_DIR/01:2, +MAIL_DIR/02:2, +MAIL_DIR/bar/17:2, +MAIL_DIR/bar/18:2, +MAIL_DIR/bar/baz/05:2, +MAIL_DIR/bar/baz/23:2, +MAIL_DIR/bar/baz/24:2, +MAIL_DIR/bar/baz/cur/25:2, +MAIL_DIR/bar/baz/cur/26:2, +MAIL_DIR/bar/baz/new/27:2, +MAIL_DIR/bar/baz/new/28:2, +MAIL_DIR/bar/cur/19:2, +MAIL_DIR/bar/cur/20:2, +MAIL_DIR/bar/new/21:2, +MAIL_DIR/bar/new/22:2, +MAIL_DIR/cur/29:2, +MAIL_DIR/cur/30:2, +MAIL_DIR/cur/31:2, +MAIL_DIR/cur/32:2, +MAIL_DIR/cur/33:2, +MAIL_DIR/cur/34:2, +MAIL_DIR/cur/35:2, +MAIL_DIR/cur/36:2, +MAIL_DIR/cur/37:2, +MAIL_DIR/cur/38:2, +MAIL_DIR/cur/39:2, +MAIL_DIR/cur/40:2, +MAIL_DIR/cur/41:2, +MAIL_DIR/cur/42:2, +MAIL_DIR/cur/43:2, +MAIL_DIR/cur/44:2, +MAIL_DIR/cur/45:2, +MAIL_DIR/cur/46:2, +MAIL_DIR/cur/47:2, +MAIL_DIR/cur/48:2, +MAIL_DIR/cur/49:2, +MAIL_DIR/cur/50:2, +MAIL_DIR/cur/51:2, +MAIL_DIR/cur/52:2, +MAIL_DIR/cur/53:2, +MAIL_DIR/foo/06:2, +MAIL_DIR/foo/baz/11:2, +MAIL_DIR/foo/baz/12:2, +MAIL_DIR/foo/baz/cur/13:2, +MAIL_DIR/foo/baz/cur/14:2, +MAIL_DIR/foo/baz/new/15:2, +MAIL_DIR/foo/baz/new/16:2, +MAIL_DIR/foo/cur/07:2, +MAIL_DIR/foo/cur/08:2, +MAIL_DIR/foo/new/03:2, +MAIL_DIR/foo/new/09:2, +MAIL_DIR/foo/new/10:2, +MAIL_DIR/new/04:2, +EOF +test_expect_equal_file EXPECTED OUTPUT + +dup1=$(notmuch search --output=files id:20091117232137.GA7669@griffis1.net | head -n 1 | sed -e "s,$MAIL_DIR,MAIL_DIR,") +dup2=$(notmuch search --output=files id:20091117232137.GA7669@griffis1.net | tail -n 1 | sed -e "s,$MAIL_DIR,MAIL_DIR,") + +test_begin_subtest "--output=files --duplicate=1" +notmuch search --output=files --duplicate=1 '*' | notmuch_search_files_sanitize | sort >OUTPUT +cat <<EOF | sort >EXPECTED +$dup1 +MAIL_DIR/cur/52:2, +MAIL_DIR/cur/53:2, +MAIL_DIR/cur/50:2, +MAIL_DIR/cur/49:2, +MAIL_DIR/cur/48:2, +MAIL_DIR/cur/47:2, +MAIL_DIR/cur/46:2, +MAIL_DIR/cur/45:2, +MAIL_DIR/cur/44:2, +MAIL_DIR/cur/43:2, +MAIL_DIR/cur/42:2, +MAIL_DIR/cur/41:2, +MAIL_DIR/cur/40:2, +MAIL_DIR/cur/39:2, +MAIL_DIR/cur/38:2, +MAIL_DIR/cur/37:2, +MAIL_DIR/cur/36:2, +MAIL_DIR/cur/35:2, +MAIL_DIR/cur/34:2, +MAIL_DIR/cur/33:2, +MAIL_DIR/cur/32:2, +MAIL_DIR/cur/31:2, +MAIL_DIR/cur/30:2, +MAIL_DIR/cur/29:2, +MAIL_DIR/bar/baz/new/28:2, +MAIL_DIR/bar/baz/new/27:2, +MAIL_DIR/bar/baz/cur/26:2, +MAIL_DIR/bar/baz/cur/25:2, +MAIL_DIR/bar/baz/24:2, +MAIL_DIR/bar/baz/23:2, +MAIL_DIR/bar/new/22:2, +MAIL_DIR/bar/new/21:2, +MAIL_DIR/bar/cur/19:2, +MAIL_DIR/bar/cur/20:2, +MAIL_DIR/bar/17:2, +MAIL_DIR/foo/baz/new/16:2, +MAIL_DIR/foo/baz/new/15:2, +MAIL_DIR/foo/baz/cur/14:2, +MAIL_DIR/foo/baz/cur/13:2, +MAIL_DIR/foo/baz/12:2, +MAIL_DIR/foo/baz/11:2, +MAIL_DIR/foo/new/10:2, +MAIL_DIR/foo/new/09:2, +MAIL_DIR/foo/cur/08:2, +MAIL_DIR/foo/06:2, +MAIL_DIR/bar/baz/05:2, +MAIL_DIR/new/04:2, +MAIL_DIR/foo/new/03:2, +MAIL_DIR/foo/cur/07:2, +MAIL_DIR/02:2, +MAIL_DIR/01:2, +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=files --format=json" +notmuch search --format=json --output=files '*' | notmuch_search_files_sanitize \ + | test_sort_json >OUTPUT +cat <<EOF | test_sort_json >EXPECTED +["MAIL_DIR/cur/52:2,", +"MAIL_DIR/cur/53:2,", +"MAIL_DIR/cur/50:2,", +"MAIL_DIR/cur/49:2,", +"MAIL_DIR/cur/48:2,", +"MAIL_DIR/cur/47:2,", +"MAIL_DIR/cur/46:2,", +"MAIL_DIR/cur/45:2,", +"MAIL_DIR/cur/44:2,", +"MAIL_DIR/cur/43:2,", +"MAIL_DIR/cur/42:2,", +"MAIL_DIR/cur/41:2,", +"MAIL_DIR/cur/40:2,", +"MAIL_DIR/cur/39:2,", +"MAIL_DIR/cur/38:2,", +"MAIL_DIR/cur/37:2,", +"MAIL_DIR/cur/36:2,", +"MAIL_DIR/cur/35:2,", +"MAIL_DIR/cur/34:2,", +"MAIL_DIR/cur/33:2,", +"MAIL_DIR/cur/32:2,", +"MAIL_DIR/cur/31:2,", +"MAIL_DIR/cur/30:2,", +"MAIL_DIR/cur/29:2,", +"MAIL_DIR/bar/baz/new/28:2,", +"MAIL_DIR/bar/baz/new/27:2,", +"MAIL_DIR/bar/baz/cur/26:2,", +"MAIL_DIR/bar/baz/cur/25:2,", +"MAIL_DIR/bar/baz/24:2,", +"MAIL_DIR/bar/baz/23:2,", +"MAIL_DIR/bar/new/22:2,", +"MAIL_DIR/bar/new/21:2,", +"MAIL_DIR/bar/cur/19:2,", +"MAIL_DIR/bar/18:2,", +"MAIL_DIR/cur/51:2,", +"MAIL_DIR/bar/cur/20:2,", +"MAIL_DIR/bar/17:2,", +"MAIL_DIR/foo/baz/new/16:2,", +"MAIL_DIR/foo/baz/new/15:2,", +"MAIL_DIR/foo/baz/cur/14:2,", +"MAIL_DIR/foo/baz/cur/13:2,", +"MAIL_DIR/foo/baz/12:2,", +"MAIL_DIR/foo/baz/11:2,", +"MAIL_DIR/foo/new/10:2,", +"MAIL_DIR/foo/new/09:2,", +"MAIL_DIR/foo/cur/08:2,", +"MAIL_DIR/foo/06:2,", +"MAIL_DIR/bar/baz/05:2,", +"MAIL_DIR/new/04:2,", +"MAIL_DIR/foo/new/03:2,", +"MAIL_DIR/foo/cur/07:2,", +"MAIL_DIR/02:2,", +"MAIL_DIR/01:2,"] +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=files --format=json --duplicate=2" +notmuch search --format=json --output=files --duplicate=2 '*' | notmuch_search_files_sanitize >OUTPUT +cat <<EOF >EXPECTED +["$dup2"] +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=tags" +notmuch search --output=tags '*' >OUTPUT +cat <<EOF >EXPECTED +attachment +inbox +signed +unread +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=tags --format=json" +notmuch search --format=json --output=tags '*' >OUTPUT +cat <<EOF >EXPECTED +["attachment", +"inbox", +"signed", +"unread"] +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "sanitize output for quoted-printable line-breaks in author and subject" +add_message "[subject]='two =?ISO-8859-1?Q?line=0A_subject?= + headers'" +notmuch search id:"$gen_msg_id" | notmuch_search_sanitize >OUTPUT +cat <<EOF >EXPECTED +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; two line subject headers (inbox unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "search for non-existent message prints nothing" +notmuch search "no-message-matches-this" > OUTPUT +echo -n >EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "search --format=json for non-existent message prints proper empty json" +notmuch search --format=json "no-message-matches-this" > OUTPUT +echo "[]" >EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T095-address.sh b/test/T095-address.sh new file mode 100755 index 00000000..817be538 --- /dev/null +++ b/test/T095-address.sh @@ -0,0 +1,328 @@ +#!/usr/bin/env bash +test_description='"notmuch address" in several variants' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +test_begin_subtest "--output=sender" +notmuch address --output=sender '*' >OUTPUT +cat <<EOF >EXPECTED +François Boulogne <boulogne.f@gmail.com> +Olivier Berger <olivier.berger@it-sudparis.eu> +Chris Wilson <chris@chris-wilson.co.uk> +Carl Worth <cworth@cworth.org> +Alexander Botero-Lowry <alex.boterolowry@gmail.com> +Keith Packard <keithp@keithp.com> +Jjgod Jiang <gzjjgod@gmail.com> +Rolland Santimano <rollandsantimano@yahoo.com> +Jan Janak <jan@ryngle.com> +Stewart Smith <stewart@flamingspork.com> +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Alex Botero-Lowry <alex.boterolowry@gmail.com> +Ingmar Vanhassel <ingmar@exherbo.org> +Aron Griffis <agriffis@n01se.net> +Adrian Perez de Castro <aperez@igalia.com> +Israel Herraiz <isra@herraiz.org> +Mikhail Gusarov <dottedmag@dottedmag.net> +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "without --output" +notmuch address '*' >OUTPUT +# Use EXPECTED from previous subtest +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=sender --format=json" +notmuch address --output=sender --format=json '*' >OUTPUT +cat <<EOF >EXPECTED +[{"name": "François Boulogne", "address": "boulogne.f@gmail.com", "name-addr": "François Boulogne <boulogne.f@gmail.com>"}, +{"name": "Olivier Berger", "address": "olivier.berger@it-sudparis.eu", "name-addr": "Olivier Berger <olivier.berger@it-sudparis.eu>"}, +{"name": "Chris Wilson", "address": "chris@chris-wilson.co.uk", "name-addr": "Chris Wilson <chris@chris-wilson.co.uk>"}, +{"name": "Carl Worth", "address": "cworth@cworth.org", "name-addr": "Carl Worth <cworth@cworth.org>"}, +{"name": "Alexander Botero-Lowry", "address": "alex.boterolowry@gmail.com", "name-addr": "Alexander Botero-Lowry <alex.boterolowry@gmail.com>"}, +{"name": "Keith Packard", "address": "keithp@keithp.com", "name-addr": "Keith Packard <keithp@keithp.com>"}, +{"name": "Jjgod Jiang", "address": "gzjjgod@gmail.com", "name-addr": "Jjgod Jiang <gzjjgod@gmail.com>"}, +{"name": "Rolland Santimano", "address": "rollandsantimano@yahoo.com", "name-addr": "Rolland Santimano <rollandsantimano@yahoo.com>"}, +{"name": "Jan Janak", "address": "jan@ryngle.com", "name-addr": "Jan Janak <jan@ryngle.com>"}, +{"name": "Stewart Smith", "address": "stewart@flamingspork.com", "name-addr": "Stewart Smith <stewart@flamingspork.com>"}, +{"name": "Lars Kellogg-Stedman", "address": "lars@seas.harvard.edu", "name-addr": "Lars Kellogg-Stedman <lars@seas.harvard.edu>"}, +{"name": "Alex Botero-Lowry", "address": "alex.boterolowry@gmail.com", "name-addr": "Alex Botero-Lowry <alex.boterolowry@gmail.com>"}, +{"name": "Ingmar Vanhassel", "address": "ingmar@exherbo.org", "name-addr": "Ingmar Vanhassel <ingmar@exherbo.org>"}, +{"name": "Aron Griffis", "address": "agriffis@n01se.net", "name-addr": "Aron Griffis <agriffis@n01se.net>"}, +{"name": "Adrian Perez de Castro", "address": "aperez@igalia.com", "name-addr": "Adrian Perez de Castro <aperez@igalia.com>"}, +{"name": "Israel Herraiz", "address": "isra@herraiz.org", "name-addr": "Israel Herraiz <isra@herraiz.org>"}, +{"name": "Mikhail Gusarov", "address": "dottedmag@dottedmag.net", "name-addr": "Mikhail Gusarov <dottedmag@dottedmag.net>"}] +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=recipients" +notmuch address --output=recipients '*' >OUTPUT +cat <<EOF >EXPECTED +Allan McRae <allan@archlinux.org> +"Discussion about the Arch User Repository (AUR)" <aur-general@archlinux.org> +olivier.berger@it-sudparis.eu +notmuch@notmuchmail.org +notmuch <notmuch@notmuchmail.org> +Keith Packard <keithp@keithp.com> +Mikhail Gusarov <dottedmag@dottedmag.net> +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=sender --output=recipients" +notmuch address --output=sender --output=recipients '*' >OUTPUT +cat <<EOF >EXPECTED +François Boulogne <boulogne.f@gmail.com> +Allan McRae <allan@archlinux.org> +"Discussion about the Arch User Repository (AUR)" <aur-general@archlinux.org> +Olivier Berger <olivier.berger@it-sudparis.eu> +olivier.berger@it-sudparis.eu +Chris Wilson <chris@chris-wilson.co.uk> +notmuch@notmuchmail.org +Carl Worth <cworth@cworth.org> +Alexander Botero-Lowry <alex.boterolowry@gmail.com> +Keith Packard <keithp@keithp.com> +Jjgod Jiang <gzjjgod@gmail.com> +Rolland Santimano <rollandsantimano@yahoo.com> +Jan Janak <jan@ryngle.com> +Stewart Smith <stewart@flamingspork.com> +Lars Kellogg-Stedman <lars@seas.harvard.edu> +notmuch <notmuch@notmuchmail.org> +Alex Botero-Lowry <alex.boterolowry@gmail.com> +Ingmar Vanhassel <ingmar@exherbo.org> +Aron Griffis <agriffis@n01se.net> +Adrian Perez de Castro <aperez@igalia.com> +Israel Herraiz <isra@herraiz.org> +Mikhail Gusarov <dottedmag@dottedmag.net> +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=sender --output=count" +notmuch address --output=sender --output=count '*' | sort -n >OUTPUT +cat <<EOF >EXPECTED +1 Adrian Perez de Castro <aperez@igalia.com> +1 Aron Griffis <agriffis@n01se.net> +1 Chris Wilson <chris@chris-wilson.co.uk> +1 François Boulogne <boulogne.f@gmail.com> +1 Ingmar Vanhassel <ingmar@exherbo.org> +1 Israel Herraiz <isra@herraiz.org> +1 Olivier Berger <olivier.berger@it-sudparis.eu> +1 Rolland Santimano <rollandsantimano@yahoo.com> +2 Alex Botero-Lowry <alex.boterolowry@gmail.com> +2 Jjgod Jiang <gzjjgod@gmail.com> +3 Stewart Smith <stewart@flamingspork.com> +4 Alexander Botero-Lowry <alex.boterolowry@gmail.com> +4 Jan Janak <jan@ryngle.com> +5 Lars Kellogg-Stedman <lars@seas.harvard.edu> +5 Mikhail Gusarov <dottedmag@dottedmag.net> +7 Keith Packard <keithp@keithp.com> +12 Carl Worth <cworth@cworth.org> +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=recipients --output=address" +notmuch address --output=recipients --output=address '*' >OUTPUT +cat <<EOF >EXPECTED +allan@archlinux.org +aur-general@archlinux.org +olivier.berger@it-sudparis.eu +notmuch@notmuchmail.org +notmuch@notmuchmail.org +keithp@keithp.com +dottedmag@dottedmag.net +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=sender --output=address --output=count" +notmuch address --output=sender --output=address --output=count '*' | sort -n >OUTPUT +cat <<EOF >EXPECTED +1 agriffis@n01se.net +1 aperez@igalia.com +1 boulogne.f@gmail.com +1 chris@chris-wilson.co.uk +1 ingmar@exherbo.org +1 isra@herraiz.org +1 olivier.berger@it-sudparis.eu +1 rollandsantimano@yahoo.com +2 alex.boterolowry@gmail.com +2 gzjjgod@gmail.com +3 stewart@flamingspork.com +4 alex.boterolowry@gmail.com +4 jan@ryngle.com +5 dottedmag@dottedmag.net +5 lars@seas.harvard.edu +7 keithp@keithp.com +12 cworth@cworth.org +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=count --format=json" +# Since the iteration order of GHashTable is not specified, we +# preprocess and sort the results to keep the order stable here. +notmuch address --output=count --format=json '*' | \ + sed -e 's/^\[//' -e 's/]$//' -e 's/,$//' | sort >OUTPUT +cat <<EOF >EXPECTED +{"name": "Adrian Perez de Castro", "address": "aperez@igalia.com", "name-addr": "Adrian Perez de Castro <aperez@igalia.com>", "count": 1} +{"name": "Alex Botero-Lowry", "address": "alex.boterolowry@gmail.com", "name-addr": "Alex Botero-Lowry <alex.boterolowry@gmail.com>", "count": 2} +{"name": "Alexander Botero-Lowry", "address": "alex.boterolowry@gmail.com", "name-addr": "Alexander Botero-Lowry <alex.boterolowry@gmail.com>", "count": 4} +{"name": "Aron Griffis", "address": "agriffis@n01se.net", "name-addr": "Aron Griffis <agriffis@n01se.net>", "count": 1} +{"name": "Carl Worth", "address": "cworth@cworth.org", "name-addr": "Carl Worth <cworth@cworth.org>", "count": 12} +{"name": "Chris Wilson", "address": "chris@chris-wilson.co.uk", "name-addr": "Chris Wilson <chris@chris-wilson.co.uk>", "count": 1} +{"name": "François Boulogne", "address": "boulogne.f@gmail.com", "name-addr": "François Boulogne <boulogne.f@gmail.com>", "count": 1} +{"name": "Ingmar Vanhassel", "address": "ingmar@exherbo.org", "name-addr": "Ingmar Vanhassel <ingmar@exherbo.org>", "count": 1} +{"name": "Israel Herraiz", "address": "isra@herraiz.org", "name-addr": "Israel Herraiz <isra@herraiz.org>", "count": 1} +{"name": "Jan Janak", "address": "jan@ryngle.com", "name-addr": "Jan Janak <jan@ryngle.com>", "count": 4} +{"name": "Jjgod Jiang", "address": "gzjjgod@gmail.com", "name-addr": "Jjgod Jiang <gzjjgod@gmail.com>", "count": 2} +{"name": "Keith Packard", "address": "keithp@keithp.com", "name-addr": "Keith Packard <keithp@keithp.com>", "count": 7} +{"name": "Lars Kellogg-Stedman", "address": "lars@seas.harvard.edu", "name-addr": "Lars Kellogg-Stedman <lars@seas.harvard.edu>", "count": 5} +{"name": "Mikhail Gusarov", "address": "dottedmag@dottedmag.net", "name-addr": "Mikhail Gusarov <dottedmag@dottedmag.net>", "count": 5} +{"name": "Olivier Berger", "address": "olivier.berger@it-sudparis.eu", "name-addr": "Olivier Berger <olivier.berger@it-sudparis.eu>", "count": 1} +{"name": "Rolland Santimano", "address": "rollandsantimano@yahoo.com", "name-addr": "Rolland Santimano <rollandsantimano@yahoo.com>", "count": 1} +{"name": "Stewart Smith", "address": "stewart@flamingspork.com", "name-addr": "Stewart Smith <stewart@flamingspork.com>", "count": 3} +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--deduplicate=no --sort=oldest-first --output=sender" +notmuch address --deduplicate=no --sort=oldest-first --output=sender '*' >OUTPUT +cat <<EOF >EXPECTED +Mikhail Gusarov <dottedmag@dottedmag.net> +Mikhail Gusarov <dottedmag@dottedmag.net> +Carl Worth <cworth@cworth.org> +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Mikhail Gusarov <dottedmag@dottedmag.net> +Alex Botero-Lowry <alex.boterolowry@gmail.com> +Carl Worth <cworth@cworth.org> +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Mikhail Gusarov <dottedmag@dottedmag.net> +Mikhail Gusarov <dottedmag@dottedmag.net> +Keith Packard <keithp@keithp.com> +Keith Packard <keithp@keithp.com> +Keith Packard <keithp@keithp.com> +Jan Janak <jan@ryngle.com> +Jan Janak <jan@ryngle.com> +Jan Janak <jan@ryngle.com> +Israel Herraiz <isra@herraiz.org> +Adrian Perez de Castro <aperez@igalia.com> +Aron Griffis <agriffis@n01se.net> +Ingmar Vanhassel <ingmar@exherbo.org> +Alex Botero-Lowry <alex.boterolowry@gmail.com> +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Stewart Smith <stewart@flamingspork.com> +Stewart Smith <stewart@flamingspork.com> +Keith Packard <keithp@keithp.com> +Keith Packard <keithp@keithp.com> +Keith Packard <keithp@keithp.com> +Stewart Smith <stewart@flamingspork.com> +Jjgod Jiang <gzjjgod@gmail.com> +Jan Janak <jan@ryngle.com> +Rolland Santimano <rollandsantimano@yahoo.com> +Alexander Botero-Lowry <alex.boterolowry@gmail.com> +Jjgod Jiang <gzjjgod@gmail.com> +Alexander Botero-Lowry <alex.boterolowry@gmail.com> +Alexander Botero-Lowry <alex.boterolowry@gmail.com> +Keith Packard <keithp@keithp.com> +Alexander Botero-Lowry <alex.boterolowry@gmail.com> +Carl Worth <cworth@cworth.org> +Carl Worth <cworth@cworth.org> +Carl Worth <cworth@cworth.org> +Carl Worth <cworth@cworth.org> +Carl Worth <cworth@cworth.org> +Carl Worth <cworth@cworth.org> +Carl Worth <cworth@cworth.org> +Carl Worth <cworth@cworth.org> +Carl Worth <cworth@cworth.org> +Carl Worth <cworth@cworth.org> +Chris Wilson <chris@chris-wilson.co.uk> +Olivier Berger <olivier.berger@it-sudparis.eu> +François Boulogne <boulogne.f@gmail.com> +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--deduplicate=no --sort=newest-first --output=sender --output=recipients" +notmuch address --deduplicate=no --sort=newest-first --output=sender --output=recipients path:foo/new >OUTPUT +cat <<EOF >EXPECTED +Mikhail Gusarov <dottedmag@dottedmag.net> +notmuch@notmuchmail.org +Mikhail Gusarov <dottedmag@dottedmag.net> +notmuch@notmuchmail.org +Lars Kellogg-Stedman <lars@seas.harvard.edu> +notmuch@notmuchmail.org +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--deduplicate=address --output=sender --output=recipients" +notmuch address --deduplicate=address --output=sender --output=recipients '*' | sort >OUTPUT +cat <<EOF >EXPECTED +"Discussion about the Arch User Repository (AUR)" <aur-general@archlinux.org> +Adrian Perez de Castro <aperez@igalia.com> +Alexander Botero-Lowry <alex.boterolowry@gmail.com> +Allan McRae <allan@archlinux.org> +Aron Griffis <agriffis@n01se.net> +Carl Worth <cworth@cworth.org> +Chris Wilson <chris@chris-wilson.co.uk> +François Boulogne <boulogne.f@gmail.com> +Ingmar Vanhassel <ingmar@exherbo.org> +Israel Herraiz <isra@herraiz.org> +Jan Janak <jan@ryngle.com> +Jjgod Jiang <gzjjgod@gmail.com> +Keith Packard <keithp@keithp.com> +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Mikhail Gusarov <dottedmag@dottedmag.net> +Olivier Berger <olivier.berger@it-sudparis.eu> +Rolland Santimano <rollandsantimano@yahoo.com> +Stewart Smith <stewart@flamingspork.com> +notmuch@notmuchmail.org +EOF +test_expect_equal_file EXPECTED OUTPUT + +generate_message '[from]="Foo Bar <foo.bar@example.com>"' +generate_message '[from]="Foo Bar <Foo.Bar@Example.Com>"' +generate_message '[from]="Foo Bar <foo.bar@example.com>"' +generate_message '[from]="Bar <Foo.Bar@Example.Com>"' +generate_message '[from]="Foo <foo.bar@example.com>"' +generate_message '[from]="<foo.bar@example.com>"' +generate_message '[from]="foo.bar@example.com"' +generate_message '[from]="Baz <foo.bar+baz@example.com>"' +generate_message '[from]="Foo Bar <foo.bar+baz@example.com>"' +generate_message '[from]="Baz <foo.bar+baz@example.com>"' +notmuch new > /dev/null + +test_begin_subtest "--deduplicate=no --output=sender" +notmuch address --deduplicate=no --output=sender from:example.com | sort >OUTPUT +cat <<EOF >EXPECTED +Bar <Foo.Bar@Example.Com> +Baz <foo.bar+baz@example.com> +Baz <foo.bar+baz@example.com> +Foo <foo.bar@example.com> +Foo Bar <Foo.Bar@Example.Com> +Foo Bar <foo.bar+baz@example.com> +Foo Bar <foo.bar@example.com> +Foo Bar <foo.bar@example.com> +foo.bar@example.com +foo.bar@example.com +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--deduplicate=mailbox --output=sender --output=count" +notmuch address --deduplicate=mailbox --output=sender --output=count from:example.com | sort -n >OUTPUT +cat <<EOF >EXPECTED +1 Bar <Foo.Bar@Example.Com> +1 Foo <foo.bar@example.com> +1 Foo Bar <Foo.Bar@Example.Com> +1 Foo Bar <foo.bar+baz@example.com> +2 Baz <foo.bar+baz@example.com> +2 Foo Bar <foo.bar@example.com> +2 foo.bar@example.com +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--deduplicate=address --output=sender --output=count" +notmuch address --deduplicate=address --output=sender --output=count from:example.com | sort -n >OUTPUT +cat <<EOF >EXPECTED +3 Baz <foo.bar+baz@example.com> +7 Foo Bar <foo.bar@example.com> +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T100-search-by-folder.sh b/test/T100-search-by-folder.sh new file mode 100755 index 00000000..a090f3d2 --- /dev/null +++ b/test/T100-search-by-folder.sh @@ -0,0 +1,149 @@ +#!/usr/bin/env bash +test_description='"notmuch search" by folder: and path: (with variations)' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_message '[dir]=bad' '[subject]="To the bone"' +add_message '[dir]=.' '[subject]="Top level"' +add_message '[dir]=bad/news' '[subject]="Bears"' +mkdir -p "${MAIL_DIR}/duplicate/bad/news" +cp "$gen_msg_filename" "${MAIL_DIR}/duplicate/bad/news" + +add_message '[dir]=things' '[subject]="These are a few"' +add_message '[dir]=things/favorite' '[subject]="Raindrops, whiskers, kettles"' +add_message '[dir]=things/bad' '[subject]="Bites, stings, sad feelings"' + +test_begin_subtest "Single-world folder: specification (multiple results)" +output=$(notmuch search folder:bad folder:bad/news folder:things/bad | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread) +thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Bears (inbox unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bites, stings, sad feelings (inbox unread)" + +test_begin_subtest "Top level folder" +output=$(notmuch search folder:'""' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Top level (inbox unread)" + +test_begin_subtest "Two-word path to narrow results to one" +output=$(notmuch search folder:bad/news | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Bears (inbox unread)" + +test_begin_subtest "Folder search with --output=files" +output=$(notmuch search --output=files folder:bad/news | notmuch_search_files_sanitize) +test_expect_equal "$output" "MAIL_DIR/bad/news/msg-003 +MAIL_DIR/duplicate/bad/news/msg-003" + +test_begin_subtest "After removing duplicate instance of matching path" +rm -r "${MAIL_DIR}/bad/news" +notmuch new +output=$(notmuch search folder:bad/news | notmuch_search_sanitize) +test_expect_equal "$output" "" + +test_begin_subtest "Folder search with --output=files part #2" +output=$(notmuch search --output=files folder:duplicate/bad/news | notmuch_search_files_sanitize) +test_expect_equal "$output" "MAIL_DIR/duplicate/bad/news/msg-003" + +test_begin_subtest "After removing duplicate instance of matching path part #2" +output=$(notmuch search folder:duplicate/bad/news | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bears (inbox unread)" + +test_begin_subtest "After rename, old path returns nothing" +mv "${MAIL_DIR}/duplicate/bad/news" "${MAIL_DIR}/duplicate/bad/olds" +notmuch new +output=$(notmuch search folder:duplicate/bad/news | notmuch_search_sanitize) +test_expect_equal "$output" "" + +test_begin_subtest "After rename, new path returns result" +output=$(notmuch search folder:duplicate/bad/olds | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bears (inbox unread)" + +# folder: and path: searches with full corpus +rm -rf $MAIL_DIR +add_email_corpus + +# add some more dupes +cp $MAIL_DIR/foo/new/03:2, $MAIL_DIR/new +cp $MAIL_DIR/bar/baz/05:2, $MAIL_DIR/foo +notmuch new >/dev/null + +test_begin_subtest "folder: search" +output=$(notmuch search --output=files folder:foo | notmuch_search_files_sanitize | sort) +# bar/baz/05:2, is a duplicate of foo/05:2, +# new/03:2, is a duplicate of foo/new/03:2, +test_expect_equal "$output" "MAIL_DIR/bar/baz/05:2, +MAIL_DIR/foo/05:2, +MAIL_DIR/foo/06:2, +MAIL_DIR/foo/cur/07:2, +MAIL_DIR/foo/cur/08:2, +MAIL_DIR/foo/new/03:2, +MAIL_DIR/foo/new/09:2, +MAIL_DIR/foo/new/10:2, +MAIL_DIR/new/03:2," + +test_begin_subtest "top level folder: search" +output=$(notmuch search --output=files folder:'""' | notmuch_search_files_sanitize | sort) +# bar/18:2, is a duplicate of cur/51:2, +# foo/new/03:2, is a duplicate of new/03:2, +test_expect_equal "$output" "MAIL_DIR/01:2, +MAIL_DIR/02:2, +MAIL_DIR/bar/18:2, +MAIL_DIR/cur/29:2, +MAIL_DIR/cur/30:2, +MAIL_DIR/cur/31:2, +MAIL_DIR/cur/32:2, +MAIL_DIR/cur/33:2, +MAIL_DIR/cur/34:2, +MAIL_DIR/cur/35:2, +MAIL_DIR/cur/36:2, +MAIL_DIR/cur/37:2, +MAIL_DIR/cur/38:2, +MAIL_DIR/cur/39:2, +MAIL_DIR/cur/40:2, +MAIL_DIR/cur/41:2, +MAIL_DIR/cur/42:2, +MAIL_DIR/cur/43:2, +MAIL_DIR/cur/44:2, +MAIL_DIR/cur/45:2, +MAIL_DIR/cur/46:2, +MAIL_DIR/cur/47:2, +MAIL_DIR/cur/48:2, +MAIL_DIR/cur/49:2, +MAIL_DIR/cur/50:2, +MAIL_DIR/cur/51:2, +MAIL_DIR/cur/52:2, +MAIL_DIR/cur/53:2, +MAIL_DIR/foo/new/03:2, +MAIL_DIR/new/03:2, +MAIL_DIR/new/04:2," + +test_begin_subtest "path: search" +output=$(notmuch search --output=files path:"bar" | notmuch_search_files_sanitize | sort) +# cur/51:2, is a duplicate of bar/18:2, +test_expect_equal "$output" "MAIL_DIR/bar/17:2, +MAIL_DIR/bar/18:2, +MAIL_DIR/cur/51:2," + +test_begin_subtest "top level path: search" +output=$(notmuch search --output=files path:'""' | notmuch_search_files_sanitize | sort) +test_expect_equal "$output" "MAIL_DIR/01:2, +MAIL_DIR/02:2," + +test_begin_subtest "recursive path: search" +output=$(notmuch search --output=files path:"bar/**" | notmuch_search_files_sanitize | sort) +# cur/51:2, is a duplicate of bar/18:2, +# foo/05:2, is a duplicate of bar/baz/05:2, +test_expect_equal "$output" "MAIL_DIR/bar/17:2, +MAIL_DIR/bar/18:2, +MAIL_DIR/bar/baz/05:2, +MAIL_DIR/bar/baz/23:2, +MAIL_DIR/bar/baz/24:2, +MAIL_DIR/bar/baz/cur/25:2, +MAIL_DIR/bar/baz/cur/26:2, +MAIL_DIR/bar/baz/new/27:2, +MAIL_DIR/bar/baz/new/28:2, +MAIL_DIR/bar/cur/19:2, +MAIL_DIR/bar/cur/20:2, +MAIL_DIR/bar/new/21:2, +MAIL_DIR/bar/new/22:2, +MAIL_DIR/cur/51:2, +MAIL_DIR/foo/05:2," + +test_done diff --git a/test/T110-search-position-overlap-bug.sh b/test/T110-search-position-overlap-bug.sh new file mode 100755 index 00000000..f4d5ee14 --- /dev/null +++ b/test/T110-search-position-overlap-bug.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +# Test to demonstrate a position overlap bug. +# +# At one point, notmuch would index terms incorrectly in the case of +# calling index_terms multiple times for a single field. The term +# generator was being reset to position 0 each time. This means that +# with text such as: +# +# To: a@b.c, x@y.z +# +# one could get a bogus match by searching for: +# +# To: a@y.c +# +# Thanks to Mark Anderson for reporting the bug, (and providing a nice, +# minimal test case that inspired what is used here), in +# id:3wd4o8wa7fx.fsf@testarossa.amd.com + +test_description='that notmuch does not overlap term positions' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_message '[to]="a@b.c, x@y.z"' + +test_begin_subtest "Search for a@b.c matches" +output=$(notmuch search a@b.c | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #1 (inbox unread)" + +test_begin_subtest "Search for x@y.z matches" +output=$(notmuch search x@y.z | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #1 (inbox unread)" + +test_begin_subtest "Search for a@y.c must not match" +output=$(notmuch search a@y.c | notmuch_search_sanitize) +test_expect_equal "$output" "" + +test_done diff --git a/test/T120-search-insufficient-from-quoting.sh b/test/T120-search-insufficient-from-quoting.sh new file mode 100755 index 00000000..509fec8b --- /dev/null +++ b/test/T120-search-insufficient-from-quoting.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +test_description='messages with unquoted . in name' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_message \ + '[from]="Some.Name for Someone <bugs@quoting.com>"' \ + '[subject]="This message needs more quoting on the From line"' + +add_message \ + '[from]="\"Some.Name for Someone\" <bugs@quoting.com>"' \ + '[subject]="This message has necessary quoting in place"' + +add_message \ + '[from]="No.match Here <filler@mail.com>"' \ + '[subject]="This message needs more quoting on the From line"' + +add_message \ + '[from]="\"No.match Here\" <filler@mail.com>"' \ + '[subject]="This message has necessary quoting in place"' + + +test_begin_subtest "Search by first name" +output=$(notmuch search from:Some.Name | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Some.Name for Someone; This message needs more quoting on the From line (inbox unread) +thread:XXX 2001-01-05 [1/1] Some.Name for Someone; This message has necessary quoting in place (inbox unread)" + +test_begin_subtest "Search by last name:" +output=$(notmuch search from:Someone | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Some.Name for Someone; This message needs more quoting on the From line (inbox unread) +thread:XXX 2001-01-05 [1/1] Some.Name for Someone; This message has necessary quoting in place (inbox unread)" + +test_begin_subtest "Search by address:" +output=$(notmuch search from:bugs@quoting.com | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Some.Name for Someone; This message needs more quoting on the From line (inbox unread) +thread:XXX 2001-01-05 [1/1] Some.Name for Someone; This message has necessary quoting in place (inbox unread)" + +test_begin_subtest "Search for all messages:" +output=$(notmuch search '*' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Some.Name for Someone; This message needs more quoting on the From line (inbox unread) +thread:XXX 2001-01-05 [1/1] Some.Name for Someone; This message has necessary quoting in place (inbox unread) +thread:XXX 2001-01-05 [1/1] No.match Here; This message needs more quoting on the From line (inbox unread) +thread:XXX 2001-01-05 [1/1] No.match Here; This message has necessary quoting in place (inbox unread)" + +test_done diff --git a/test/T130-search-limiting.sh b/test/T130-search-limiting.sh new file mode 100755 index 00000000..8a30e7ab --- /dev/null +++ b/test/T130-search-limiting.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +test_description='"notmuch search" --offset and --limit parameters' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +for outp in messages threads; do + test_begin_subtest "${outp}: limit does the right thing" + notmuch search --output=${outp} "*" | head -n 20 >expected + notmuch search --output=${outp} --limit=20 "*" >output + test_expect_equal_file expected output + + test_begin_subtest "${outp}: concatenation of limited searches" + notmuch search --output=${outp} "*" | head -n 20 >expected + notmuch search --output=${outp} --limit=10 "*" >output + notmuch search --output=${outp} --limit=10 --offset=10 "*" >>output + test_expect_equal_file expected output + + test_begin_subtest "${outp}: limit larger than result set" + N=`notmuch count --output=${outp} "*"` + notmuch search --output=${outp} "*" >expected + notmuch search --output=${outp} --limit=$((1 + ${N})) "*" >output + test_expect_equal_file expected output + + test_begin_subtest "${outp}: limit = 0" + test_expect_equal "`notmuch search --output=${outp} --limit=0 "*"`" "" + + test_begin_subtest "${outp}: offset does the right thing" + # note: tail -n +N is 1-based + notmuch search --output=${outp} "*" | tail -n +21 >expected + notmuch search --output=${outp} --offset=20 "*" >output + test_expect_equal_file expected output + + test_begin_subtest "${outp}: offset = 0" + notmuch search --output=${outp} "*" >expected + notmuch search --output=${outp} --offset=0 "*" >output + test_expect_equal_file expected output + + test_begin_subtest "${outp}: negative offset" + notmuch search --output=${outp} "*" | tail -n 20 >expected + notmuch search --output=${outp} --offset=-20 "*" >output + test_expect_equal_file expected output + + test_begin_subtest "${outp}: negative offset" + notmuch search --output=${outp} "*" | tail -n 1 >expected + notmuch search --output=${outp} --offset=-1 "*" >output + test_expect_equal_file expected output + + test_begin_subtest "${outp}: negative offset combined with limit" + notmuch search --output=${outp} "*" | tail -n 20 | head -n 10 >expected + notmuch search --output=${outp} --offset=-20 --limit=10 "*" >output + test_expect_equal_file expected output + + test_begin_subtest "${outp}: negative offset combined with equal limit" + notmuch search --output=${outp} "*" | tail -n 20 >expected + notmuch search --output=${outp} --offset=-20 --limit=20 "*" >output + test_expect_equal_file expected output + + test_begin_subtest "${outp}: negative offset combined with large limit" + notmuch search --output=${outp} "*" | tail -n 20 >expected + notmuch search --output=${outp} --offset=-20 --limit=50 "*" >output + test_expect_equal_file expected output + + test_begin_subtest "${outp}: negative offset larger then results" + N=`notmuch count --output=${outp} "*"` + notmuch search --output=${outp} "*" >expected + notmuch search --output=${outp} --offset=-$((1 + ${N})) "*" >output + test_expect_equal_file expected output +done + +test_done diff --git a/test/T140-excludes.sh b/test/T140-excludes.sh new file mode 100755 index 00000000..0cf69975 --- /dev/null +++ b/test/T140-excludes.sh @@ -0,0 +1,445 @@ +#!/usr/bin/env bash +test_description='"notmuch search, count and show" with excludes in several variations' +. $(dirname "$0")/test-lib.sh || exit 1 + +# Generates a thread consisting of a top level message and 'length' +# replies. The subject of the top message 'subject: top message" +# and the subject of the nth reply in the thread is "subject: reply n" +generate_thread () +{ + local subject="$1" + local length="$2" + generate_message '[subject]="'"${subject}: top message"'"' '[body]="'"body of top message"'"' + parent_id=$gen_msg_id + gen_thread_msg_id[0]=$gen_msg_id + for i in `seq 1 $length` + do + generate_message '[subject]="'"${subject}: reply $i"'"' \ + "[in-reply-to]=\<$parent_id\>" \ + '[body]="'"body of reply $i"'"' + gen_thread_msg_id[$i]=$gen_msg_id + parent_id=$gen_msg_id + done + notmuch new > /dev/null + # We cannot retrieve the thread_id until after we have run notmuch new. + gen_thread_id=`notmuch search --output=threads id:${gen_thread_msg_id[0]}` +} + +############################################# +# These are the original search exclude tests. + +test_begin_subtest "Search, exclude \"deleted\" messages from search" +notmuch config set search.exclude_tags deleted +generate_message '[subject]="Not deleted"' +not_deleted_id=$gen_msg_id +generate_message '[subject]="Deleted"' +notmuch new > /dev/null +notmuch tag +deleted id:$gen_msg_id +deleted_id=$gen_msg_id +output=$(notmuch search subject:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)" + +test_begin_subtest "Search, exclude \"deleted\" messages from message search" +output=$(notmuch search --output=messages subject:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "id:$not_deleted_id" + +test_begin_subtest "Search, exclude \"deleted\" messages from message search --exclude=false" +output=$(notmuch search --exclude=false --output=messages subject:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "id:$not_deleted_id +id:$deleted_id" + +test_begin_subtest "Search, exclude \"deleted\" messages from message search (non-existent exclude-tag)" +notmuch config set search.exclude_tags deleted non_existent_tag +output=$(notmuch search --output=messages subject:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "id:$not_deleted_id" +notmuch config set search.exclude_tags deleted + +test_begin_subtest "Search, exclude \"deleted\" messages from search, overridden" +output=$(notmuch search subject:deleted and tag:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Deleted (deleted inbox unread)" + +test_begin_subtest "Search, exclude \"deleted\" messages from threads" +add_message '[subject]="Not deleted reply"' '[in-reply-to]="<$gen_msg_id>"' +output=$(notmuch search subject:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread) +thread:XXX 2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inbox unread)" + +test_begin_subtest "Search, don't exclude \"deleted\" messages when --exclude=flag specified" +output=$(notmuch search --exclude=flag subject:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread) +thread:XXX 2001-01-05 [1/2] Notmuch Test Suite; Deleted (deleted inbox unread)" + +test_begin_subtest "Search, don't exclude \"deleted\" messages from search if not configured" +notmuch config set search.exclude_tags +output=$(notmuch search subject:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread) +thread:XXX 2001-01-05 [2/2] Notmuch Test Suite; Deleted (deleted inbox unread)" + + +######################################################## +# We construct some threads for the tests. We use the tag "test" to +# indicate which messages we will search for. + +# A thread of deleted messages; test matches one of them. +generate_thread "All messages excluded: single match" 5 +notmuch tag +deleted $gen_thread_id +notmuch tag +test id:${gen_thread_msg_id[2]} + +# A thread of deleted messages; test matches two of them. +generate_thread "All messages excluded: double match" 5 +notmuch tag +deleted $gen_thread_id +notmuch tag +test id:${gen_thread_msg_id[2]} +notmuch tag +test id:${gen_thread_msg_id[4]} + +# A thread some messages deleted; test only matches a deleted message. +generate_thread "Some messages excluded: single excluded match" 5 +notmuch tag +deleted +test id:${gen_thread_msg_id[3]} + +# A thread some messages deleted; test only matches a non-deleted message. +generate_thread "Some messages excluded: single non-excluded match" 5 +notmuch tag +deleted id:${gen_thread_msg_id[2]} +notmuch tag +test id:${gen_thread_msg_id[4]} + +# A thread no messages deleted; test matches a message. +generate_thread "No messages excluded: single match" 5 +notmuch tag +test id:${gen_thread_msg_id[3]} + +# Temporarily remove excludes to get list of matching messages +notmuch config set search.exclude_tags +matching_message_ids=( `notmuch search --output=messages tag:test` ) +notmuch config set search.exclude_tags deleted + +######################################### +# Notmuch search tests + +test_begin_subtest "Search, default exclusion (thread summary)" +output=$(notmuch search tag:test | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (deleted inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)" + +test_begin_subtest "Search, default exclusion (messages)" +output=$(notmuch search --output=messages tag:test | notmuch_search_sanitize) +test_expect_equal "$output" "${matching_message_ids[4]} +${matching_message_ids[5]}" + +test_begin_subtest "Search, exclude=true (thread summary)" +output=$(notmuch search --exclude=true tag:test | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (deleted inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)" + +test_begin_subtest "Search, exclude=true (messages)" +output=$(notmuch search --exclude=true --output=messages tag:test | notmuch_search_sanitize) +test_expect_equal "$output" "${matching_message_ids[4]} +${matching_message_ids[5]}" + +test_begin_subtest "Search, exclude=false (thread summary)" +output=$(notmuch search --exclude=false tag:test | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (deleted inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)" + +test_begin_subtest "Search, exclude=false (messages)" +output=$(notmuch search --exclude=false --output=messages tag:test | notmuch_search_sanitize) +test_expect_equal "$output" "${matching_message_ids[0]} +${matching_message_ids[1]} +${matching_message_ids[2]} +${matching_message_ids[3]} +${matching_message_ids[4]} +${matching_message_ids[5]}" + +test_begin_subtest "Search, exclude=flag (thread summary)" +output=$(notmuch search --exclude=flag tag:test | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [0/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [0/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [0/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (deleted inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)" + +test_begin_subtest "Search, exclude=flag (messages)" +output=$(notmuch search --exclude=flag --output=messages tag:test | notmuch_search_sanitize) +test_expect_equal "$output" "${matching_message_ids[0]} +${matching_message_ids[1]} +${matching_message_ids[2]} +${matching_message_ids[3]} +${matching_message_ids[4]} +${matching_message_ids[5]}" + +test_begin_subtest "Search, exclude=all (thread summary)" +output=$(notmuch search --exclude=all tag:test | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)" + +test_begin_subtest "Search, exclude=all (messages)" +output=$(notmuch search --exclude=all --output=messages tag:test | notmuch_search_sanitize) +test_expect_equal "$output" "${matching_message_ids[4]} +${matching_message_ids[5]}" + +test_begin_subtest "Search, default exclusion: tag in query (thread summary)" +output=$(notmuch search tag:test and tag:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)" + +test_begin_subtest "Search, default exclusion: tag in query (messages)" +output=$(notmuch search --output=messages tag:test and tag:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "${matching_message_ids[0]} +${matching_message_ids[1]} +${matching_message_ids[2]} +${matching_message_ids[3]}" + +test_begin_subtest "Search, exclude=true: tag in query (thread summary)" +output=$(notmuch search --exclude=true tag:test and tag:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)" + +test_begin_subtest "Search, exclude=true: tag in query (messages)" +output=$(notmuch search --exclude=true --output=messages tag:test and tag:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "${matching_message_ids[0]} +${matching_message_ids[1]} +${matching_message_ids[2]} +${matching_message_ids[3]}" + +test_begin_subtest "Search, exclude=false: tag in query (thread summary)" +output=$(notmuch search --exclude=false tag:test and tag:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)" + +test_begin_subtest "Search, exclude=false: tag in query (messages)" +output=$(notmuch search --exclude=false --output=messages tag:test and tag:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "${matching_message_ids[0]} +${matching_message_ids[1]} +${matching_message_ids[2]} +${matching_message_ids[3]}" + +test_begin_subtest "Search, exclude=flag: tag in query (thread summary)" +output=$(notmuch search --exclude=flag tag:test and tag:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)" + +test_begin_subtest "Search, exclude=flag: tag in query (messages)" +output=$(notmuch search --exclude=flag --output=messages tag:test and tag:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "${matching_message_ids[0]} +${matching_message_ids[1]} +${matching_message_ids[2]} +${matching_message_ids[3]}" + +test_begin_subtest "Search, exclude=all: tag in query (thread summary)" +output=$(notmuch search --exclude=all tag:test and tag:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread) +thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)" + +test_begin_subtest "Search, exclude=all: tag in query (messages)" +output=$(notmuch search --exclude=all --output=messages tag:test and tag:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "${matching_message_ids[0]} +${matching_message_ids[1]} +${matching_message_ids[2]} +${matching_message_ids[3]}" + +######################################################### +# Notmuch count tests + +test_begin_subtest "Count, default exclusion (messages)" +output=$(notmuch count tag:test) +test_expect_equal "$output" "2" + +test_begin_subtest "Count, default exclusion (threads)" +output=$(notmuch count --output=threads tag:test) +test_expect_equal "$output" "2" + +test_begin_subtest "Count, exclude=true (messages)" +output=$(notmuch count --exclude=true tag:test) +test_expect_equal "$output" "2" + +test_begin_subtest "Count, exclude=true (threads)" +output=$(notmuch count --output=threads --exclude=true tag:test) +test_expect_equal "$output" "2" + +test_begin_subtest "Count, exclude=false (messages)" +output=$(notmuch count --exclude=false tag:test) +test_expect_equal "$output" "6" + +test_begin_subtest "Count, exclude=false (threads)" +output=$(notmuch count --output=threads --exclude=false tag:test) +test_expect_equal "$output" "5" + +test_begin_subtest "Count, default exclusion: tag in query (messages)" +output=$(notmuch count tag:test and tag:deleted) +test_expect_equal "$output" "4" + +test_begin_subtest "Count, default exclusion: tag in query (threads)" +output=$(notmuch count --output=threads tag:test and tag:deleted) +test_expect_equal "$output" "3" + +test_begin_subtest "Count, exclude=true: tag in query (messages)" +output=$(notmuch count --exclude=true tag:test and tag:deleted) +test_expect_equal "$output" "4" + +test_begin_subtest "Count, exclude=true: tag in query (threads)" +output=$(notmuch count --output=threads --exclude=true tag:test and tag:deleted) +test_expect_equal "$output" "3" + +test_begin_subtest "Count, exclude=false: tag in query (messages)" +output=$(notmuch count --exclude=false tag:test and tag:deleted) +test_expect_equal "$output" "4" + +test_begin_subtest "Count, exclude=false: tag in query (threads)" +output=$(notmuch count --output=threads --exclude=false tag:test and tag:deleted) +test_expect_equal "$output" "3" + +############################################################# +# Show tests + +test_begin_subtest "Show, default exclusion" +output=$(notmuch show tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{") +test_expect_equal "$output" "message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 4 +message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 3" + +test_begin_subtest "Show, default exclusion (entire-thread)" +output=$(notmuch show --entire-thread tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{") +test_expect_equal "$output" "message{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: top message +message{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 1 +message{ id:XXXXX depth:2 match:0 excluded:1 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 2 +message{ id:XXXXX depth:3 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 3 +message{ id:XXXXX depth:4 match:1 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 4 +message{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 5 +message{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: top message +message{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 1 +message{ id:XXXXX depth:2 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 2 +message{ id:XXXXX depth:3 match:1 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 3 +message{ id:XXXXX depth:4 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 4 +message{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 5" + +test_begin_subtest "Show, exclude=true" +output=$(notmuch show --exclude=true tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{") +test_expect_equal "$output" "message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 4 +message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 3" + +test_begin_subtest "Show, exclude=true (entire-thread)" +output=$(notmuch show --entire-thread --exclude=true tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{") +test_expect_equal "$output" "message{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: top message +message{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 1 +message{ id:XXXXX depth:2 match:0 excluded:1 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 2 +message{ id:XXXXX depth:3 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 3 +message{ id:XXXXX depth:4 match:1 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 4 +message{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 5 +message{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: top message +message{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 1 +message{ id:XXXXX depth:2 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 2 +message{ id:XXXXX depth:3 match:1 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 3 +message{ id:XXXXX depth:4 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 4 +message{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 5" + +test_begin_subtest "Show, exclude=false" +output=$(notmuch show --exclude=false tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{") +test_expect_equal "$output" "message{ id:XXXXX depth:0 match:1 excluded:1 filename:XXXXX +Subject: All messages excluded: single match: reply 2 +message{ id:XXXXX depth:0 match:1 excluded:1 filename:XXXXX +Subject: All messages excluded: double match: reply 2 +message{ id:XXXXX depth:1 match:1 excluded:1 filename:XXXXX +Subject: All messages excluded: double match: reply 4 +message{ id:XXXXX depth:0 match:1 excluded:1 filename:XXXXX +Subject: Some messages excluded: single excluded match: reply 3 +message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 4 +message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 3" + +test_begin_subtest "Show, exclude=false (entire-thread)" +output=$(notmuch show --entire-thread --exclude=false tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{") +test_expect_equal "$output" "message{ id:XXXXX depth:0 match:0 excluded:1 filename:XXXXX +Subject: All messages excluded: single match: top message +message{ id:XXXXX depth:1 match:0 excluded:1 filename:XXXXX +Subject: All messages excluded: single match: reply 1 +message{ id:XXXXX depth:2 match:1 excluded:1 filename:XXXXX +Subject: All messages excluded: single match: reply 2 +message{ id:XXXXX depth:3 match:0 excluded:1 filename:XXXXX +Subject: All messages excluded: single match: reply 3 +message{ id:XXXXX depth:4 match:0 excluded:1 filename:XXXXX +Subject: All messages excluded: single match: reply 4 +message{ id:XXXXX depth:5 match:0 excluded:1 filename:XXXXX +Subject: All messages excluded: single match: reply 5 +message{ id:XXXXX depth:0 match:0 excluded:1 filename:XXXXX +Subject: All messages excluded: double match: top message +message{ id:XXXXX depth:1 match:0 excluded:1 filename:XXXXX +Subject: All messages excluded: double match: reply 1 +message{ id:XXXXX depth:2 match:1 excluded:1 filename:XXXXX +Subject: All messages excluded: double match: reply 2 +message{ id:XXXXX depth:3 match:0 excluded:1 filename:XXXXX +Subject: All messages excluded: double match: reply 3 +message{ id:XXXXX depth:4 match:1 excluded:1 filename:XXXXX +Subject: All messages excluded: double match: reply 4 +message{ id:XXXXX depth:5 match:0 excluded:1 filename:XXXXX +Subject: All messages excluded: double match: reply 5 +message{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single excluded match: top message +message{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single excluded match: reply 1 +message{ id:XXXXX depth:2 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single excluded match: reply 2 +message{ id:XXXXX depth:3 match:1 excluded:1 filename:XXXXX +Subject: Some messages excluded: single excluded match: reply 3 +message{ id:XXXXX depth:4 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single excluded match: reply 4 +message{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single excluded match: reply 5 +message{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: top message +message{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 1 +message{ id:XXXXX depth:2 match:0 excluded:1 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 2 +message{ id:XXXXX depth:3 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 3 +message{ id:XXXXX depth:4 match:1 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 4 +message{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX +Subject: Some messages excluded: single non-excluded match: reply 5 +message{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: top message +message{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 1 +message{ id:XXXXX depth:2 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 2 +message{ id:XXXXX depth:3 match:1 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 3 +message{ id:XXXXX depth:4 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 4 +message{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX +Subject: No messages excluded: single match: reply 5" + + +test_done diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh new file mode 100755 index 00000000..208b4b98 --- /dev/null +++ b/test/T150-tagging.sh @@ -0,0 +1,313 @@ +#!/usr/bin/env bash +test_description='"notmuch tag"' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_message '[subject]=One' +add_message '[subject]=Two' + +test_begin_subtest "Adding tags" +notmuch tag +tag1 +tag2 +tag3 \* +output=$(notmuch search \* | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 tag2 tag3 unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 tag2 tag3 unread)" + +test_begin_subtest "Removing tags" +notmuch tag -tag1 -tag2 \* +output=$(notmuch search \* | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag3 unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag3 unread)" + +test_begin_subtest "No tag operations" +test_expect_code 1 'notmuch tag One' + +test_begin_subtest "No query" +test_expect_code 1 'notmuch tag +tag2' + +test_begin_subtest "Redundant tagging" +notmuch tag +tag1 -tag3 One +notmuch tag +tag1 -tag3 \* +output=$(notmuch search \* | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 unread)" + +test_begin_subtest "Remove all" +notmuch tag --remove-all One +notmuch tag --remove-all +tag5 +tag6 +unread Two +output=$(notmuch search \* | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One () +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (tag5 tag6 unread)" + +test_begin_subtest "Remove all with batch" +notmuch tag +tag1 One +notmuch tag --remove-all --batch <<EOF +-- One ++tag3 +tag4 +inbox -- Two +EOF +output=$(notmuch search \* | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One () +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag3 tag4)" + +test_begin_subtest "Remove all with a no-op" +notmuch tag +inbox +tag1 +unread One +notmuch tag --remove-all +foo +inbox +tag1 -foo +unread Two +output=$(notmuch search \* | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 unread)" + +test_begin_subtest "Special characters in tags" +notmuch tag +':" ' \* +notmuch tag -':" ' Two +output=$(notmuch search \* | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (:\" inbox tag1 unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 unread)" + +test_begin_subtest "Tagging order" +notmuch tag +tag4 -tag4 One +notmuch tag -tag4 +tag4 Two +output=$(notmuch search \* | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (:\" inbox tag1 unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 tag4 unread)" + +test_begin_subtest "--batch" +notmuch tag --batch <<EOF +# %20 is a space in tag +-:"%20 -tag1 +tag5 +tag6 -- One ++tag1 -tag1 -tag4 +tag4 -- Two +-tag6 One ++tag5 Two +EOF +output=$(notmuch search \* | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag5 unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag4 tag5 unread)" + +# generate a common input file for the next several tests. +cat > batch.in <<EOF +# %40 is an @ in tag ++%40 -tag5 +tag6 -- One ++tag1 -tag1 -tag4 +tag4 -- Two +-tag5 +tag6 Two +EOF + +cat > batch.expected <<EOF +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (@ inbox tag6 unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag4 tag6 unread) +EOF + +test_begin_subtest "--input" +notmuch dump --format=batch-tag > backup.tags +notmuch tag --input=batch.in +notmuch search \* | notmuch_search_sanitize > OUTPUT +notmuch restore --format=batch-tag < backup.tags +test_expect_equal_file batch.expected OUTPUT + +test_begin_subtest "--batch --input" +notmuch dump --format=batch-tag > backup.tags +notmuch tag --batch --input=batch.in +notmuch search \* | notmuch_search_sanitize > OUTPUT +notmuch restore --format=batch-tag < backup.tags +test_expect_equal_file batch.expected OUTPUT + +test_begin_subtest "--batch --input --remove-all" +notmuch dump --format=batch-tag > backup.tags +notmuch tag +foo +bar -- One +notmuch tag +tag7 -- Two +notmuch tag --batch --input=batch.in --remove-all +notmuch search \* | notmuch_search_sanitize > OUTPUT +notmuch restore --format=batch-tag < backup.tags +cat > batch_removeall.expected <<EOF +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (@ tag6) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (tag6) +EOF +test_expect_equal_file batch_removeall.expected OUTPUT +rm batch_removeall.expected + +test_begin_subtest "--batch, dependence on previous line" +notmuch dump --format=batch-tag > backup.tags +notmuch tag --batch<<EOF ++trigger -- One ++second_tag -- tag:trigger +EOF +NOTMUCH_DUMP_TAGS tag:second_tag > OUTPUT +notmuch restore --format=batch-tag < backup.tags +cat <<EOF >EXPECTED ++inbox +second_tag +tag5 +trigger +unread -- id:msg-001@notmuch-test-suite +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--batch, blank lines and comments" +notmuch dump | sort > EXPECTED +notmuch tag --batch <<EOF +# this line is a comment; the next has only white space + + +# the previous line is empty +EOF +notmuch dump | sort > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest '--batch: checking error messages' +notmuch dump --format=batch-tag > BACKUP +notmuch tag --batch <<EOF 2>OUTPUT +# the next line has a space + +# this line has no tag operations, but this is permitted in batch format. +a ++0 ++a +b +# trailing whitespace ++a +b ++c +d -- +# this is a harmless comment, do not yell about it. + +# the previous line was blank; also no yelling please ++%zz -- id:whatever +# the next non-comment line should report an an empty tag error for +# batch tagging, but not for restore ++ +e -- id:foo ++- -- id:foo +EOF + +cat <<EOF > EXPECTED +Warning: no query string [+0] +Warning: no query string [+a +b] +Warning: missing query string [+a +b ] +Warning: no query string after -- [+c +d --] +Warning: hex decoding of tag %zz failed [+%zz -- id:whatever] +Warning: empty tag forbidden [+ +e -- id:foo] +Warning: tag starting with '-' forbidden [+- -- id:foo] +EOF + +notmuch restore --format=batch-tag < BACKUP +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest '--batch: tags with quotes' +notmuch dump --format=batch-tag > BACKUP + +notmuch tag --batch <<EOF ++%22%27%22%27%22%22%27%27 -- One +-%22%27%22%27%22%22%27%27 -- One ++%22%27%22%22%22%27 -- One ++%22%27%22%27%22%22%27%27 -- Two +EOF + +cat <<EOF > EXPECTED ++%22%27%22%22%22%27 +inbox +tag5 +unread -- id:msg-001@notmuch-test-suite ++%22%27%22%27%22%22%27%27 +inbox +tag4 +tag5 +unread -- id:msg-002@notmuch-test-suite +EOF + +NOTMUCH_DUMP_TAGS > OUTPUT +notmuch restore --format=batch-tag < BACKUP +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest '--batch: tags with punctuation and space' +notmuch dump --format=batch-tag > BACKUP + +notmuch tag --batch <<EOF ++%21@%23%24%25%5e%26%2a%29-_=+%5b%7b%5c%20%7c%3b%3a%27%20%22,.%3c%60%7e -- One +-%21@%23%24%25%5e%26%2a%29-_=+%5b%7b%5c%20%7c%3b%3a%27%20%22,.%3c%60%7e -- One ++%21@%23%24%25%5e%26%2a%29-_=+%5b%7b%5c%20%7c%3b%3a%27%20%22,.%3c%20%60%7e -- Two +-%21@%23%24%25%5e%26%2a%29-_=+%5b%7b%5c%20%7c%3b%3a%27%20%22,.%3c%20%60%7e -- Two ++%21@%23%20%24%25%5e%26%2a%29-_=+%5b%7b%5c%20%7c%3b%3a%27%20%22,.%3c%60%7e -- One ++%21@%23%20%24%25%5e%26%2a%29-_=+%5b%7b%5c%20%7c%3b%3a%27%20%22,.%3c%60%7e -- Two +EOF + +cat <<EOF > EXPECTED ++%21@%23%20%24%25%5e%26%2a%29-_=+%5b%7b%5c%20%7c%3b%3a%27%20%22,.%3c%60%7e +inbox +tag4 +tag5 +unread -- id:msg-002@notmuch-test-suite ++%21@%23%20%24%25%5e%26%2a%29-_=+%5b%7b%5c%20%7c%3b%3a%27%20%22,.%3c%60%7e +inbox +tag5 +unread -- id:msg-001@notmuch-test-suite +EOF + +NOTMUCH_DUMP_TAGS > OUTPUT +notmuch restore --format=batch-tag < BACKUP +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest '--batch: unicode tags' +notmuch dump --format=batch-tag > BACKUP + +notmuch tag --batch <<EOF ++%2a@%7d%cf%b5%f4%85%80%adO3%da%a7 -- One ++=%e0%ac%95%c8%b3+%ef%aa%95%c8%a64w%c7%9d%c9%a2%cf%b3%d6%82%24B%c4%a9%c5%a1UX%ee%99%b0%27E7%ca%a4%d0%8b%5d -- One ++A%e1%a0%bc%de%8b%d5%b2V%d9%9b%f3%b5%a2%a3M%d8%a1u@%f0%a0%ac%948%7e%f0%ab%86%af%27 -- One ++R -- One ++%da%88=f%cc%b9I%ce%af%7b%c9%97%e3%b9%8bH%cb%92X%d2%8c6 -- One ++%dc%9crh%d2%86B%e5%97%a2%22t%ed%99%82d -- One ++L%df%85%ef%a1%a5m@%d3%96%c2%ab%d4%9f%ca%b8%f3%b3%a2%bf%c7%b1_u%d7%b4%c7%b1 -- One ++P%c4%98%2f -- One ++%7e%d1%8b%25%ec%a0%ae%d1%a0M%3b%e3%b6%b7%e9%a4%87%3c%db%9a%cc%a8%e1%96%9d -- One ++%c4%bf7%c7%ab9H%c4%99k%ea%91%bd%c3%8ck%e2%b3%8dk%c5%952V%e4%99%b2%d9%b3%e4%8b%bda%5b%24%c7%9b -- One ++%2a@%7d%cf%b5%f4%85%80%adO3%da%a7 +=%e0%ac%95%c8%b3+%ef%aa%95%c8%a64w%c7%9d%c9%a2%cf%b3%d6%82%24B%c4%a9%c5%a1UX%ee%99%b0%27E7%ca%a4%d0%8b%5d +A%e1%a0%bc%de%8b%d5%b2V%d9%9b%f3%b5%a2%a3M%d8%a1u@%f0%a0%ac%948%7e%f0%ab%86%af%27 +R +%da%88=f%cc%b9I%ce%af%7b%c9%97%e3%b9%8bH%cb%92X%d2%8c6 +%dc%9crh%d2%86B%e5%97%a2%22t%ed%99%82d +L%df%85%ef%a1%a5m@%d3%96%c2%ab%d4%9f%ca%b8%f3%b3%a2%bf%c7%b1_u%d7%b4%c7%b1 +P%c4%98%2f +%7e%d1%8b%25%ec%a0%ae%d1%a0M%3b%e3%b6%b7%e9%a4%87%3c%db%9a%cc%a8%e1%96%9d +%c4%bf7%c7%ab9H%c4%99k%ea%91%bd%c3%8ck%e2%b3%8dk%c5%952V%e4%99%b2%d9%b3%e4%8b%bda%5b%24%c7%9b -- Two +EOF + +cat <<EOF > EXPECTED ++%2a@%7d%cf%b5%f4%85%80%adO3%da%a7 +=%e0%ac%95%c8%b3+%ef%aa%95%c8%a64w%c7%9d%c9%a2%cf%b3%d6%82%24B%c4%a9%c5%a1UX%ee%99%b0%27E7%ca%a4%d0%8b%5d +A%e1%a0%bc%de%8b%d5%b2V%d9%9b%f3%b5%a2%a3M%d8%a1u@%f0%a0%ac%948%7e%f0%ab%86%af%27 +L%df%85%ef%a1%a5m@%d3%96%c2%ab%d4%9f%ca%b8%f3%b3%a2%bf%c7%b1_u%d7%b4%c7%b1 +P%c4%98%2f +R +inbox +tag4 +tag5 +unread +%7e%d1%8b%25%ec%a0%ae%d1%a0M%3b%e3%b6%b7%e9%a4%87%3c%db%9a%cc%a8%e1%96%9d +%c4%bf7%c7%ab9H%c4%99k%ea%91%bd%c3%8ck%e2%b3%8dk%c5%952V%e4%99%b2%d9%b3%e4%8b%bda%5b%24%c7%9b +%da%88=f%cc%b9I%ce%af%7b%c9%97%e3%b9%8bH%cb%92X%d2%8c6 +%dc%9crh%d2%86B%e5%97%a2%22t%ed%99%82d -- id:msg-002@notmuch-test-suite ++%2a@%7d%cf%b5%f4%85%80%adO3%da%a7 +=%e0%ac%95%c8%b3+%ef%aa%95%c8%a64w%c7%9d%c9%a2%cf%b3%d6%82%24B%c4%a9%c5%a1UX%ee%99%b0%27E7%ca%a4%d0%8b%5d +A%e1%a0%bc%de%8b%d5%b2V%d9%9b%f3%b5%a2%a3M%d8%a1u@%f0%a0%ac%948%7e%f0%ab%86%af%27 +L%df%85%ef%a1%a5m@%d3%96%c2%ab%d4%9f%ca%b8%f3%b3%a2%bf%c7%b1_u%d7%b4%c7%b1 +P%c4%98%2f +R +inbox +tag5 +unread +%7e%d1%8b%25%ec%a0%ae%d1%a0M%3b%e3%b6%b7%e9%a4%87%3c%db%9a%cc%a8%e1%96%9d +%c4%bf7%c7%ab9H%c4%99k%ea%91%bd%c3%8ck%e2%b3%8dk%c5%952V%e4%99%b2%d9%b3%e4%8b%bda%5b%24%c7%9b +%da%88=f%cc%b9I%ce%af%7b%c9%97%e3%b9%8bH%cb%92X%d2%8c6 +%dc%9crh%d2%86B%e5%97%a2%22t%ed%99%82d -- id:msg-001@notmuch-test-suite +EOF + +NOTMUCH_DUMP_TAGS > OUTPUT +notmuch restore --format=batch-tag < BACKUP +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--batch: only space and % needs to be encoded." +notmuch dump --format=batch-tag > BACKUP + +notmuch tag --batch <<EOF ++winner * ++foo::bar%25 -- (One and Two) or (One and tag:winner) ++found::it -- tag:foo::bar% +# ignore this line and the next + ++space%20in%20tags -- Two +# add tag '(tags)', among other stunts. ++crazy{ +(tags) +&are +#possible\ -- tag:"space in tags" ++match*crazy -- tag:crazy{ ++some_tag -- id:"this is ""nauty)""" +EOF + +cat <<EOF > EXPECTED ++%23possible%5c +%26are +%28tags%29 +crazy%7b +inbox +match%2acrazy +space%20in%20tags +tag4 +tag5 +unread +winner -- id:msg-002@notmuch-test-suite ++foo%3a%3abar%25 +found%3a%3ait +inbox +tag5 +unread +winner -- id:msg-001@notmuch-test-suite +EOF + +NOTMUCH_DUMP_TAGS > OUTPUT +notmuch restore --format=batch-tag < BACKUP +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest '--batch: unicode message-ids' + +${TEST_DIRECTORY}/random-corpus --config-path=${NOTMUCH_CONFIG} \ + --num-messages=100 + +notmuch dump --format=batch-tag | sed 's/^.* -- /+common_tag -- /' | \ + sort > EXPECTED + +notmuch dump --format=batch-tag | sed 's/^.* -- / -- /' > INTERMEDIATE_STEP +notmuch restore --format=batch-tag < INTERMEDIATE_STEP + +notmuch tag --batch < EXPECTED + +notmuch dump --format=batch-tag| \ + sort > OUTPUT + +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Empty tag names" +test_expect_code 1 'notmuch tag + One' + +test_begin_subtest "Tag name beginning with -" +test_expect_code 1 'notmuch tag +- One' + +test_begin_subtest "Xapian exception: read only files" +chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.${db_ending} +output=$(notmuch tag +something '*' 2>&1 | sed 's/: .*$//' ) +chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.${db_ending} +test_expect_equal "$output" "A Xapian exception occurred opening database" + +test_done diff --git a/test/T160-json.sh b/test/T160-json.sh new file mode 100755 index 00000000..91b98e5d --- /dev/null +++ b/test/T160-json.sh @@ -0,0 +1,140 @@ +#!/usr/bin/env bash +test_description="--format=json output" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Show message: json" +add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[bcc]=\"test_suite+bcc@notmuchmail.org\"" "[reply-to]=\"test_suite+replyto@notmuchmail.org\"" "[body]=\"json-show-message\"" +output=$(notmuch show --format=json "json-show-message") +test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": [\"${gen_msg_filename}\"], \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Bcc\": \"test_suite+bcc@notmuchmail.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" + +# This should be the same output as above. +test_begin_subtest "Show message: json --body=true" +output=$(notmuch show --format=json --body=true "json-show-message") +test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": [\"${gen_msg_filename}\"], \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Bcc\": \"test_suite+bcc@notmuchmail.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" + +test_begin_subtest "Show message: json --body=false" +output=$(notmuch show --format=json --body=false "json-show-message") +test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": [\"${gen_msg_filename}\"], \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Bcc\": \"test_suite+bcc@notmuchmail.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}}, []]]]" + +test_begin_subtest "Search message: json" +add_message "[subject]=\"json-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-search-message\"" +output=$(notmuch search --format=json "json-search-message" | notmuch_search_sanitize) +test_expect_equal_json "$output" "[{\"thread\": \"XXX\", + \"timestamp\": 946728000, + \"date_relative\": \"2000-01-01\", + \"matched\": 1, + \"total\": 1, + \"authors\": \"Notmuch Test Suite\", + \"subject\": \"json-search-subject\", + \"query\": [\"id:$gen_msg_id\", null], + \"tags\": [\"inbox\", + \"unread\"]}]" + +test_begin_subtest "Show message: json, utf-8" +add_message "[subject]=\"json-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-show-méssage\"" +output=$(notmuch show --format=json "jsön-show-méssage") +test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": [\"${gen_msg_filename}\"], \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-utf8-body-sübjéct\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"jsön-show-méssage\n\"}]}, []]]]" + +test_begin_subtest "Show message: json, inline attachment filename" +subject='json-show-inline-attachment-filename' +id="json-show-inline-attachment-filename@notmuchmail.org" +emacs_fcc_message \ + "$subject" \ + 'This is a test message with inline attachment with a filename' \ + "(mml-attach-file \"$NOTMUCH_SRCDIR/test/README\" nil nil \"inline\") + (message-goto-eoh) + (insert \"Message-ID: <$id>\n\")" +output=$(notmuch show --format=json "id:$id") +filename=$(notmuch search --output=files "id:$id") +# Get length of README after base64-encoding, minus additional newline. +attachment_length=$(( $(base64 $NOTMUCH_SRCDIR/test/README | wc -c) - 1 )) +test_expect_equal_json "$output" "[[[{\"id\": \"$id\", \"match\": true, \"excluded\": false, \"filename\": [\"$filename\"], \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\"], \"headers\": {\"Subject\": \"$subject\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"test_suite@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"multipart/mixed\", \"content\": [{\"id\": 2, \"content-type\": \"text/plain\", \"content\": \"This is a test message with inline attachment with a filename\"}, {\"id\": 3, \"content-type\": \"application/octet-stream\", \"content-length\": $attachment_length, \"content-transfer-encoding\": \"base64\", \"content-disposition\": \"inline\", \"filename\": \"README\"}]}]}, []]]]" + +test_begin_subtest "Search message: json, utf-8" +add_message "[subject]=\"json-search-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-search-méssage\"" +output=$(notmuch search --format=json "jsön-search-méssage" | notmuch_search_sanitize) +test_expect_equal_json "$output" "[{\"thread\": \"XXX\", + \"timestamp\": 946728000, + \"date_relative\": \"2000-01-01\", + \"matched\": 1, + \"total\": 1, + \"authors\": \"Notmuch Test Suite\", + \"subject\": \"json-search-utf8-body-sübjéct\", + \"query\": [\"id:$gen_msg_id\", null], + \"tags\": [\"inbox\", + \"unread\"]}]" + +test_begin_subtest "Format version: too low" +test_expect_code 20 "notmuch search --format-version=0 \\*" + +test_begin_subtest "Format version: too high" +test_expect_code 21 "notmuch search --format-version=999 \\*" + +test_begin_subtest "Show message: multiple filenames" +add_message '[id]=message-id@example.com [filename]=copy1 [date]="Fri, 05 Jan 2001 15:43:52 +0000"' +add_message '[id]=message-id@example.com [filename]=copy2 [date]="Fri, 05 Jan 2001 15:43:52 +0000"' +cat <<EOF > EXPECTED +[ + [ + [ + { + "date_relative": "2001-01-05", + "excluded": false, + "filename": [ + "${MAIL_DIR}/copy1", + "${MAIL_DIR}/copy2" + ], + "headers": { + "Date": "Fri, 05 Jan 2001 15:43:52 +0000", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Subject": "Show message: multiple filenames", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>" + }, + "id": "message-id@example.com", + "match": true, + "tags": [ + "inbox", + "unread" + ], + "timestamp": 978709432 + }, + [] + ] + ] +] +EOF +output=$(notmuch show --format=json --body=false id:message-id@example.com) +test_expect_equal_json "$output" "$(cat EXPECTED)" + +test_begin_subtest "Show message: multiple filenames, format version 2" +cat <<EOF > EXPECTED +[ + [ + [ + { + "date_relative": "2001-01-05", + "excluded": false, + "filename": "${MAIL_DIR}/copy1", + "headers": { + "Date": "Fri, 05 Jan 2001 15:43:52 +0000", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Subject": "Show message: multiple filenames", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>" + }, + "id": "message-id@example.com", + "match": true, + "tags": [ + "inbox", + "unread" + ], + "timestamp": 978709432 + }, + [] + ] + ] +] +EOF +output=$(notmuch show --format=json --body=false --format-version=2 id:message-id@example.com) +test_expect_equal_json "$output" "$(cat EXPECTED)" + +test_done diff --git a/test/T170-sexp.sh b/test/T170-sexp.sh new file mode 100755 index 00000000..c3dcf52a --- /dev/null +++ b/test/T170-sexp.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +test_description="--format=sexp output" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Show message: sexp" +add_message "[subject]=\"sexp-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[bcc]=\"test_suite+bcc@notmuchmail.org\"" "[reply-to]=\"test_suite+replyto@notmuchmail.org\"" "[body]=\"sexp-show-message\"" +output=$(notmuch show --format=sexp "sexp-show-message") +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :filename (\"${gen_msg_filename}\") :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-show-subject\" :From \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :To \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :Bcc \"test_suite+bcc@notmuchmail.org\" :Reply-To \"test_suite+replyto@notmuchmail.org\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"text/plain\" :content \"sexp-show-message\n\"))) ())))" + +# This should be the same output as above. +test_begin_subtest "Show message: sexp --body=true" +output=$(notmuch show --format=sexp --body=true "sexp-show-message") +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :filename (\"${gen_msg_filename}\") :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-show-subject\" :From \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :To \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :Bcc \"test_suite+bcc@notmuchmail.org\" :Reply-To \"test_suite+replyto@notmuchmail.org\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"text/plain\" :content \"sexp-show-message\n\"))) ())))" + +test_begin_subtest "Show message: sexp --body=false" +output=$(notmuch show --format=sexp --body=false "sexp-show-message") +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :filename (\"${gen_msg_filename}\") :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-show-subject\" :From \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :To \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :Bcc \"test_suite+bcc@notmuchmail.org\" :Reply-To \"test_suite+replyto@notmuchmail.org\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\")) ())))" + +test_begin_subtest "Search message: sexp" +add_message "[subject]=\"sexp-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"sexp-search-message\"" +output=$(notmuch search --format=sexp "sexp-search-message" | notmuch_search_sanitize) +test_expect_equal "$output" "((:thread \"0000000000000002\" :timestamp 946728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmuch Test Suite\" :subject \"sexp-search-subject\" :query (\"id:$gen_msg_id\" nil) :tags (\"inbox\" \"unread\")))" + +test_begin_subtest "Show message: sexp, utf-8" +add_message "[subject]=\"sexp-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-show-méssage\"" +output=$(notmuch show --format=sexp "jsön-show-méssage") +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :filename (\"${gen_msg_filename}\") :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-show-utf8-body-sübjéct\" :From \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :To \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"text/plain\" :content \"jsön-show-méssage\n\"))) ())))" + +test_begin_subtest "Search message: sexp, utf-8" +add_message "[subject]=\"sexp-search-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-search-méssage\"" +output=$(notmuch search --format=sexp "jsön-search-méssage" | notmuch_search_sanitize) +test_expect_equal "$output" "((:thread \"0000000000000004\" :timestamp 946728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmuch Test Suite\" :subject \"sexp-search-utf8-body-sübjéct\" :query (\"id:$gen_msg_id\" nil) :tags (\"inbox\" \"unread\")))" + +test_begin_subtest "Show message: sexp, inline attachment filename" +subject='sexp-show-inline-attachment-filename' +id="sexp-show-inline-attachment-filename@notmuchmail.org" +emacs_fcc_message \ + "$subject" \ + 'This is a test message with inline attachment with a filename' \ + "(mml-attach-file \"$NOTMUCH_SRCDIR/test/README\" nil nil \"inline\") + (message-goto-eoh) + (insert \"Message-ID: <$id>\n\")" +output=$(notmuch show --format=sexp "id:$id") +filename=$(notmuch search --output=files "id:$id") +# Get length of README after base64-encoding, minus additional newline. +attachment_length=$(( $(base64 $NOTMUCH_SRCDIR/test/README | wc -c) - 1 )) +test_expect_equal "$output" "((((:id \"$id\" :match t :excluded nil :filename (\"$filename\") :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\") :headers (:Subject \"sexp-show-inline-attachment-filename\" :From \"Notmuch Test Suite <test_suite@notmuchmail.org>\" :To \"test_suite@notmuchmail.org\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"multipart/mixed\" :content ((:id 2 :content-type \"text/plain\" :content \"This is a test message with inline attachment with a filename\") (:id 3 :content-type \"application/octet-stream\" :content-disposition \"inline\" :filename \"README\" :content-transfer-encoding \"base64\" :content-length $attachment_length))))) ())))" + +test_done diff --git a/test/T180-text.sh b/test/T180-text.sh new file mode 100755 index 00000000..ad2cb1f3 --- /dev/null +++ b/test/T180-text.sh @@ -0,0 +1,88 @@ +#!/usr/bin/env bash +test_description="--format=text output" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Show message: text" +add_message "[subject]=\"text-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-show-message\"" +output=$(notmuch show --format=text "text-show-message" | notmuch_show_sanitize_all) +test_expect_equal "$output" "\ +message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2000-01-01) (inbox unread) +Subject: text-show-subject +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Sat, 01 Jan 2000 12:00:00 +0000 +header} +body{ +part{ ID: 1, Content-type: text/plain +text-show-message +part} +body} +message}" + +test_begin_subtest "Search message: text" +add_message "[subject]=\"text-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-search-message\"" +output=$(notmuch search --format=text "text-search-message" | notmuch_search_sanitize) +test_expect_equal "$output" \ +"thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; text-search-subject (inbox unread)" + +test_begin_subtest "Show message: text, utf-8" +add_message "[subject]=\"text-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"tëxt-show-méssage\"" +output=$(notmuch show --format=text "tëxt-show-méssage" | notmuch_show_sanitize_all) +test_expect_equal "$output" "\ +message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2000-01-01) (inbox unread) +Subject: text-show-utf8-body-sübjéct +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Sat, 01 Jan 2000 12:00:00 +0000 +header} +body{ +part{ ID: 1, Content-type: text/plain +tëxt-show-méssage +part} +body} +message}" + +test_begin_subtest "Search message: text, utf-8" +add_message "[subject]=\"text-search-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"tëxt-search-méssage\"" +output=$(notmuch search --format=text "tëxt-search-méssage" | notmuch_search_sanitize) +test_expect_equal "$output" \ +"thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; text-search-utf8-body-sübjéct (inbox unread)" + +add_email_corpus + +test_begin_subtest "Search message tags: text0" +cat <<EOF > EXPECTED +attachment inbox signed unread +EOF +notmuch search --format=text0 --output=tags '*' | xargs -0 | notmuch_search_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +# Use tr(1) to convert --output=text0 to --output=text for +# comparison. Also translate newlines to spaces to fail with more +# noise if they are present as delimiters instead of null +# characters. This assumes there are no newlines in the data. +test_begin_subtest "Compare text vs. text0 for threads" +notmuch search --format=text --output=threads '*' | notmuch_search_sanitize > EXPECTED +notmuch search --format=text0 --output=threads '*' | tr "\n\0" " \n" | notmuch_search_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Compare text vs. text0 for messages" +notmuch search --format=text --output=messages '*' | notmuch_search_sanitize > EXPECTED +notmuch search --format=text0 --output=messages '*' | tr "\n\0" " \n" | notmuch_search_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Compare text vs. text0 for files" +notmuch search --format=text --output=files '*' | notmuch_search_sanitize > EXPECTED +notmuch search --format=text0 --output=files '*' | tr "\n\0" " \n" | notmuch_search_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Compare text vs. text0 for tags" +notmuch search --format=text --output=tags '*' | notmuch_search_sanitize > EXPECTED +notmuch search --format=text0 --output=tags '*' | tr "\n\0" " \n" | notmuch_search_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh new file mode 100755 index 00000000..3eeac1db --- /dev/null +++ b/test/T190-multipart.sh @@ -0,0 +1,810 @@ +#!/usr/bin/env bash +test_description="output of multipart message" +. $(dirname "$0")/test-lib.sh || exit 1 + +cat <<EOF > embedded_message_body +Content-Type: multipart/alternative; boundary="==-=-==" + +--==-=-== +Content-Type: text/html + +<p>This is an embedded message, with a multipart/alternative part.</p> + +--==-=-== +Content-Type: text/plain + +This is an embedded message, with a multipart/alternative part. + +--==-=-==-- +EOF +cat <<EOF > embedded_message +From: Carl Worth <cworth@cworth.org> +To: cworth@cworth.org +Subject: html message +Date: Fri, 05 Jan 2001 15:42:57 +0000 +User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) +Message-ID: <87liy5ap01.fsf@yoom.home.cworth.org> +MIME-Version: 1.0 +EOF + +cat embedded_message_body >> embedded_message + +cat <<EOF > multipart_body +Content-Type: multipart/signed; boundary="==-=-="; + micalg=pgp-sha1; protocol="application/pgp-signature" + +--==-=-= +Content-Type: multipart/mixed; boundary="=-=-=" + +--=-=-= +Content-Type: message/rfc822 +Content-Disposition: inline + +EOF + +cat embedded_message >> multipart_body +cat <<EOF >> multipart_body + +--=-=-= +Content-Disposition: attachment; filename=attachment + +This is a text attachment. + +--=-=-= + +And this message is signed. + +-Carl + +--=-=-=-- + +--==-=-= +Content-Type: application/pgp-signature + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.11 (GNU/Linux) + +iEYEARECAAYFAk3SA/gACgkQ6JDdNq8qSWj0sACghqVJEQJUs3yV8zbTzhgnSIcD +W6cAmQE4dcYrx/LPLtYLZm1jsGauE5hE +=zkga +-----END PGP SIGNATURE----- +--==-=-=-- +EOF + +cat <<EOF > ${MAIL_DIR}/multipart +From: Carl Worth <cworth@cworth.org> +To: cworth@cworth.org +Subject: Multipart message +Date: Fri, 05 Jan 2001 15:43:57 +0000 +User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) +Message-ID: <87liy5ap00.fsf@yoom.home.cworth.org> +MIME-Version: 1.0 +EOF + +cat multipart_body >> ${MAIL_DIR}/multipart + +cat <<EOF > ${MAIL_DIR}/base64-part-with-crlf +From: Carl Worth <cworth@cworth.org> +To: cworth@cworth.org +Subject: Test message with a BASE64 encoded binary containing CRLF pair +Date: Fri, 05 Jan 2001 15:43:57 +0000 +User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) +Message-ID: <base64-part-with-crlf> +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="==-=-="; + +--==-=-= + +The attached BASE64-encoded part expands to a binary containing a CRLF +pair (that is one bye of 0x0D followed by one byte of 0x0A). This is +designed to ensure that notmuch is not corrupting the output of this +part by converting the CRLF pair to an LF only (as would be appropriate +for display of a text part on a Linux system, for example). + +The part should be a 3-byte file with the following sequence of 3 +hexadecimal bytes: + + EF 0D 0A + +--==-=-= +Content-Type: application/octet-stream +Content-Disposition: attachment; filename=crlf.bin +Content-Transfer-Encoding: base64 + +7w0K +--==-=-=-- +EOF + +cat <<EOF > content_types +From: Todd <todd@example.com> +To: todd@example.com +Subject: odd content types +Date: Mon, 12 Jan 2014 18:12:32 +0000 +User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) +Message-ID: <KfjfO2WJBw2hrV2p0gjT@example.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="==-=-==" + +--==-=-== +Content-Type: application/unique_identifier + +<p>This is an embedded message, with a multipart/alternative part.</p> + +--==-=-== +Content-Type: text/some_other_identifier + +This is an embedded message, with a multipart/alternative part. + +--==-=-==-- +EOF +cat content_types >> ${MAIL_DIR}/odd_content_type +notmuch new > /dev/null + +test_begin_subtest "--format=text --part=0, full message" +notmuch show --format=text --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +message{ id:87liy5ap00.fsf@yoom.home.cworth.org depth:0 match:1 excluded:0 filename:${MAIL_DIR}/multipart +header{ +Carl Worth <cworth@cworth.org> (2001-01-05) (attachment inbox signed unread) +Subject: Multipart message +From: Carl Worth <cworth@cworth.org> +To: cworth@cworth.org +Date: Fri, 05 Jan 2001 15:43:57 +0000 +header} +body{ +part{ ID: 1, Content-type: multipart/signed +part{ ID: 2, Content-type: multipart/mixed +part{ ID: 3, Content-type: message/rfc822 +header{ +Subject: html message +From: Carl Worth <cworth@cworth.org> +To: cworth@cworth.org +Date: Fri, 05 Jan 2001 15:42:57 +0000 +header} +body{ +part{ ID: 4, Content-type: multipart/alternative +part{ ID: 5, Content-type: text/html +Non-text part: text/html +part} +part{ ID: 6, Content-type: text/plain +This is an embedded message, with a multipart/alternative part. +part} +part} +body} +part} +attachment{ ID: 7, Filename: attachment, Content-type: text/plain +This is a text attachment. +attachment} +part{ ID: 8, Content-type: text/plain +And this message is signed. + +-Carl +part} +part} +part{ ID: 9, Content-type: application/pgp-signature +Non-text part: application/pgp-signature +part} +part} +body} +message} +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=text --part=1, message body" +notmuch show --format=text --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +part{ ID: 1, Content-type: multipart/signed +part{ ID: 2, Content-type: multipart/mixed +part{ ID: 3, Content-type: message/rfc822 +header{ +Subject: html message +From: Carl Worth <cworth@cworth.org> +To: cworth@cworth.org +Date: Fri, 05 Jan 2001 15:42:57 +0000 +header} +body{ +part{ ID: 4, Content-type: multipart/alternative +part{ ID: 5, Content-type: text/html +Non-text part: text/html +part} +part{ ID: 6, Content-type: text/plain +This is an embedded message, with a multipart/alternative part. +part} +part} +body} +part} +attachment{ ID: 7, Filename: attachment, Content-type: text/plain +This is a text attachment. +attachment} +part{ ID: 8, Content-type: text/plain +And this message is signed. + +-Carl +part} +part} +part{ ID: 9, Content-type: application/pgp-signature +Non-text part: application/pgp-signature +part} +part} +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=text --part=2, multipart/mixed" +notmuch show --format=text --part=2 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +part{ ID: 2, Content-type: multipart/mixed +part{ ID: 3, Content-type: message/rfc822 +header{ +Subject: html message +From: Carl Worth <cworth@cworth.org> +To: cworth@cworth.org +Date: Fri, 05 Jan 2001 15:42:57 +0000 +header} +body{ +part{ ID: 4, Content-type: multipart/alternative +part{ ID: 5, Content-type: text/html +Non-text part: text/html +part} +part{ ID: 6, Content-type: text/plain +This is an embedded message, with a multipart/alternative part. +part} +part} +body} +part} +attachment{ ID: 7, Filename: attachment, Content-type: text/plain +This is a text attachment. +attachment} +part{ ID: 8, Content-type: text/plain +And this message is signed. + +-Carl +part} +part} +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=text --part=3, rfc822 part" +notmuch show --format=text --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +part{ ID: 3, Content-type: message/rfc822 +header{ +Subject: html message +From: Carl Worth <cworth@cworth.org> +To: cworth@cworth.org +Date: Fri, 05 Jan 2001 15:42:57 +0000 +header} +body{ +part{ ID: 4, Content-type: multipart/alternative +part{ ID: 5, Content-type: text/html +Non-text part: text/html +part} +part{ ID: 6, Content-type: text/plain +This is an embedded message, with a multipart/alternative part. +part} +part} +body} +part} +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=text --part=4, rfc822's multipart" +notmuch show --format=text --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +part{ ID: 4, Content-type: multipart/alternative +part{ ID: 5, Content-type: text/html +Non-text part: text/html +part} +part{ ID: 6, Content-type: text/plain +This is an embedded message, with a multipart/alternative part. +part} +part} +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=text --part=5, rfc822's html part" +notmuch show --format=text --part=5 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +part{ ID: 5, Content-type: text/html +Non-text part: text/html +part} +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=text --part=6, rfc822's text part" +notmuch show --format=text --part=6 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +part{ ID: 6, Content-type: text/plain +This is an embedded message, with a multipart/alternative part. +part} +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=text --part=7, inline attachment" +notmuch show --format=text --part=7 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +attachment{ ID: 7, Filename: attachment, Content-type: text/plain +This is a text attachment. +attachment} +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=text --part=8, plain text part" +notmuch show --format=text --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +part{ ID: 8, Content-type: text/plain +And this message is signed. + +-Carl +part} +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=text --part=9, pgp signature (unverified)" +notmuch show --format=text --part=9 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +part{ ID: 9, Content-type: application/pgp-signature +Non-text part: application/pgp-signature +part} +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=text --part=8, no part, expect error" +test_expect_success "notmuch show --format=text --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org'" + +test_begin_subtest "--format=json --part=0, full message" +notmuch show --format=json --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "excluded": false, "filename": ["${MAIL_DIR}/multipart"], "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [ +{"id": 1, "content-type": "multipart/signed", "content": [ +{"id": 2, "content-type": "multipart/mixed", "content": [ +{"id": 3, "content-type": "message/rfc822", "content-disposition": "inline", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ +{"id": 4, "content-type": "multipart/alternative", "content": [ +{"id": 5, "content-type": "text/html", "content-length": 71}, +{"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, +{"id": 7, "content-type": "text/plain", "content-disposition": "attachment", "filename": "attachment", "content": "This is a text attachment.\n"}, +{"id": 8, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}]}, +{"id": 9, "content-type": "application/pgp-signature", "content-length": 197}]}]} +EOF +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" + +test_begin_subtest "--format=json --part=1, message body" +notmuch show --format=json --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +{"id": 1, "content-type": "multipart/signed", "content": [ +{"id": 2, "content-type": "multipart/mixed", "content": [ +{"id": 3, "content-type": "message/rfc822", "content-disposition": "inline", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ +{"id": 4, "content-type": "multipart/alternative", "content": [ +{"id": 5, "content-type": "text/html", "content-length": 71}, +{"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, +{"id": 7, "content-type": "text/plain", "content-disposition": "attachment", "filename": "attachment", "content": "This is a text attachment.\n"}, +{"id": 8, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}]}, +{"id": 9, "content-type": "application/pgp-signature", "content-length": 197}]} +EOF +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" + +test_begin_subtest "--format=json --part=2, multipart/mixed" +notmuch show --format=json --part=2 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +{"id": 2, "content-type": "multipart/mixed", "content": [ +{"id": 3, "content-type": "message/rfc822", "content-disposition": "inline", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ +{"id": 4, "content-type": "multipart/alternative", "content": [ +{"id": 5, "content-type": "text/html", "content-length": 71}, +{"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, +{"id": 7, "content-type": "text/plain", "content-disposition": "attachment", "filename": "attachment", "content": "This is a text attachment.\n"}, +{"id": 8, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}]} +EOF +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" + +test_begin_subtest "--format=json --part=3, rfc822 part" +notmuch show --format=json --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +{"id": 3, "content-type": "message/rfc822", "content-disposition": "inline", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ +{"id": 4, "content-type": "multipart/alternative", "content": [ +{"id": 5, "content-type": "text/html", "content-length": 71}, +{"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]} +EOF +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" + +test_begin_subtest "--format=json --part=4, rfc822's multipart/alternative" +notmuch show --format=json --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +{"id": 4, "content-type": "multipart/alternative", "content": [ +{"id": 5, "content-type": "text/html", "content-length": 71}, +{"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]} +EOF +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" + +test_begin_subtest "--format=json --part=5, rfc822's html part" +notmuch show --format=json --part=5 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +{"id": 5, "content-type": "text/html", "content-length": 71} +EOF +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" + +test_begin_subtest "--format=json --part=6, rfc822's text part" +notmuch show --format=json --part=6 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +{"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"} +EOF +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" + +test_begin_subtest "--format=json --part=7, inline attachment" +notmuch show --format=json --part=7 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +{"id": 7, + "content-type": "text/plain", + "filename": "attachment", + "content": "This is a text attachment.\n", + "content-disposition": "attachment"} +EOF +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" + +test_begin_subtest "--format=json --part=8, plain text part" +notmuch show --format=json --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +{"id": 8, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"} +EOF +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" + +test_begin_subtest "--format=json --part=9, pgp signature (unverified)" +notmuch show --format=json --part=9 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +{"id": 9, "content-type": "application/pgp-signature", "content-length": 197} +EOF +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" + +test_begin_subtest "--format=json --part=10, no part, expect error" +test_expect_success "notmuch show --format=json --part=10 'id:87liy5ap00.fsf@yoom.home.cworth.org'" + +test_begin_subtest "--format=raw" +notmuch show --format=raw 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +test_expect_equal_file "${MAIL_DIR}"/multipart OUTPUT + +test_begin_subtest "--format=raw --part=0, full message" +notmuch show --format=raw --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +test_expect_equal_file "${MAIL_DIR}"/multipart OUTPUT + +test_begin_subtest "--format=raw --part=1, message body" +test_subtest_broken_gmime_2 +notmuch show --format=raw --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +test_expect_equal_file multipart_body OUTPUT + +test_begin_subtest "--format=raw --part=2, multipart/mixed" +notmuch show --format=raw --part=2 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +Content-Type: multipart/mixed; boundary="=-=-=" + +--=-=-= +Content-Type: message/rfc822 +Content-Disposition: inline + +From: Carl Worth <cworth@cworth.org> +To: cworth@cworth.org +Subject: html message +Date: Fri, 05 Jan 2001 15:42:57 +0000 +User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) +Message-ID: <87liy5ap01.fsf@yoom.home.cworth.org> +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="==-=-==" + +--==-=-== +Content-Type: text/html + +<p>This is an embedded message, with a multipart/alternative part.</p> + +--==-=-== +Content-Type: text/plain + +This is an embedded message, with a multipart/alternative part. + +--==-=-==-- + +--=-=-= +Content-Disposition: attachment; filename=attachment + +This is a text attachment. + +--=-=-= + +And this message is signed. + +-Carl + +--=-=-=-- +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=raw --part=3, rfc822 part" +notmuch show --format=raw --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +test_expect_equal_file embedded_message OUTPUT + +test_begin_subtest "--format=raw --part=4, rfc822's multipart" +test_subtest_broken_gmime_2 +notmuch show --format=raw --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +test_expect_equal_file embedded_message_body OUTPUT + +test_begin_subtest "--format=raw --part=5, rfc822's html part" +notmuch show --format=raw --part=5 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +<p>This is an embedded message, with a multipart/alternative part.</p> +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=raw --part=6, rfc822's text part" +notmuch show --format=raw --part=6 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +This is an embedded message, with a multipart/alternative part. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=raw --part=7, inline attachment" +notmuch show --format=raw --part=7 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +This is a text attachment. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=raw --part=8, plain text part" +notmuch show --format=raw --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +And this message is signed. + +-Carl +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=raw --part=9, pgp signature (unverified)" +notmuch show --format=raw --part=9 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +# output should *not* include newline +echo >>OUTPUT +cat <<EOF >EXPECTED +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.11 (GNU/Linux) + +iEYEARECAAYFAk3SA/gACgkQ6JDdNq8qSWj0sACghqVJEQJUs3yV8zbTzhgnSIcD +W6cAmQE4dcYrx/LPLtYLZm1jsGauE5hE +=zkga +-----END PGP SIGNATURE----- +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=raw --part=10, no part, expect error" +test_expect_success "notmuch show --format=raw --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org'" + +test_begin_subtest "--format=mbox" +notmuch show --format=mbox 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +printf "From cworth@cworth.org Fri Jan 5 15:43:57 2001\n" >EXPECTED +cat "${MAIL_DIR}"/multipart >>EXPECTED +# mbox output is expected to include a blank line +echo >>EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--format=mbox --part=1, incompatible, expect error" +test_expect_success "! notmuch show --format=mbox --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org'" + +test_begin_subtest "'notmuch reply' to a multipart message" +notmuch reply 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: Multipart message +To: Carl Worth <cworth@cworth.org>, cworth@cworth.org +In-Reply-To: <87liy5ap00.fsf@yoom.home.cworth.org> +References: <87liy5ap00.fsf@yoom.home.cworth.org> + +On Fri, 05 Jan 2001 15:43:57 +0000, Carl Worth <cworth@cworth.org> wrote: +> From: Carl Worth <cworth@cworth.org> +> To: cworth@cworth.org +> Subject: html message +> Date: Fri, 05 Jan 2001 15:42:57 +0000 +> +Non-text part: text/html +> This is an embedded message, with a multipart/alternative part. +> This is a text attachment. +> And this message is signed. +> +> -Carl +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "'notmuch reply' to a multipart message with json format" +notmuch reply --format=json 'id:87liy5ap00.fsf@yoom.home.cworth.org' | notmuch_json_show_sanitize >OUTPUT +notmuch_json_show_sanitize <<EOF >EXPECTED +{"reply-headers": {"Subject": "Re: Multipart message", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Carl Worth <cworth@cworth.org>, cworth@cworth.org", + "In-reply-to": "<87liy5ap00.fsf@yoom.home.cworth.org>", + "References": "<87liy5ap00.fsf@yoom.home.cworth.org>"}, + "original": {"id": "XXXXX", + "match": false, + "excluded": false, + "filename": ["YYYYY"], + "timestamp": 978709437, + "date_relative": "2001-01-05", + "tags": ["attachment","inbox","signed","unread"], + "headers": {"Subject": "Multipart message", + "From": "Carl Worth <cworth@cworth.org>", + "To": "cworth@cworth.org", + "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, + "body": [{"id": 1, + "content-type": "multipart/signed", + "content": [{"id": 2, + "content-type": "multipart/mixed", + "content": [{"id": 3, + "content-type": "message/rfc822", + "content-disposition": "inline", + "content": [{"headers": {"Subject": "html message", + "From": "Carl Worth <cworth@cworth.org>", + "To": "cworth@cworth.org", + "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, + "body": [{"id": 4, + "content-type": "multipart/alternative", + "content": [{"id": 5, + "content-type": "text/html", + "content-length": 71}, + {"id": 6, + "content-type": "text/plain", + "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, + {"id": 7, + "content-type": "text/plain", + "content-disposition": "attachment", + "filename": "attachment", + "content": "This is a text attachment.\n"}, + {"id": 8, + "content-type": "text/plain", + "content": "And this message is signed.\n\n-Carl\n"}]}, + {"id": 9, + "content-type": "application/pgp-signature", + "content-length": 197}]}]}} +EOF +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" + +test_begin_subtest "'notmuch show --part' does not corrupt a part with CRLF pair" +notmuch show --format=raw --part=3 id:base64-part-with-crlf > crlf.out +echo -n -e "\xEF\x0D\x0A" > crlf.expected +test_expect_equal_file crlf.out crlf.expected + + +# The ISO-8859-1 encoding of U+00BD is a single byte: octal 275 +# (Portability note: Dollar-Single ($'...', ANSI C-style escape sequences) +# quoting works on bash, ksh, zsh, *BSD sh but not on dash, ash nor busybox sh) +readonly u_00bd_latin1=$'\275' + +# The Unicode fraction symbol 1/2 is U+00BD and is encoded +# in UTF-8 as two bytes: octal 302 275 +readonly u_00bd_utf8=$'\302\275' + +cat <<EOF > ${MAIL_DIR}/include-html +From: A <a@example.com> +To: B <b@example.com> +Subject: html message +Date: Sat, 01 January 2000 00:00:00 +0000 +Message-ID: <htmlmessage> +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="==-==" + +--==-== +Content-Type: text/html; charset=UTF-8 + +<p>0.5 equals ${u_00bd_utf8}</p> + +--==-== +Content-Type: text/html; charset=ISO-8859-1 + +<p>0.5 equals ${u_00bd_latin1}</p> + +--==-== +Content-Type: text/plain; charset=UTF-8 + +0.5 equals ${u_00bd_utf8} + +--==-==-- +EOF + +notmuch new > /dev/null + +cat_expected_head () +{ + cat <<EOF +[[[{"id": "htmlmessage", "match":true, "excluded": false, "date_relative":"2000-01-01", + "timestamp": 946684800, + "filename": ["${MAIL_DIR}/include-html"], + "tags": ["inbox", "unread"], + "headers": { "Date": "Sat, 01 Jan 2000 00:00:00 +0000", "From": "A <a@example.com>", + "Subject": "html message", "To": "B <b@example.com>"}, + "body": [{ + "content-type": "multipart/alternative", "id": 1, +EOF +} + +cat_expected_head > EXPECTED.nohtml +cat <<EOF >> EXPECTED.nohtml +"content": [ + { "id": 2, "content-charset": "UTF-8", "content-length": 21, "content-type": "text/html"}, + { "id": 3, "content-charset": "ISO-8859-1", "content-length": 20, "content-type": "text/html"}, + { "id": 4, "content-type": "text/plain", "content": "0.5 equals \\u00bd\\n"} +]}]},[]]]] +EOF + +# Both the UTF-8 and ISO-8859-1 part should have U+00BD +cat_expected_head > EXPECTED.withhtml +cat <<EOF >> EXPECTED.withhtml +"content": [ + { "id": 2, "content-type": "text/html", "content": "<p>0.5 equals \\u00bd</p>\\n"}, + { "id": 3, "content-type": "text/html", "content": "<p>0.5 equals \\u00bd</p>\\n"}, + { "id": 4, "content-type": "text/plain", "content": "0.5 equals \\u00bd\\n"} +]}]},[]]]] +EOF + +test_begin_subtest "html parts excluded by default" +notmuch show --format=json id:htmlmessage > OUTPUT +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED.nohtml)" + +test_begin_subtest "html parts included" +notmuch show --format=json --include-html id:htmlmessage > OUTPUT +test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED.withhtml)" + +test_begin_subtest "indexes mime-type #1" +output=$(notmuch search mimetype:application/unique_identifier | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2014-01-12 [1/1] Todd; odd content types (inbox unread)" + +test_begin_subtest "indexes mime-type #2" +output=$(notmuch search mimetype:text/some_other_identifier | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2014-01-12 [1/1] Todd; odd content types (inbox unread)" + +test_begin_subtest "indexes mime-type #3" +output=$(notmuch search from:todd and mimetype:multipart/alternative | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2014-01-12 [1/1] Todd; odd content types (inbox unread)" + +test_begin_subtest "case of Content-Disposition doesn't matter for indexing" +cat <<EOF > ${MAIL_DIR}/content-disposition +Return-path: <david@tethera.net> +Envelope-to: david@tethera.net +Delivery-date: Sun, 04 Oct 2015 09:16:03 -0300 +Received: from gitolite.debian.net ([87.98.215.224]) + by yantan.tethera.net with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) + (Exim 4.80) + (envelope-from <david@tethera.net>) + id 1ZiiCx-0007iz-RK + for david@tethera.net; Sun, 04 Oct 2015 09:16:03 -0300 +Received: from remotemail by gitolite.debian.net with local (Exim 4.80) + (envelope-from <david@tethera.net>) + id 1ZiiC8-0002Rz-Uf; Sun, 04 Oct 2015 12:15:12 +0000 +Received: (nullmailer pid 28621 invoked by uid 1000); Sun, 04 Oct 2015 + 12:14:53 -0000 +From: David Bremner <david@tethera.net> +To: David Bremner <david@tethera.net> +Subject: test attachment +User-Agent: Notmuch/0.20.2+93~g33c8777 (http://notmuchmail.org) Emacs/24.5.1 + (x86_64-pc-linux-gnu) +Date: Sun, 04 Oct 2015 09:14:53 -0300 +Message-ID: <87io6m96f6.fsf@zancas.localnet> +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="=-=-=" + +--=-=-= +Content-Type: text/plain +Content-Disposition: ATTACHMENT; filename=hello.txt +Content-Description: this is a very exciting file + +hello + +--=-=-= +Content-Type: text/plain + + +world + +--=-=-=-- + +EOF +NOTMUCH_NEW + +cat <<EOF > EXPECTED +attachment +inbox +unread +EOF + +notmuch search --output=tags id:87io6m96f6.fsf@zancas.localnet > OUTPUT +test_expect_equal_file EXPECTED OUTPUT +test_done diff --git a/test/T200-thread-naming.sh b/test/T200-thread-naming.sh new file mode 100755 index 00000000..594d301f --- /dev/null +++ b/test/T200-thread-naming.sh @@ -0,0 +1,212 @@ +#!/usr/bin/env bash +test_description="naming of threads with changing subject" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Initial thread name (oldest-first search)" +add_message '[subject]="thread-naming: Initial thread subject"' \ + '[date]="Fri, 05 Jan 2001 15:43:56 -0000"' +first=${gen_msg_cnt} +parent=${gen_msg_id} +add_message '[subject]="thread-naming: Older changed subject"' \ + '[date]="Sat, 06 Jan 2001 15:43:56 -0000"' \ + "[in-reply-to]=\<$parent\>" +add_message '[subject]="thread-naming: Newer changed subject"' \ + '[date]="Sun, 07 Jan 2001 15:43:56 -0000"' \ + "[in-reply-to]=\<$parent\>" +add_message '[subject]="thread-naming: Final thread subject"' \ + '[date]="Mon, 08 Jan 2001 15:43:56 -0000"' \ + "[in-reply-to]=\<$parent\>" +final=${gen_msg_id} +output=$(notmuch search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [4/4] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)" + +test_begin_subtest "Initial thread name (newest-first search)" +output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-08 [4/4] Notmuch Test Suite; thread-naming: Final thread subject (inbox unread)" + +# Remove oldest and newest messages from search results +notmuch tag -inbox id:$parent or id:$final + +test_begin_subtest "Changed thread name (oldest-first search)" +output=$(notmuch search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-06 [2/4] Notmuch Test Suite; thread-naming: Older changed subject (inbox unread)" + +test_begin_subtest "Changed thread name (newest-first search)" +output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-07 [2/4] Notmuch Test Suite; thread-naming: Newer changed subject (inbox unread)" + +test_begin_subtest "Ignore added reply prefix (Re:)" +add_message '[subject]="Re: thread-naming: Initial thread subject"' \ + '[date]="Tue, 09 Jan 2001 15:43:45 -0000"' \ + "[in-reply-to]=\<$parent\>" +output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-09 [3/5] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)" + +test_begin_subtest "Ignore added reply prefix (Aw:)" +add_message '[subject]="Aw: thread-naming: Initial thread subject"' \ + '[date]="Wed, 10 Jan 2001 15:43:45 -0000"' \ + "[in-reply-to]=\<$parent\>" +output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-10 [4/6] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)" + +test_begin_subtest "Ignore added reply prefix (Vs:)" +add_message '[subject]="Vs: thread-naming: Initial thread subject"' \ + '[date]="Thu, 11 Jan 2001 15:43:45 -0000"' \ + "[in-reply-to]=\<$parent\>" +output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-11 [5/7] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)" + +test_begin_subtest "Ignore added reply prefix (Sv:)" +add_message '[subject]="Sv: thread-naming: Initial thread subject"' \ + '[date]="Fri, 12 Jan 2001 15:43:45 -0000"' \ + "[in-reply-to]=\<$parent\>" +output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-12 [6/8] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)" + +test_begin_subtest "Use empty subjects if necessary." +add_message '[subject]="@FORCE_EMPTY"' \ + '[date]="Sat, 13 Jan 2001 15:43:45 -0000"' \ + '[from]="Empty Sender <empty_test@notmuchmail.org>"' +empty_parent=${gen_msg_id} +add_message '[subject]="@FORCE_EMPTY"' \ + '[date]="Sun, 14 Jan 2001 15:43:45 -0000"' \ + '[from]="Empty Sender <empty_test@notmuchmail.org>"' \ + "[in-reply-to]=\<$empty_parent\>" +output=$(notmuch search --sort=newest-first from:empty_test@notmuchmail.org | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-14 [2/2] Empty Sender; (inbox unread)" + +test_begin_subtest "Avoid empty subjects if possible (newest-first)." +add_message '[subject]="Non-empty subject (1)"' \ + '[date]="Mon, 15 Jan 2001 15:43:45 -0000"' \ + '[from]="Empty Sender <empty_test@notmuchmail.org>"' \ + "[in-reply-to]=\<$empty_parent\>" +add_message '[subject]="Non-empty subject (2)"' \ + '[date]="Mon, 16 Jan 2001 15:43:45 -0000"' \ + '[from]="Empty Sender <empty_test@notmuchmail.org>"' \ + "[in-reply-to]=\<$empty_parent\>" +add_message '[subject]="@FORCE_EMPTY"' \ + '[date]="Tue, 17 Jan 2001 15:43:45 -0000"' \ + '[from]="Empty Sender <empty_test@notmuchmail.org>"' \ + "[in-reply-to]=\<$empty_parent\>" +output=$(notmuch search --sort=newest-first from:Empty | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-17 [5/5] Empty Sender; Non-empty subject (2) (inbox unread)" + +test_begin_subtest "Avoid empty subjects if possible (oldest-first)." +output=$(notmuch search --sort=oldest-first from:Empty | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-13 [5/5] Empty Sender; Non-empty subject (1) (inbox unread)" + +test_begin_subtest 'Test order of messages in "notmuch show"' +output=$(notmuch show thread-naming | notmuch_show_sanitize) +test_expect_equal "$output" "message{ id:msg-$(printf "%03d" $first)@notmuch-test-suite depth:0 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $first) +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (unread) +Subject: thread-naming: Initial thread subject +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Fri, 05 Jan 2001 15:43:56 +0000 +header} +body{ +part{ ID: 1, Content-type: text/plain +This is just a test message (#$first) +part} +body} +message} +message{ id:msg-$(printf "%03d" $((first + 1)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 1))) +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-06) (inbox unread) +Subject: thread-naming: Older changed subject +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Sat, 06 Jan 2001 15:43:56 +0000 +header} +body{ +part{ ID: 1, Content-type: text/plain +This is just a test message (#$((first + 1))) +part} +body} +message} +message{ id:msg-$(printf "%03d" $((first + 2)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 2))) +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-07) (inbox unread) +Subject: thread-naming: Newer changed subject +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Sun, 07 Jan 2001 15:43:56 +0000 +header} +body{ +part{ ID: 1, Content-type: text/plain +This is just a test message (#$((first + 2))) +part} +body} +message} +message{ id:msg-$(printf "%03d" $((first + 3)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 3))) +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-08) (unread) +Subject: thread-naming: Final thread subject +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Mon, 08 Jan 2001 15:43:56 +0000 +header} +body{ +part{ ID: 1, Content-type: text/plain +This is just a test message (#$((first + 3))) +part} +body} +message} +message{ id:msg-$(printf "%03d" $((first + 4)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 4))) +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-09) (inbox unread) +Subject: Re: thread-naming: Initial thread subject +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Tue, 09 Jan 2001 15:43:45 +0000 +header} +body{ +part{ ID: 1, Content-type: text/plain +This is just a test message (#$((first + 4))) +part} +body} +message} +message{ id:msg-$(printf "%03d" $((first + 5)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 5))) +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-10) (inbox unread) +Subject: Aw: thread-naming: Initial thread subject +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Wed, 10 Jan 2001 15:43:45 +0000 +header} +body{ +part{ ID: 1, Content-type: text/plain +This is just a test message (#$((first + 5))) +part} +body} +message} +message{ id:msg-$(printf "%03d" $((first + 6)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 6))) +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-11) (inbox unread) +Subject: Vs: thread-naming: Initial thread subject +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Thu, 11 Jan 2001 15:43:45 +0000 +header} +body{ +part{ ID: 1, Content-type: text/plain +This is just a test message (#$((first + 6))) +part} +body} +message} +message{ id:msg-$(printf "%03d" $((first + 7)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 7))) +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-12) (inbox unread) +Subject: Sv: thread-naming: Initial thread subject +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Fri, 12 Jan 2001 15:43:45 +0000 +header} +body{ +part{ ID: 1, Content-type: text/plain +This is just a test message (#$((first + 7))) +part} +body} +message}" +test_done diff --git a/test/T205-author-naming.sh b/test/T205-author-naming.sh new file mode 100755 index 00000000..68b85ced --- /dev/null +++ b/test/T205-author-naming.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +test_description="naming of authors with unusual addresses" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Add author with empty quoted real name" +add_message '[subject]="author-naming: Initial thread subject"' \ + '[date]="Fri, 05 Jan 2001 15:43:56 -0000"' \ + '[from]="\"\" <address@example.com>"' +output=$(notmuch search --sort=oldest-first author-naming and tag:inbox | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] address@example.com; author-naming: Initial thread subject (inbox unread)" + +test_done diff --git a/test/T210-raw.sh b/test/T210-raw.sh new file mode 100755 index 00000000..99fdef72 --- /dev/null +++ b/test/T210-raw.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +test_description='notmuch show --format=raw' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_message +add_message + +test_begin_subtest "Attempt to show multiple raw messages" +output=$(notmuch show --format=raw "*" 2>&1) +test_expect_equal "$output" "Error: search term did not match precisely one message (matched 2 messages)." + +test_begin_subtest "Show a raw message" +output=$(notmuch show --format=raw id:msg-001@notmuch-test-suite | notmuch_date_sanitize) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Message-Id: <msg-001@notmuch-test-suite> +Subject: Test message #1 +Date: GENERATED_DATE + +This is just a test message (#1)" + +test_begin_subtest "Show another raw message" +output=$(notmuch show --format=raw id:msg-002@notmuch-test-suite | notmuch_date_sanitize) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Message-Id: <msg-002@notmuch-test-suite> +Subject: Test message #2 +Date: GENERATED_DATE + +This is just a test message (#2)" + +test_done diff --git a/test/T220-reply.sh b/test/T220-reply.sh new file mode 100755 index 00000000..ebe710f9 --- /dev/null +++ b/test/T220-reply.sh @@ -0,0 +1,322 @@ +#!/usr/bin/env bash +test_description="\"notmuch reply\" in several variations" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Basic reply" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=test_suite@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="basic reply test"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> basic reply test +OK" + +test_begin_subtest "Multiple recipients" +add_message '[from]="Sender <sender@example.com>"' \ + '[to]="test_suite@notmuchmail.org, Someone Else <someone@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="Multiple recipients"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, Someone Else <someone@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> Multiple recipients +OK" + +test_begin_subtest "Reply with CC" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=test_suite@notmuchmail.org \ + '[cc]="Other Parties <cc@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="reply with CC"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com> +Cc: Other Parties <cc@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> reply with CC +OK" + +test_begin_subtest "Reply from alternate address" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=test_suite_other@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="reply from alternate address"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> reply from alternate address +OK" + +test_begin_subtest "Reply from address in named group list" +add_message '[from]="Sender <sender@example.com>"' \ + '[to]=group:test_suite@notmuchmail.org,someone@example.com\;' \ + [cc]=test_suite_other@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="Reply from address in named group list"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, someone@example.com +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> Reply from address in named group list +OK" + +test_begin_subtest "Support for Reply-To" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=test_suite@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="support for reply-to"' \ + '[reply-to]="Sender <elsewhere@example.com>"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <elsewhere@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> support for reply-to +OK" + +test_begin_subtest "Un-munging Reply-To" +add_message '[from]="Sender <sender@example.com>"' \ + '[to]="Some List <list@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="Un-munging Reply-To"' \ + '[reply-to]="Evil Munging List <list@example.com>"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, Some List <list@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> Un-munging Reply-To +OK" + +test_begin_subtest "Un-munging Reply-To With Exact Match" +add_message '[from]="Sender <sender@example.com>"' \ + '[to]="Some List <list@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="Un-munging Reply-To"' \ + '[reply-to]="Some List <list@example.com>"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, Some List <list@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> Un-munging Reply-To +OK" + +test_begin_subtest "Un-munging Reply-To With Raw addr-spec" +add_message '[from]="Sender <sender@example.com>"' \ + '[to]="Some List <list@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="Un-munging Reply-To"' \ + '[reply-to]="list@example.com"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, Some List <list@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> Un-munging Reply-To +OK" + +test_begin_subtest "Message with header of exactly 200 bytes" +add_message '[subject]="This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="200-byte header"' +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: This subject is exactly 200 bytes in length. Other than its + length there is not much of note here. Note that the length of 200 bytes + includes the Subject: and Re: prefixes with two spaces +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote: +> 200-byte header +OK" + +test_begin_subtest "From guessing: Envelope-To" +add_message '[from]="Sender <sender@example.com>"' \ + '[to]="Recipient <recipient@example.com>"' \ + '[subject]="From guessing"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="From guessing"' \ + '[header]="Envelope-To: test_suite_other@notmuchmail.org"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org> +Subject: Re: From guessing +To: Sender <sender@example.com>, Recipient <recipient@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> From guessing +OK" + +test_begin_subtest "From guessing: X-Original-To" +add_message '[from]="Sender <sender@example.com>"' \ + '[to]="Recipient <recipient@example.com>"' \ + '[subject]="From guessing"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="From guessing"' \ + '[header]="X-Original-To: test_suite@otherdomain.org"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@otherdomain.org> +Subject: Re: From guessing +To: Sender <sender@example.com>, Recipient <recipient@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> From guessing +OK" + +test_begin_subtest "From guessing: Delivered-To" +add_message '[from]="Sender <sender@example.com>"' \ + '[to]="Recipient <recipient@example.com>"' \ + '[subject]="From guessing"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="From guessing"' \ + '[header]="Delivered-To: test_suite_other@notmuchmail.org"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org> +Subject: Re: From guessing +To: Sender <sender@example.com>, Recipient <recipient@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> From guessing +OK" + +test_begin_subtest "Reply with RFC 2047-encoded headers" +add_message '[subject]="=?iso-8859-1?q?=e0=df=e7?="' \ + '[from]="=?utf-8?q?=e2=98=83?= <snowman@example.com>"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="Encoding"' + +# GMime happens to change from Q- to B-encoding. We canonicalize the +# case of the encoding and charset because different versions of GMime +# capitalize the encoding differently. +output=$( (notmuch reply id:${gen_msg_id} 2>&1 && echo OK) | perl -pe 's/=\?[^?]+\?[bB]\?/lc($&)/ge') +test_expect_equal "$output" "\ +From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: =?iso-8859-1?b?4N/n?= +To: =?utf-8?b?4piD?= <snowman@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, ☃ <snowman@example.com> wrote: +> Encoding +OK" + +test_begin_subtest "Reply with RFC 2047-encoded headers (JSON)" +output=$(echo '{"answer":' && notmuch reply --format=json id:${gen_msg_id} 2>&1 && echo ', "success": "OK"}') +test_expect_equal_json "$output" ' +{ "answer": { + "original": { + "body": [ + { + "content": "Encoding\n", + "content-type": "text/plain", + "id": 1 + } + ], + "date_relative": "2010-01-05", + "excluded": false, + "filename": ["'${MAIL_DIR}'/msg-014"], + "headers": { + "Date": "Tue, 05 Jan 2010 15:43:56 +0000", + "From": "\u2603 <snowman@example.com>", + "Subject": "\u00e0\u00df\u00e7", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>" + }, + "id": "'${gen_msg_id}'", + "match": false, + "tags": [ + "inbox", + "unread" + ], + "timestamp": 1262706236 + }, + "reply-headers": { + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "In-reply-to": "<'${gen_msg_id}'>", + "References": "<'${gen_msg_id}'>", + "Subject": "Re: \u00e0\u00df\u00e7", + "To": "\u2603 <snowman@example.com>" + } + }, + "success": "OK" +}' + +test_begin_subtest "Reply to a message with multiple Cc headers" +add_email_corpus broken +output=$(notmuch reply id:multiple-cc@example.org 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: wowsers! +To: Alice <alice@example.org>, Daniel <daniel@example.org> +Cc: Bob <bob@example.org>, Charles <charles@example.org> +In-Reply-To: <multiple-cc@example.org> +References: <multiple-cc@example.org> + +On Thu, 16 Jun 2016 22:14:41 -0400, Alice <alice@example.org> wrote: +> Note the Cc: and cc: headers. +OK" + +test_done diff --git a/test/T230-reply-to-sender.sh b/test/T230-reply-to-sender.sh new file mode 100755 index 00000000..134a1063 --- /dev/null +++ b/test/T230-reply-to-sender.sh @@ -0,0 +1,211 @@ +#!/usr/bin/env bash +test_description="\"notmuch reply --reply-to=sender\" in several variations" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Basic reply-to-sender" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=test_suite@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="basic reply-to-sender test"' + +output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> basic reply-to-sender test" + +test_begin_subtest "From Us, Basic reply to message" +add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \ + '[to]="Recipient <recipient@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="basic reply-to-from-us test"' + +output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Recipient <recipient@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote: +> basic reply-to-from-us test" + +test_begin_subtest "Multiple recipients" +add_message '[from]="Sender <sender@example.com>"' \ + '[to]="test_suite@notmuchmail.org, Someone Else <someone@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="Multiple recipients"' + +output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> Multiple recipients" + +test_begin_subtest "From Us, Multiple TO recipients" +add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \ + '[to]="Recipient <recipient@example.com>, Someone Else <someone@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="From Us, Multiple TO recipients"' + +output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Recipient <recipient@example.com>, Someone Else <someone@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote: +> From Us, Multiple TO recipients" + +test_begin_subtest "Reply with CC" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=test_suite@notmuchmail.org \ + '[cc]="Other Parties <cc@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="reply with CC"' + +output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> reply with CC" + +test_begin_subtest "From Us, Reply with CC" +add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \ + '[to]="Recipient <recipient@example.com>"' \ + '[cc]="Other Parties <cc@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="reply with CC"' + +output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Recipient <recipient@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote: +> reply with CC" + +test_begin_subtest "From Us, Reply no TO but with CC" +add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \ + '[cc]="Other Parties <cc@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="reply with CC"' + +output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +Cc: Other Parties <cc@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote: +> reply with CC" + +test_begin_subtest "Reply from alternate address" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=test_suite_other@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="reply from alternate address"' + +output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> reply from alternate address" + +test_begin_subtest "Support for Reply-To" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=test_suite@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="support for reply-to"' \ + '[reply-to]="Sender <elsewhere@example.com>"' + +output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <elsewhere@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> support for reply-to" + +test_begin_subtest "Support for Reply-To with multiple recipients" +add_message '[from]="Sender <sender@example.com>"' \ + '[to]="test_suite@notmuchmail.org, Someone Else <someone@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="support for reply-to with multiple recipients"' \ + '[reply-to]="Sender <elsewhere@example.com>"' + +output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <elsewhere@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> support for reply-to with multiple recipients" + +test_begin_subtest "Un-munging Reply-To" +add_message '[from]="Sender <sender@example.com>"' \ + '[to]="Some List <list@example.com>"' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="Un-munging Reply-To"' \ + '[reply-to]="Evil Munging List <list@example.com>"' + +output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com> +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> Un-munging Reply-To" + +test_begin_subtest "Message with header of exactly 200 bytes" +add_message '[subject]="This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="200-byte header"' +output=$(notmuch reply --reply-to=sender id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: This subject is exactly 200 bytes in length. Other than its + length there is not much of note here. Note that the length of 200 bytes + includes the Subject: and Re: prefixes with two spaces +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote: +> 200-byte header" +test_done diff --git a/test/T240-dump-restore.sh b/test/T240-dump-restore.sh new file mode 100755 index 00000000..0870ff92 --- /dev/null +++ b/test/T240-dump-restore.sh @@ -0,0 +1,344 @@ +#!/usr/bin/env bash +test_description="\"notmuch dump\" and \"notmuch restore\"" +. $(dirname "$0")/test-lib.sh || exit 1 + +NOTMUCH_NEW > /dev/null +test_begin_subtest "dump header" +cat <<EOF > EXPECTED +#notmuch-dump batch-tag:3 config,properties,tags +EOF +notmuch dump > OUTPUT +test_expect_equal_file EXPECTED OUTPUT +add_email_corpus + +test_begin_subtest "Dumping all tags" +test_expect_success 'generate_message && notmuch new && notmuch dump > dump.expected' + +# The use of from:cworth is rather arbitrary: it matches some of the +# email corpus' messages, but not all of them. + +test_begin_subtest "Dumping all tags II" +test_expect_success \ + 'notmuch tag +ABC +DEF -- from:cworth && + notmuch dump > dump-ABC_DEF.expected && + ! cmp dump.expected dump-ABC_DEF.expected' + +test_begin_subtest "Clearing all tags" +test_expect_success \ + 'sed -e "s/(\([^(]*\))$/()/" < dump.expected > clear.expected && + notmuch restore --input=clear.expected && + notmuch dump > clear.actual && + test_cmp clear.expected clear.actual' + +test_begin_subtest "Clearing all tags" +test_expect_success \ + 'notmuch tag +ABC +DEF -- from:cworth && + notmuch restore --accumulate < dump.expected && + notmuch dump > dump.actual && + test_cmp dump-ABC_DEF.expected dump.actual' + +test_begin_subtest "Restoring original tags" +test_expect_success \ + 'notmuch restore --input=dump.expected && + notmuch dump > dump.actual && + test_cmp dump.expected dump.actual' + +test_begin_subtest "Restore with nothing to do" +test_expect_success \ + 'notmuch restore < dump.expected && + notmuch dump > dump.actual && + test_cmp dump.expected dump.actual' + +test_begin_subtest "Accumulate with existing tags" +test_expect_success \ + 'notmuch restore --accumulate --input=dump.expected && + notmuch dump > dump.actual && + test_cmp dump.expected dump.actual' + +test_begin_subtest "Accumulate with no tags" +test_expect_success \ + 'notmuch restore --accumulate < clear.expected && + notmuch dump > dump.actual && + test_cmp dump.expected dump.actual' + +test_begin_subtest "Accumulate with new tags" +test_expect_success \ + 'notmuch restore --input=dump.expected && + notmuch restore --accumulate --input=dump-ABC_DEF.expected && + notmuch dump > OUTPUT.$test_count && + notmuch restore --input=dump.expected && + test_cmp dump-ABC_DEF.expected OUTPUT.$test_count' + +# notmuch restore currently only considers the first argument. +test_begin_subtest "Invalid restore invocation" +test_expect_success \ + 'test_must_fail notmuch restore --input=dump.expected another_one' + +test_begin_subtest "dump --output=outfile" +notmuch dump --output=dump-outfile.actual +test_expect_equal_file dump.expected dump-outfile.actual + +test_begin_subtest "dump --output=outfile --" +notmuch dump --output=dump-1-arg-dash.actual -- +test_expect_equal_file dump.expected dump-1-arg-dash.actual + +# gzipped output + +test_begin_subtest "dump --gzip" +notmuch dump --gzip > dump-gzip.gz +gunzip dump-gzip.gz +test_expect_equal_file dump.expected dump-gzip + +test_begin_subtest "dump --gzip --output=outfile" +notmuch dump --gzip --output=dump-gzip-outfile.gz +gunzip dump-gzip-outfile.gz +test_expect_equal_file dump.expected dump-gzip-outfile + +test_begin_subtest "restoring gzipped stdin" +notmuch dump --gzip --output=backup.gz +notmuch tag +new_tag '*' +notmuch restore < backup.gz +notmuch dump --output=dump.actual +test_expect_equal_file dump.expected dump.actual + +test_begin_subtest "restoring gzipped file" +notmuch dump --gzip --output=backup.gz +notmuch tag +new_tag '*' +notmuch restore --input=backup.gz +notmuch dump --output=dump.actual +test_expect_equal_file dump.expected dump.actual + +# Note, we assume all messages from cworth have a message-id +# containing cworth.org + +{ head -1 dump.expected ; grep 'cworth[.]org' dump.expected; } > dump-cworth.expected + +test_begin_subtest "dump -- from:cworth" +notmuch dump -- from:cworth > dump-dash-cworth.actual +test_expect_equal_file dump-cworth.expected dump-dash-cworth.actual + +test_begin_subtest "dump --output=outfile from:cworth" +notmuch dump --output=dump-outfile-cworth.actual from:cworth +test_expect_equal_file dump-cworth.expected dump-outfile-cworth.actual + +test_begin_subtest "dump --output=outfile -- from:cworth" +notmuch dump --output=dump-outfile-dash-inbox.actual -- from:cworth +test_expect_equal_file dump-cworth.expected dump-outfile-dash-inbox.actual + +test_begin_subtest "Check for a safe set of message-ids" +notmuch search --output=messages from:cworth | sed s/^id:// > EXPECTED +notmuch search --output=messages from:cworth | sed s/^id:// |\ + $TEST_DIRECTORY/hex-xcode --direction=encode > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "format=batch-tag, dump sanity check." +NOTMUCH_DUMP_TAGS --format=sup from:cworth | cut -f1 -d' ' | \ + sort > EXPECTED.$test_count +NOTMUCH_DUMP_TAGS --format=batch-tag from:cworth | sed 's/^.*-- id://' | \ + sort > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest "format=batch-tag, missing newline" +printf "+a_tag_without_newline -- id:20091117232137.GA7669@griffis1.net" > IN +notmuch restore --accumulate < IN +NOTMUCH_DUMP_TAGS id:20091117232137.GA7669@griffis1.net > OUT +cat <<EOF > EXPECTED ++a_tag_without_newline +inbox +unread -- id:20091117232137.GA7669@griffis1.net +EOF +test_expect_equal_file EXPECTED OUT + +test_begin_subtest "format=batch-tag, # round-trip" +notmuch dump --format=sup | sort > EXPECTED.$test_count +notmuch dump --format=batch-tag > DUMPFILE +notmuch restore --format=batch-tag < DUMPFILE +notmuch dump --format=sup | sort > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest "format=batch-tag, # blank lines and comments" +notmuch dump --format=batch-tag| sort > EXPECTED.$test_count +notmuch restore <<EOF +# this line is a comment; the next has only white space + + +# the previous line is empty +EOF +notmuch dump --format=batch-tag | sort > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest "format=batch-tag, # reverse-round-trip empty tag" +cat <<EOF >EXPECTED.$test_count ++ -- id:20091117232137.GA7669@griffis1.net +EOF +notmuch restore --format=batch-tag < EXPECTED.$test_count +NOTMUCH_DUMP_TAGS --format=batch-tag id:20091117232137.GA7669@griffis1.net > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +tag1='comic_swear=$&^%$^%\\//-+$^%$' +enc1=$($TEST_DIRECTORY/hex-xcode --direction=encode "$tag1") + +tag2=$(printf 'this\n tag\t has\n spaces') +enc2=$($TEST_DIRECTORY/hex-xcode --direction=encode "$tag2") + +enc3='%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a' +tag3=$($TEST_DIRECTORY/hex-xcode --direction=decode $enc3) + +notmuch dump --format=batch-tag > BACKUP + +notmuch tag +"$tag1" +"$tag2" +"$tag3" -inbox -unread "*" + +# initial segment of file used for several tests below. +cat <<EOF > comments-and-blanks +# this is a comment + +# next line has leading whitespace + + +EOF + +test_begin_subtest 'restoring empty file is not an error' +notmuch restore < /dev/null 2>OUTPUT.$test_count +cp /dev/null EXPECTED +test_expect_equal_file EXPECTED OUTPUT.$test_count + +test_begin_subtest 'file of comments and blank lines is not an error' +notmuch restore --input=comments-and-blanks +ret_val=$? +test_expect_equal "$ret_val" "0" + +cp comments-and-blanks leading-comments-blanks-batch-tag +echo "+some_tag -- id:yun1vjwegii.fsf@aiko.keithp.com" \ + >> leading-comments-blanks-batch-tag + +test_begin_subtest 'detect format=batch-tag with leading comments and blanks' +notmuch restore --input=leading-comments-blanks-batch-tag +notmuch search --output=tags id:yun1vjwegii.fsf@aiko.keithp.com > OUTPUT.$test_count +echo "some_tag" > EXPECTED +test_expect_equal_file EXPECTED OUTPUT.$test_count + +cp comments-and-blanks leading-comments-blanks-sup +echo "yun1vjwegii.fsf@aiko.keithp.com (another_tag)" \ + >> leading-comments-blanks-sup + +test_begin_subtest 'detect format=sup with leading comments and blanks' +notmuch restore --input=leading-comments-blanks-sup +notmuch search --output=tags id:yun1vjwegii.fsf@aiko.keithp.com > OUTPUT.$test_count +echo "another_tag" > EXPECTED +test_expect_equal_file EXPECTED OUTPUT.$test_count + +test_begin_subtest 'format=batch-tag, round trip with strange tags' +notmuch dump --format=batch-tag > EXPECTED.$test_count +notmuch dump --format=batch-tag > DUMPFILE +notmuch restore --format=batch-tag < DUMPFILE +notmuch dump --format=batch-tag > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest 'format=batch-tag, checking encoded output' +NOTMUCH_DUMP_TAGS --format=batch-tag -- from:cworth |\ + awk "{ print \"+$enc1 +$enc2 +$enc3 -- \" \$5 }" > EXPECTED.$test_count +NOTMUCH_DUMP_TAGS --format=batch-tag -- from:cworth > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest 'restoring sane tags' +notmuch restore --format=batch-tag < BACKUP +notmuch dump --format=batch-tag > OUTPUT.$test_count +test_expect_equal_file BACKUP OUTPUT.$test_count + +test_begin_subtest 'format=batch-tag, restore=auto' +notmuch dump --format=batch-tag > EXPECTED.$test_count +notmuch tag -inbox -unread "*" +notmuch restore --format=auto < EXPECTED.$test_count +notmuch dump --format=batch-tag > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest 'format=sup, restore=auto' +notmuch dump --format=sup > EXPECTED.$test_count +notmuch tag -inbox -unread "*" +notmuch restore --format=auto < EXPECTED.$test_count +notmuch dump --format=sup > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest 'format=batch-tag, restore=default' +notmuch dump --format=batch-tag > EXPECTED.$test_count +notmuch tag -inbox -unread "*" +notmuch restore < EXPECTED.$test_count +notmuch dump --format=batch-tag > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest 'format=sup, restore=default' +notmuch dump --format=sup > EXPECTED.$test_count +notmuch tag -inbox -unread "*" +notmuch restore < EXPECTED.$test_count +notmuch dump --format=sup > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest 'restore: checking error messages' +notmuch restore <<EOF 2>OUTPUT +# the next line has a space + +a ++0 ++a +b +# trailing whitespace ++a +b ++c +d -- +# this is a harmless comment, do not yell about it. + +# the previous line was blank; also no yelling please ++%zz -- id:whatever ++e +f id:" ++e +f tag:abc +# the next non-comment line should report an an empty tag error for +# batch tagging, but not for restore ++ +e -- id:20091117232137.GA7669@griffis1.net +# valid id, but warning about missing message ++e id:missing_message_id +# exercise parser ++e -- id:some)stuff ++e -- id:some stuff ++e -- id:some"stuff ++e -- id:"a_message_id_with""_a_quote" ++e -- id:"a message id with spaces" ++e -- id:an_id_with_leading_and_trailing_ws \ + +EOF + +cat <<EOF > EXPECTED +Warning: cannot parse query: a (skipping) +Warning: no query string [+0] +Warning: no query string [+a +b] +Warning: missing query string [+a +b ] +Warning: no query string after -- [+c +d --] +Warning: hex decoding of tag %zz failed [+%zz -- id:whatever] +Warning: cannot parse query: id:" (skipping) +Warning: not an id query: tag:abc (skipping) +Warning: cannot apply tags to missing message: missing_message_id +Warning: cannot parse query: id:some)stuff (skipping) +Warning: cannot parse query: id:some stuff (skipping) +Warning: cannot apply tags to missing message: some"stuff +Warning: cannot apply tags to missing message: a_message_id_with"_a_quote +Warning: cannot apply tags to missing message: a message id with spaces +Warning: cannot apply tags to missing message: an_id_with_leading_and_trailing_ws +EOF + +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'roundtripping random message-ids and tags' + + ${TEST_DIRECTORY}/random-corpus --config-path=${NOTMUCH_CONFIG} \ + --num-messages=100 + + notmuch dump --format=batch-tag| \ + sort > EXPECTED.$test_count + + notmuch tag +this_tag_is_very_unlikely_to_be_random '*' + + notmuch restore --format=batch-tag < EXPECTED.$test_count + + notmuch dump --format=batch-tag| \ + sort > OUTPUT.$test_count + +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_done + +# Note the database is "poisoned" for sup format at this point. diff --git a/test/T250-uuencode.sh b/test/T250-uuencode.sh new file mode 100755 index 00000000..251c0b40 --- /dev/null +++ b/test/T250-uuencode.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +test_description="handling of uuencoded data" +. $(dirname "$0")/test-lib.sh || exit 1 + +add_message [subject]=uuencodetest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \ +'[body]="This message is used to ensure that notmuch correctly handles a +message containing a block of uuencoded data. First, we have a marker +this content beforeuudata . Then we begin the uuencoded data itself: + +begin 644 bogus-uuencoded-data +M0123456789012345678901234567890123456789012345678901234567890 +MOBVIOUSLY, THIS IS NOT ANY SORT OF USEFUL UUENCODED DATA. +MINSTEAD THIS IS JUST A WAY TO ENSURE THAT THIS BLOCK OF DATA +MIS CORRECTLY IGNORED WHEN NOTMUCH CREATES ITS INDEX. SO WE +MINCLUDE A DURINGUUDATA MARKER THAT SHOULD NOT RESULT IN ANY +MSEARCH RESULT. +\\\` +end + +Finally, we have our afteruudata marker as well."' + +test_begin_subtest "Ensure content before uu data is indexed" +output=$(notmuch search beforeuudata | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; uuencodetest (inbox unread)" + +test_begin_subtest "Ensure uu data is not indexed" +output=$(notmuch search DURINGUUDATA | notmuch_search_sanitize) +test_expect_equal "$output" "" + +test_begin_subtest "Ensure content after uu data is indexed" +output=$(notmuch search afteruudata | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; uuencodetest (inbox unread)" + +test_done diff --git a/test/T260-thread-order.sh b/test/T260-thread-order.sh new file mode 100755 index 00000000..fea61275 --- /dev/null +++ b/test/T260-thread-order.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +test_description="threading when messages received out of order" +. $(dirname "$0")/test-lib.sh || exit 1 + +# Generate all single-root four message thread structures. We'll use +# this for multiple tests below. +THREADS=$($NOTMUCH_PYTHON ${NOTMUCH_SRCDIR}/test/gen-threads.py 4) +nthreads=$(wc -l <<< "$THREADS") + +test_begin_subtest "Messages with one parent get linked in all delivery orders" +# In the first variant, this delivers messages that reference only +# their immediate parent. Hence, we should only expect threads to be +# fully joined at the end. +for ((n = 0; n < 4; n++)); do + # Deliver the n'th message of every thread + thread=0 + while read -a parents; do + parent=${parents[$n]} + generate_message \ + [id]=m$n@t$thread [in-reply-to]="\<m$parent@t$thread\>" \ + [subject]=p$thread [from]=m$n + thread=$((thread + 1)) + done <<< "$THREADS" + notmuch new > /dev/null +done +output=$(notmuch search --sort=newest-first '*' | notmuch_search_sanitize) +expected=$(for ((i = 0; i < $nthreads; i++)); do + echo "thread:XXX 2001-01-05 [4/4] m3, m2, m1, m0; p$i (inbox unread)" + done) +test_expect_equal "$output" "$expected" + +test_begin_subtest "Messages with all parents get linked in all delivery orders" +# Here we do the same thing as the previous test, but each message +# references all of its parents. Since every message references the +# root of the thread, each thread should always be fully joined. This +# is currently broken because of the bug detailed in +# id:8738h7kv2q.fsf@qmul.ac.uk. +rm ${MAIL_DIR}/* +notmuch new > /dev/null +output="" +expected="" +for ((n = 0; n < 4; n++)); do + # Deliver the n'th message of every thread + thread=0 + while read -a parents; do + references="" + parent=${parents[$n]} + while [[ ${parent:-None} != None ]]; do + references="<m$parent@t$thread> $references" + pp=$parent + parent=${parents[$parent]} + # Avoid looping over broken input (if ever) + parents[$pp]="None" + done + + generate_message \ + [id]=m$n@t$thread [references]="'$references'" \ + [subject]=p$thread [from]=m$n + thread=$((thread + 1)) + done <<< "$THREADS" + notmuch new > /dev/null + + output="$output +$(notmuch search --sort=newest-first '*' | notmuch_search_sanitize)" + + # Construct expected output + template="thread:XXX 2001-01-05 [$((n+1))/$((n+1))]" + for ((m = n; m > 0; m--)); do + template="$template m$m," + done + expected="$expected +$(for ((i = 0; i < $nthreads; i++)); do + echo "$template m0; p$i (inbox unread)" + done)" +done +test_expect_equal "$output" "$expected" + +test_done diff --git a/test/T270-author-order.sh b/test/T270-author-order.sh new file mode 100755 index 00000000..c28ecb02 --- /dev/null +++ b/test/T270-author-order.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +test_description="author reordering;" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Adding parent message" +generate_message [body]=findme [id]=new-parent-id [subject]=author-reorder-threadtest '[from]="User <user@example.com>"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Adding initial child message" +generate_message [body]=findme "[in-reply-to]=\<new-parent-id\>" [subject]=author-reorder-threadtest '[from]="User1 <user1@example.com>"' '[date]="Sat, 01 Jan 2000 12:01:00 -0000"' +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Adding second child message" +generate_message [body]=findme "[in-reply-to]=\<new-parent-id\>" [subject]=author-reorder-threadtest '[from]="User2 <user2@example.com>"' '[date]="Sat, 01 Jan 2000 12:02:00 -0000"' +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Searching when all three messages match" +output=$(notmuch search findme | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [3/3] User, User1, User2; author-reorder-threadtest (inbox unread)" + +test_begin_subtest "Searching when two messages match" +output=$(notmuch search User1 or User2 | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [2/3] User1, User2| User; author-reorder-threadtest (inbox unread)" + +test_begin_subtest "Searching when only one message matches" +output=$(notmuch search User2 | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/3] User2| User, User1; author-reorder-threadtest (inbox unread)" + +test_begin_subtest "Searching when only first message matches" +output=$(notmuch search User | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/3] User| User1, User2; author-reorder-threadtest (inbox unread)" + +test_begin_subtest "Adding duplicate author" +generate_message [body]=findme "[in-reply-to]=\<new-parent-id\>" [subject]=author-reorder-threadtest '[from]="User1 <user1@example.com>"' '[date]="Sat, 01 Jan 2000 12:03:00 -0000"' +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Searching when all four messages match" +output=$(notmuch search findme | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [4/4] User, User1, User2; author-reorder-threadtest (inbox unread)" + +test_begin_subtest "Adding non-monotonic child message" +generate_message [body]=findme "[in-reply-to]=\<new-parent-id\>" [subject]=author-reorder-threadtest '[from]="User0 <user0@example.com>"' '[date]="Sat, 01 Jan 2000 11:00:00 -0000"' +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Searching non-monotonic messages (oldest-first)" +output=$(notmuch search --sort=oldest-first findme | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [5/5] User0, User, User1, User2; author-reorder-threadtest (inbox unread)" + +test_begin_subtest "Searching non-monotonic messages (newest-first)" +output=$(notmuch search --sort=newest-first findme | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [5/5] User0, User, User1, User2; author-reorder-threadtest (inbox unread)" + +test_done diff --git a/test/T280-from-guessing.sh b/test/T280-from-guessing.sh new file mode 100755 index 00000000..b8718232 --- /dev/null +++ b/test/T280-from-guessing.sh @@ -0,0 +1,217 @@ +#!/usr/bin/env bash +test_description="From line heuristics (with multiple configured addresses)" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Magic from guessing (nothing to go on)" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$(notmuch reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, mailinglist@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (Envelope-to:)" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[header]="Envelope-To: test_suite_other@notmuchmail.org"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$(notmuch reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, mailinglist@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (X-Original-To:)" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[header]="X-Original-To: test_suite_other@notmuchmail.org"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$(notmuch reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, mailinglist@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (Received: .. for ..)" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1]) + by mail.notmuchmail.org (some MTA) with ESMTP id 12345678 + for <test_suite_other@notmuchmail.org>; Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$(notmuch reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, mailinglist@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (Received: domain)" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1]) + by mail.otherdomain.org (some MTA) with ESMTP id 12345678 + Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$(notmuch reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@otherdomain.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, mailinglist@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (multiple Received: headers)" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + "[header]=\"Received: from extraneous.example.com (extraneous.example.com [1.1.1.1]) +Received: from mail.example.com (mail.example.com [1.1.1.1]) + by mail.otherdomain.org (some MTA) with ESMTP id 12345678 + for <test_suite_other@notmuchmail.org>; Sat, 10 Apr 2010 07:54:51 -0400 (EDT) +Received: from extraneous.example.com (extraneous.example.com [1.1.1.1])\"" \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output="$(notmuch reply id:${gen_msg_id})" +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, mailinglist@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> from guessing test" + +test_begin_subtest "Testing From line heuristics (with single configured address)" +sed -i -e "s/^other_email.*//" "${NOTMUCH_CONFIG}" +test_expect_equal '' '' + +test_begin_subtest "Magic from guessing (nothing to go on)" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$(notmuch reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, mailinglist@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (Envelope-to:)" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[header]="Envelope-To: test_suite_other@notmuchmail.org"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$(notmuch reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, mailinglist@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (X-Original-To:)" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[header]="X-Original-To: test_suite_other@notmuchmail.org"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$(notmuch reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, mailinglist@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (Received: .. for ..)" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1]) + by mail.notmuchmail.org (some MTA) with ESMTP id 12345678 + for <test_suite_other@notmuchmail.org>; Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$(notmuch reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, mailinglist@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (Received: domain)" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1]) + by mail.otherdomain.org (some MTA) with ESMTP id 12345678 + Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$(notmuch reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: notmuch-reply-test +To: Sender <sender@example.com>, mailinglist@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote: +> from guessing test" + +test_done diff --git a/test/T290-long-id.sh b/test/T290-long-id.sh new file mode 100755 index 00000000..5e3879f5 --- /dev/null +++ b/test/T290-long-id.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +test_description="messages with ridiculously-long message IDs" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Referencing long ID before adding" +generate_message '[subject]="Reference of ridiculously-long message ID"' \ + "[references]=\<abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-\>" +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Adding message with long ID" +generate_message '[subject]="A ridiculously-long message ID"' \ + "[id]=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-" +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Referencing long ID after adding" +generate_message '[subject]="Reply to ridiculously-long message ID"' \ + "[in-reply-to]=\<abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-\>" +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Ensure all messages were threaded together" +output=$(notmuch search 'subject:"a ridiculously-long message ID"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/3] Notmuch Test Suite; A ridiculously-long message ID (inbox unread)" + +test_done diff --git a/test/T300-encoding.sh b/test/T300-encoding.sh new file mode 100755 index 00000000..1e9d2a3d --- /dev/null +++ b/test/T300-encoding.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash +test_description="encoding issues" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Message with text of unknown charset" +add_message '[content-type]="text/plain; charset=unknown-8bit"' \ + "[body]=irrelevant" +output=$(notmuch show id:${gen_msg_id} 2>&1 | notmuch_show_sanitize_all) +test_expect_equal "$output" "message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox unread) +Subject: Message with text of unknown charset +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: GENERATED_DATE +header} +body{ +part{ ID: 1, Content-type: text/plain +irrelevant +part} +body} +message}" + +test_begin_subtest "Search for ISO-8859-2 encoded message" +add_message '[content-type]="text/plain; charset=iso-8859-2"' \ + '[content-transfer-encoding]=8bit' \ + '[subject]="ISO-8859-2 encoded message"' \ + "[body]=$'Czech word tu\350\362\341\350\350\355 means pinguin\'s.'" # ISO-8859-2 characters are generated by shell's escape sequences +output=$(notmuch search tuÄňáÄÄà 2>&1 | notmuch_show_sanitize_all) +test_expect_equal "$output" "thread:0000000000000002 2001-01-05 [1/1] Notmuch Test Suite; ISO-8859-2 encoded message (inbox unread)" + +test_begin_subtest "RFC 2047 encoded word with spaces" +add_message '[subject]="=?utf-8?q?encoded word with spaces?="' +output=$(notmuch search id:${gen_msg_id} 2>&1 | notmuch_show_sanitize) +test_expect_equal "$output" "thread:0000000000000003 2001-01-05 [1/1] Notmuch Test Suite; encoded word with spaces (inbox unread)" + +test_begin_subtest "RFC 2047 encoded words back to back" +add_message '[subject]="=?utf-8?q?encoded-words-back?==?utf-8?q?to-back?="' +output=$(notmuch search id:${gen_msg_id} 2>&1 | notmuch_show_sanitize) +test_expect_equal "$output" "thread:0000000000000004 2001-01-05 [1/1] Notmuch Test Suite; encoded-words-backto-back (inbox unread)" + +test_begin_subtest "RFC 2047 encoded words without space before or after" +add_message '[subject]="=?utf-8?q?encoded?=word without=?utf-8?q?space?=" ' +output=$(notmuch search id:${gen_msg_id} 2>&1 | notmuch_show_sanitize) +test_expect_equal "$output" "thread:0000000000000005 2001-01-05 [1/1] Notmuch Test Suite; encodedword withoutspace (inbox unread)" + +test_begin_subtest "Mislabeled Windows-1252 encoding" +add_message '[content-type]="text/plain; charset=iso-8859-1"' \ + "[body]=$'This text contains \x93Windows-1252\x94 character codes.'" +cat <<EOF > EXPECTED +message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox unread) +Subject: Mislabeled Windows-1252 encoding +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: GENERATED_DATE +header} +body{ +part{ ID: 1, Content-type: text/plain +This text contains “Windows-1252†character codes. +part} +body} +message} +EOF +notmuch show id:${gen_msg_id} 2>&1 | notmuch_show_sanitize_all > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh new file mode 100755 index 00000000..5935819f --- /dev/null +++ b/test/T310-emacs.sh @@ -0,0 +1,1134 @@ +#!/usr/bin/env bash + +test_description="emacs interface" +. $(dirname "$0")/test-lib.sh || exit 1 + +EXPECTED=$NOTMUCH_SRCDIR/test/emacs.expected-output + +add_email_corpus + +# syntax errors in test-lib.el cause mysterious failures +test_begin_subtest "Syntax of emacs test library" +test_expect_success "${TEST_EMACS} -Q --batch --load $NOTMUCH_SRCDIR/test/test-lib.el" + +test_begin_subtest "Basic notmuch-hello view in emacs" +test_emacs '(notmuch-hello) + (test-output)' +test_expect_equal_file $EXPECTED/notmuch-hello OUTPUT + +test_begin_subtest "Saved search with 0 results" +test_emacs '(let ((notmuch-show-empty-saved-searches t) + (notmuch-saved-searches + '\''(("inbox" . "tag:inbox") + ("unread" . "tag:unread") + ("empty" . "tag:doesnotexist")))) + (notmuch-hello) + (test-output))' +test_expect_equal_file $EXPECTED/notmuch-hello-with-empty OUTPUT + +test_begin_subtest "No saved searches displayed (all with 0 results)" +test_emacs '(let ((notmuch-saved-searches + '\''(("empty" . "tag:doesnotexist")))) + (notmuch-hello) + (test-output))' +test_expect_equal_file $EXPECTED/notmuch-hello-no-saved-searches OUTPUT + +test_begin_subtest "Basic notmuch-search view in emacs" +test_emacs '(notmuch-search "tag:inbox") + (notmuch-test-wait) + (test-output)' +test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox OUTPUT + +test_begin_subtest "Incremental parsing of search results" +test_emacs "(ad-enable-advice 'notmuch-search-process-filter 'around 'pessimal) + (ad-activate 'notmuch-search-process-filter) + (notmuch-search \"tag:inbox\") + (notmuch-test-wait) + (ad-disable-advice 'notmuch-search-process-filter 'around 'pessimal) + (ad-activate 'notmuch-search-process-filter) + (test-output)" +test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox OUTPUT + +test_begin_subtest "Navigation of notmuch-hello to search results" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (test-output)' +test_expect_equal_file $EXPECTED/notmuch-hello-view-inbox OUTPUT + +test_begin_subtest "Basic notmuch-show view in emacs" +maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu) +test_emacs "(notmuch-show \"$maildir_storage_thread\") + (test-output)" +test_expect_equal_file $EXPECTED/notmuch-show-thread-maildir-storage OUTPUT + +test_begin_subtest "Basic notmuch-show view in emacs default indentation" +maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu) +test_emacs "(let ((notmuch-show-indent-messages-width 1)) + (notmuch-show \"$maildir_storage_thread\") + (test-output))" +test_expect_equal_file $EXPECTED/notmuch-show-thread-maildir-storage OUTPUT + +test_begin_subtest "Basic notmuch-show view in emacs without indentation" +maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu) +test_emacs "(let ((notmuch-show-indent-messages-width 0)) + (notmuch-show \"$maildir_storage_thread\") + (test-output))" +test_expect_equal_file $EXPECTED/notmuch-show-thread-maildir-storage-without-indentation OUTPUT + +test_begin_subtest "Basic notmuch-show view in emacs with fourfold indentation" +maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu) +test_emacs "(let ((notmuch-show-indent-messages-width 4)) + (notmuch-show \"$maildir_storage_thread\") + (test-output))" +test_expect_equal_file $EXPECTED/notmuch-show-thread-maildir-storage-with-fourfold-indentation OUTPUT + +test_begin_subtest "notmuch-show for message with invalid From" +test_subtest_broken_gmime_3 +add_message "[subject]=\"message-with-invalid-from\"" \ + "[from]=\"\\\"Invalid \\\" From\\\" <test_suite@notmuchmail.org>\"" +thread=$(notmuch search --output=threads subject:message-with-invalid-from) +test_emacs "(notmuch-show \"$thread\") + (test-output \"OUTPUT.raw\")" +cat <<EOF >EXPECTED +"Invalid " (2001-01-05) (inbox) +Subject: message-with-invalid-from +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: GENERATED_DATE + +This is just a test message (#1) +EOF +notmuch_date_sanitize < OUTPUT.raw > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Navigation of notmuch-search to thread view" +test_emacs '(notmuch-search "tag:inbox") + (notmuch-test-wait) + (goto-char (point-min)) + (re-search-forward "Working with Maildir") + (notmuch-search-show-thread) + (notmuch-test-wait) + (test-output)' +test_expect_equal_file $EXPECTED/notmuch-show-thread-maildir-storage OUTPUT + +test_begin_subtest "Add tag from search view" +os_x_darwin_thread=$(notmuch search --output=threads id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com) +test_emacs "(notmuch-search \"$os_x_darwin_thread\") + (notmuch-test-wait) + (execute-kbd-macro \"+tag-from-search-view\")" +output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-search-view unread)" + +test_begin_subtest "Remove tag from search view" +test_emacs "(notmuch-search \"$os_x_darwin_thread\") + (notmuch-test-wait) + (execute-kbd-macro \"-tag-from-search-view\")" +output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)" + +test_begin_subtest "Add tag (large query)" +# We use a long query to force us into batch mode and use a funny tag +# that requires escaping for batch tagging. +test_emacs "(notmuch-tag (concat \"$os_x_darwin_thread\" \" or \" (mapconcat #'identity (make-list notmuch-tag-argument-limit \"x\") \"-\")) (list \"+tag-from-%-large-query\"))" +output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-%-large-query unread)" +notmuch tag -tag-from-%-large-query $os_x_darwin_thread + +test_begin_subtest "notmuch-show: add single tag to single message" +test_emacs "(notmuch-show \"$os_x_darwin_thread\") + (execute-kbd-macro \"+tag-from-show-view\")" +output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-show-view unread)" + +test_begin_subtest "notmuch-show: remove single tag from single message" +test_emacs "(notmuch-show \"$os_x_darwin_thread\") + (execute-kbd-macro \"-tag-from-show-view\")" +output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)" + +test_begin_subtest "notmuch-show: add multiple tags to single message" +test_emacs "(notmuch-show \"$os_x_darwin_thread\") + (execute-kbd-macro \"+tag1-from-show-view +tag2-from-show-view\")" +output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag1-from-show-view tag2-from-show-view unread)" + +test_begin_subtest "notmuch-show: remove multiple tags from single message" +test_emacs "(notmuch-show \"$os_x_darwin_thread\") + (execute-kbd-macro \"-tag1-from-show-view -tag2-from-show-view\")" +output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)" + +test_begin_subtest "Message with .. in Message-Id:" +add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"' +test_emacs '(notmuch-search "id:\"123..456@example\"") + (notmuch-test-wait) + (execute-kbd-macro "+search-add") + (execute-kbd-macro "+search-remove") + (execute-kbd-macro "-search-remove") + (notmuch-show "id:\"123..456@example\"") + (notmuch-test-wait) + (execute-kbd-macro "+show-add") + (execute-kbd-macro "+show-remove") + (execute-kbd-macro "-show-remove")' +output=$(notmuch search 'id:"123..456@example"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Message with .. in Message-Id (inbox search-add show-add)" + +test_begin_subtest "Message with quote in Message-Id:" +add_message '[id]="\"quote\"@example"' '[subject]="Message with quote in Message-Id"' +test_emacs '(notmuch-search "subject:\"Message with quote\"") + (notmuch-test-wait) + (execute-kbd-macro "+search-add") + (notmuch-search-show-thread) + (notmuch-test-wait) + (execute-kbd-macro "+show-add")' +output=$(notmuch search 'id:"""quote""@example"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Message with quote in Message-Id (inbox search-add show-add)" + +test_begin_subtest "Sending a message via (fake) SMTP" +emacs_deliver_message \ + 'Testing message sent via SMTP' \ + 'This is a test that messages are sent via SMTP' \ + '(message-goto-to) + (kill-whole-line) + (insert "To: user@example.com\n")' +sed \ + -e s',^Message-ID: <.*>$,Message-ID: <XXX>,' \ + -e s',^\(Content-Type: text/plain\); charset=us-ascii$,\1,' < sent_message >OUTPUT +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: user@example.com +Subject: Testing message sent via SMTP +Date: 01 Jan 2000 12:00:00 -0000 +Message-ID: <XXX> +MIME-Version: 1.0 +Content-Type: text/plain + +This is a test that messages are sent via SMTP +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Folding a long header when sending via (fake) SMTP" +long_subject="This is a long subject `echo {1..1000}`" +emacs_deliver_message \ + "${long_subject}" \ + 'This is a test that long headers are folded when messages are sent via SMTP' \ + '(message-goto-to) + (kill-whole-line) + (insert "To: user@example.com\n")' +sed \ + -e s',^Message-ID: <.*>$,Message-ID: <XXX>,' \ + -e s',^\(Content-Type: text/plain\); charset=us-ascii$,\1,' < sent_message >OUTPUT +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: user@example.com +Subject: This is a long subject 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 + 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 + 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 + 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 + 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 + 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 + 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 + 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 + 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 + 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 + 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 + 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 + 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 + 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 + 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 + 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 + 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 + 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 + 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 + 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 + 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 + 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 + 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 + 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 + 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 + 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 + 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 + 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 + 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 + 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 + 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 + 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 + 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 + 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 + 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 + 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 + 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 + 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 + 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 + 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 + 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 + 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 + 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 + 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 + 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 + 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 + 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 + 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 + 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 + 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 + 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 + 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 + 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 + 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 + 996 997 998 999 1000 +Date: 01 Jan 2000 12:00:00 -0000 +Message-ID: <XXX> +MIME-Version: 1.0 +Content-Type: text/plain + +This is a test that long headers are folded when messages are sent via SMTP +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Verify that sent messages are saved/searchable (via FCC)" +notmuch new > /dev/null +output=$(notmuch search 'subject:"testing message sent via SMTP"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)" + +test_begin_subtest "notmuch-fcc-dirs set to nil" +test_emacs "(let ((notmuch-fcc-dirs nil)) + (notmuch-mua-mail) + (test-output))" +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: +Subject: +--text follows this line-- +EOF +test_expect_equal_file EXPECTED OUTPUT + +# Make another FCC maildir specific for the next test +mkdir -p mail/sent-string/cur +mkdir -p mail/sent-string/new +mkdir -p mail/sent-string/tmp + +test_begin_subtest "notmuch-fcc-dirs set to a string" +test_emacs "(let ((notmuch-fcc-dirs \"sent-string\")) + (notmuch-mua-mail) + (test-output))" +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: +Subject: +Fcc: ${MAIL_DIR}/sent-string +--text follows this line-- +EOF +test_expect_equal_file EXPECTED OUTPUT + +# Make more FCC maildirs specific for the next test +mkdir -p mail/sent-list-match/cur +mkdir -p mail/sent-list-match/new +mkdir -p mail/sent-list-match/tmp +mkdir -p mail/failure/cur +mkdir -p mail/failure/new +mkdir -p mail/failure/tmp + +test_begin_subtest "notmuch-fcc-dirs set to a list (with match)" +test_emacs "(let ((notmuch-fcc-dirs + '((\"notmuchmail.org\" . \"sent-list-match\") + (\".*\" . \"failure\")))) + (notmuch-mua-mail) + (test-output))" +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: +Subject: +Fcc: ${MAIL_DIR}/sent-list-match +--text follows this line-- +EOF +test_expect_equal_file EXPECTED OUTPUT + +# Make another FCC maildir specific for the next test +mkdir -p mail/sent-list-catch-all/cur +mkdir -p mail/sent-list-catch-all/new +mkdir -p mail/sent-list-catch-all/tmp + +test_begin_subtest "notmuch-fcc-dirs set to a list (catch-all)" +test_emacs "(let ((notmuch-fcc-dirs + '((\"example.com\" . \"failure\") + (\".*\" . \"sent-list-catch-all\")))) + (notmuch-mua-mail) + (test-output))" +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: +Subject: +Fcc: ${MAIL_DIR}/sent-list-catch-all +--text follows this line-- +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "notmuch-fcc-dirs set to a list (no match)" +test_emacs "(let ((notmuch-fcc-dirs + '((\"example.com\" . \"failure\") + (\"nomatchhere.net\" . \"failure\")))) + (notmuch-mua-mail) + (test-output))" +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: +Subject: +--text follows this line-- +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Reply within emacs" +test_emacs '(let ((message-hidden-headers ''())) + (notmuch-search "subject:\"testing message sent via SMTP\"") + (notmuch-test-wait) + (notmuch-search-reply-to-thread) + (test-output))' +sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' OUTPUT +sed -i -e 's/^References: <.*>$/References: <XXX>/' OUTPUT +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: user@example.com +Subject: Re: Testing message sent via SMTP +In-Reply-To: <XXX> +Fcc: ${MAIL_DIR}/sent +References: <XXX> +--text follows this line-- +Notmuch Test Suite <test_suite@notmuchmail.org> writes: + +> This is a test that messages are sent via SMTP +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Reply within emacs to a message with TAB in subject" +test_emacs '(let ((message-hidden-headers ''())) + (notmuch-search "id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net") + (notmuch-test-wait) + (notmuch-search-show-thread) + (notmuch-test-wait) + (notmuch-show-reply-sender) + (test-output))' +sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' OUTPUT +sed -i -e 's/^References: <.*>$/References: <XXX>/' OUTPUT +sed -i -e '/^--text follows this line--$/q' OUTPUT +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Mikhail Gusarov <dottedmag@dottedmag.net> +Subject: Re: [notmuch] [PATCH 1/2] Close message file after parsing message headers +In-Reply-To: <XXX> +Fcc: ${MAIL_DIR}/sent +References: <XXX> +--text follows this line-- +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Reply from alternate address within emacs" +add_message '[from]="Sender <sender@example.com>"' \ + [to]=test_suite_other@notmuchmail.org + +test_emacs "(let ((message-hidden-headers '())) + (notmuch-search \"id:\\\"${gen_msg_id}\\\"\") + (notmuch-test-wait) + (notmuch-search-reply-to-thread) + (test-output))" +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite_other@notmuchmail.org> +To: Sender <sender@example.com> +Subject: Re: ${test_subtest_name} +In-Reply-To: <${gen_msg_id}> +Fcc: ${MAIL_DIR}/sent +References: <${gen_msg_id}> +--text follows this line-- +Sender <sender@example.com> writes: + +> This is just a test message (#${gen_msg_cnt}) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Reply from address in named group list within emacs" +add_message '[from]="Sender <sender@example.com>"' \ + '[to]=group:test_suite@notmuchmail.org,someone@example.com\;' \ + [cc]=test_suite_other@notmuchmail.org + +test_emacs "(let ((message-hidden-headers '())) + (notmuch-search \"id:\\\"${gen_msg_id}\\\"\") + (notmuch-test-wait) + (notmuch-search-reply-to-thread) + (test-output))" +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Sender <sender@example.com>, someone@example.com +Subject: Re: ${test_subtest_name} +In-Reply-To: <${gen_msg_id}> +Fcc: ${MAIL_DIR}/sent +References: <${gen_msg_id}> +--text follows this line-- +Sender <sender@example.com> writes: + +> This is just a test message (#${gen_msg_cnt}) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Reply within emacs to a multipart/mixed message" +test_emacs '(let ((message-hidden-headers ''())) + (notmuch-show "id:20091118002059.067214ed@hikari") + (notmuch-show-reply) + (test-output))' +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Adrian Perez de Castro <aperez@igalia.com>, notmuch@notmuchmail.org +Subject: Re: [notmuch] Introducing myself +In-Reply-To: <20091118002059.067214ed@hikari> +Fcc: ${MAIL_DIR}/sent +References: <20091118002059.067214ed@hikari> +--text follows this line-- +Adrian Perez de Castro <aperez@igalia.com> writes: + +> Hello to all, +> +> I have just heard about Not Much today in some random Linux-related news +> site (LWN?), my name is Adrian Perez and I work as systems administrator +> (although I can do some code as well :P). I have always thought that the +> ideas behind Sup were great, but after some time using it, I got tired of +> the oddities that it has. I also do not like doing things like having to +> install Ruby just for reading and sorting mails. Some time ago I thought +> about doing something like Not Much and in fact I played a bit with the +> Python+Xapian and the Python+Whoosh combinations, because I find relaxing +> to code things in Python when I am not working and also it is installed +> by default on most distribution. I got to have some mailboxes indexed and +> basic searching working a couple of months ago. Lately I have been very +> busy and had no time for coding, and them... boom! Not Much appears -- and +> it is almost exactly what I was trying to do, but faster. I have been +> playing a bit with Not Much today, and I think it has potential. +> +> Also, I would like to share one idea I had in mind, that you might find +> interesting: One thing I have found very annoying is having to re-tag my +> mail when the indexes get b0rked (it happened a couple of times to me while +> using Sup), so I was planning to mails as read/unread and adding the tags +> not just to the index, but to the mail text itself, e.g. by adding a +> "X-Tags" header field or by reusing the "Keywords" one. This way, the index +> could be totally recreated by re-reading the mail directories, and this +> would also allow to a tools like OfflineIMAP [1] to get the mails into a +> local maildir, tagging and indexing the mails with the e-mail reader and +> then syncing back the messages with the "X-Tags" header to the IMAP server. +> This would allow to use the mail reader from a different computer and still +> have everything tagged finely. +> +> Best regards, +> +> +> --- +> [1] http://software.complete.org/software/projects/show/offlineimap +> +> -- +> Adrian Perez de Castro <aperez@igalia.com> +> Igalia - Free Software Engineering +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Reply within emacs to a multipart/alternative message" +test_emacs '(let ((message-hidden-headers ''())) + (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") + (notmuch-show-reply) + (test-output))' +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Alex Botero-Lowry <alex.boterolowry@gmail.com>, notmuch@notmuchmail.org +Subject: Re: [notmuch] preliminary FreeBSD support +In-Reply-To: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com> +Fcc: ${MAIL_DIR}/sent +References: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com> +--text follows this line-- +Alex Botero-Lowry <alex.boterolowry@gmail.com> writes: + +> I saw the announcement this morning, and was very excited, as I had been +> hoping sup would be turned into a library, +> since I like the concept more than the UI (I'd rather an emacs interface). +> +> I did a preliminary compile which worked out fine, but +> sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns -1 on +> FreeBSD, so notmuch_config_open segfaulted. +> +> Attached is a patch that supplies a default buffer size of 64 in cases where +> -1 is returned. +> +> http://www.opengroup.org/austin/docs/austin_328.txt - seems to indicate this +> is acceptable behavior, +> and http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.htmlspecifically +> uses 64 as the +> buffer size. +> From e3bc4bbd7b9d0d086816ab5f8f2d6ffea1dd3ea4 Mon Sep 17 00:00:00 2001 +> From: Alexander Botero-Lowry <alex.boterolowry@gmail.com> +> Date: Tue, 17 Nov 2009 11:30:39 -0800 +> Subject: [PATCH] Deal with situation where sysconf(_SC_GETPW_R_SIZE_MAX) returns -1 +> +> --- +> notmuch-config.c | 2 ++ +> 1 files changed, 2 insertions(+), 0 deletions(-) +> +> diff --git a/notmuch-config.c b/notmuch-config.c +> index 248149c..e7220d8 100644 +> --- a/notmuch-config.c +> +++ b/notmuch-config.c +> @@ -77,6 +77,7 @@ static char * +> get_name_from_passwd_file (void *ctx) +> { +> long pw_buf_size = sysconf(_SC_GETPW_R_SIZE_MAX); +> + if (pw_buf_size == -1) pw_buf_size = 64; +> char *pw_buf = talloc_zero_size (ctx, pw_buf_size); +> struct passwd passwd, *ignored; +> char *name; +> @@ -101,6 +102,7 @@ static char * +> get_username_from_passwd_file (void *ctx) +> { +> long pw_buf_size = sysconf(_SC_GETPW_R_SIZE_MAX); +> + if (pw_buf_size == -1) pw_buf_size = 64; +> char *pw_buf = talloc_zero_size (ctx, pw_buf_size); +> struct passwd passwd, *ignored; +> char *name; +> -- +> 1.6.5.2 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Reply within emacs to an html-only message" +add_message '[content-type]="text/html"' \ + '[body]="Hi,<br />This is an <b>HTML</b> test message.<br /><br />OK?"' +test_emacs "(let ((message-hidden-headers '())) + (notmuch-show \"id:${gen_msg_id}\") + (notmuch-show-reply) + (test-output))" +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: +Subject: Re: Reply within emacs to an html-only message +In-Reply-To: <${gen_msg_id}> +Fcc: ${MAIL_DIR}/sent +References: <${gen_msg_id}> +--text follows this line-- +Notmuch Test Suite <test_suite@notmuchmail.org> writes: + +> Hi,This is an HTML test message.OK? +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Reply within emacs to message from self" +test_subtest_known_broken +add_message '[from]="test_suite@notmuchmail.org"' \ + '[to]="test_suite@notmuchmail.org"' +test_emacs "(let ((message-hidden-headers '())) + (notmuch-show \"id:${gen_msg_id}\") + (notmuch-show-reply) + (test-output))" +sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' OUTPUT +sed -i -e 's/^References: <.*>$/References: <XXX>/' OUTPUT +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: test_suite@notmuchmail.org +Subject: Re: Reply within emacs to message from self +In-Reply-To: <XXX> +Fcc: ${MAIL_DIR}/sent +References: <XXX> +--text follows this line-- +test_suite@notmuchmail.org writes: + +> This is just a test message (#7) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Quote MML tags in reply" +message_id='test-emacs-mml-quoting@message.id' +add_message [id]="$message_id" \ + "[subject]='$test_subtest_name'" \ + '[body]="<#part disposition=inline>"' +test_emacs "(let ((message-hidden-headers '())) + (notmuch-show \"id:$message_id\") + (notmuch-show-reply) + (test-output))" +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: +Subject: Re: Quote MML tags in reply +In-Reply-To: <test-emacs-mml-quoting@message.id> +Fcc: ${MAIL_DIR}/sent +References: <test-emacs-mml-quoting@message.id> +--text follows this line-- +Notmuch Test Suite <test_suite@notmuchmail.org> writes: + +> <#!part disposition=inline> +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Save attachment from within emacs using notmuch-show-save-attachments" +# save as archive to test that Emacs does not re-compress .gz +test_emacs '(let ((standard-input "\"attachment1.gz\"")) + (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") + (notmuch-show-save-attachments))' +test_expect_equal_file attachment1.gz "$EXPECTED/attachment" + +test_begin_subtest "Save attachment from within emacs using notmuch-show-save-part" +# save as archive to test that Emacs does not re-compress .gz +test_emacs '(let ((standard-input "\"attachment2.gz\"")) + (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") + (search-forward "0001-Deal-with") + (notmuch-show-save-part))' +test_expect_equal_file attachment2.gz "$EXPECTED/attachment" + +test_begin_subtest "Save 8bit attachment from within emacs using notmuch-show-save-attachments" + +add_message '[subject]="Attachment with 8bit chars"' \ + '[header]="MIME-Version: 1.0"' \ + '[content-type]="multipart/mixed; boundary=\"abcd\""' \ + '[body]="--abcd +Content-Type: text/plain + +Attachment follows: + +--abcd +Content-Type: application/octet-stream; name=\"sample\" +Content-Transfer-Encoding: 8bit +Content-Disposition: attachment; filename=\"sample\" + +“¡ Hey ! It compiles ¡ Ship it !†+ +--abcd-- +"' +test_emacs '(notmuch-show "id:'"${gen_msg_id}"'") + (delete-file "OUTPUT") + (let ((standard-input "\"OUTPUT\"")) + (notmuch-show-save-attachments))' + +test_expect_equal "$(cat OUTPUT)" '“¡ Hey ! It compiles ¡ Ship it !â€' + +test_begin_subtest "View raw message within emacs" +test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") + (notmuch-show-view-raw-message) + (test-output)' +test_expect_equal_file $EXPECTED/raw-message-cf0c4d-52ad0a OUTPUT + +test_begin_subtest "Hiding/showing signature in notmuch-show view" +maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu) +test_emacs "(notmuch-show \"$maildir_storage_thread\") + (search-forward \"Click/Enter to show.\") + (button-activate (button-at (point))) + (search-backward \"Click/Enter to hide.\") + (button-activate (button-at (point))) + (test-output)" +test_expect_equal_file $EXPECTED/notmuch-show-thread-maildir-storage OUTPUT + +test_begin_subtest "Detection and hiding of top-post quoting of message" +add_message '[subject]="The problem with top-posting"' \ + [id]=top-post-target \ + '[body]="A: Because it messes up the order in which people normally read text. +Q: Why is top-posting such a bad thing? +A: Top-posting. +Q: What is the most annoying thing in e-mail?"' +add_message '[from]="Top Poster <top@poster.com>"' \ + [in-reply-to]=top-post-target \ + [references]=top-post-target \ + '[subject]="Re: The problem with top-posting"' \ + '[body]="Thanks for the advice! I will be sure to put it to good use. + +-Top Poster + +----- Original Message ----- +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: Notmuch Test Suite <test_suite@notmuchmai.org> +Sent: Fri, 05 Jan 2001 15:43:57 +0000 +Subject: The problem with top-posting + +Q: Why is top-posting such a bad thing? +A: Top-posting. +Q: What is the most annoying thing in e-mail?"' +test_emacs "(notmuch-show \"top-posting\") + (test-visible-output \"OUTPUT.raw\")" +echo "Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox) +Subject: The problem with top-posting +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: GENERATED_DATE + +A: Because it messes up the order in which people normally read text. +Q: Why is top-posting such a bad thing? +A: Top-posting. +Q: What is the most annoying thing in e-mail? +Top Poster <top@poster.com> (2001-01-05) (inbox unread) +Subject: Re: The problem with top-posting +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: GENERATED_DATE + +Thanks for the advice! I will be sure to put it to good use. + +-Top Poster + +[ 9-line hidden original message. Click/Enter to show. ]" > EXPECTED +notmuch_date_sanitize < OUTPUT.raw > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Hiding message in notmuch-show view" +test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com") + (notmuch-show-toggle-message) + (test-visible-output)' +test_expect_equal_file $EXPECTED/notmuch-show-thread-with-hidden-messages OUTPUT + +test_begin_subtest "Hiding message with visible citation in notmuch-show view" +test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com") + (search-forward "Click/Enter to show.") + (button-activate (button-at (point))) + (notmuch-show-toggle-message) + (test-visible-output)' +test_expect_equal_file $EXPECTED/notmuch-show-thread-with-hidden-messages OUTPUT + +test_begin_subtest "notmuch-show: show message headers" +test_emacs \ + '(let ((notmuch-message-headers '\''("Subject" "To" "Cc" "Date")) + (notmuch-message-headers-visible t)) + (notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com") + (test-visible-output))' +test_expect_equal_file $EXPECTED/notmuch-show-message-with-headers-visible OUTPUT + +test_begin_subtest "notmuch-show: hide message headers" +test_emacs \ + '(let ((notmuch-message-headers '\''("Subject" "To" "Cc" "Date")) + (notmuch-message-headers-visible nil)) + (notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com") + (test-visible-output))' +test_expect_equal_file $EXPECTED/notmuch-show-message-with-headers-hidden OUTPUT + +test_begin_subtest "notmuch-show: hide message headers (w/ notmuch-show-toggle-visibility-headers)" +test_emacs \ + '(let ((notmuch-message-headers '\''("Subject" "To" "Cc" "Date")) + (notmuch-message-headers-visible t)) + (notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com") + (notmuch-show-toggle-visibility-headers) + (test-visible-output))' +test_expect_equal_file $EXPECTED/notmuch-show-message-with-headers-hidden OUTPUT + +test_begin_subtest "notmuch-show: collapse all messages in thread" +test_emacs '(notmuch-show "id:f35dbb950911171435ieecd458o853c873e35f4be95@mail.gmail.com") + (let ((current-prefix-arg t)) + (notmuch-show-open-or-close-all) + (test-visible-output))' +test_expect_equal_file $EXPECTED/notmuch-show-thread-with-all-messages-collapsed OUTPUT + +test_begin_subtest "notmuch-show: uncollapse all messages in thread" +test_emacs '(notmuch-show "id:f35dbb950911171435ieecd458o853c873e35f4be95@mail.gmail.com") + (notmuch-show-open-or-close-all) + (test-visible-output)' +test_expect_equal_file $EXPECTED/notmuch-show-thread-with-all-messages-uncollapsed OUTPUT + +test_begin_subtest "Stashing in notmuch-show" +add_message '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \ + '[from]="Some One <someone@somewhere.org>"' \ + '[to]="Some One Else <notsomeone@somewhere.org>"' \ + '[cc]="Notmuch <notmuch@notmuchmail.org>"' \ + '[subject]="Stash my stashables"' \ + '[id]="bought"' \ + '[body]="Unable to stash body. Where did you get it in the first place?!?"' +notmuch tag +stashtest id:${gen_msg_id} +test_emacs '(notmuch-show "id:\"bought\"") + (notmuch-show-stash-date) + (notmuch-show-stash-from) + (notmuch-show-stash-to) + (notmuch-show-stash-cc) + (notmuch-show-stash-subject) + (notmuch-show-stash-message-id) + (notmuch-show-stash-message-id-stripped) + (notmuch-show-stash-tags) + (notmuch-show-stash-filename) + (notmuch-show-stash-mlarchive-link "Gmane") + (notmuch-show-stash-mlarchive-link "MARC") + (notmuch-show-stash-mlarchive-link "Mail Archive, The") + (switch-to-buffer + (generate-new-buffer "*test-stashing*")) + (dotimes (i 12) + (yank) + (insert "\n") + (rotate-yank-pointer 1)) + (reverse-region (point-min) (point-max)) + (test-output)' +cat <<EOF >EXPECTED +Sat, 01 Jan 2000 12:00:00 +0000 +Some One <someone@somewhere.org> +Some One Else <notsomeone@somewhere.org> +Notmuch <notmuch@notmuchmail.org> +Stash my stashables +id:bought +bought +inbox,stashtest +${gen_msg_filename} +https://mid.gmane.org/bought +https://marc.info/?i=bought +https://mid.mail-archive.com/bought +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Stashing in notmuch-search" +test_emacs '(notmuch-search "id:\"bought\"") + (notmuch-test-wait) + (notmuch-search-stash-thread-id) + (switch-to-buffer + (generate-new-buffer "*test-stashing*")) + (yank) + (test-output)' +sed -i -e 's/^thread:.*$/thread:XXX/' OUTPUT +test_expect_equal "$(cat OUTPUT)" "thread:XXX" + +test_begin_subtest 'notmuch-show-advance-and-archive with invisible signature' +message1='id:20091118010116.GC25380@dottiness.seas.harvard.edu' +message2='id:1258491078-29658-1-git-send-email-dottedmag@dottedmag.net' +test_emacs "(notmuch-show \"$message2\") + (test-output \"EXPECTED\")" +test_emacs "(notmuch-search \"$message1 or $message2\") + (notmuch-test-wait) + (notmuch-search-show-thread) + (goto-char (point-max)) + (redisplay) + (notmuch-show-advance-and-archive) + (test-output)" +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Refresh show buffer" +test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com") + (test-visible-output "EXPECTED") + (notmuch-show-refresh-view) + (test-visible-output)' +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Refresh modified show buffer" +test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com") + (notmuch-show-toggle-message) + (notmuch-show-next-message) + (notmuch-show-toggle-message) + (test-visible-output "EXPECTED") + (notmuch-show-refresh-view) + (test-visible-output)' +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Do not call notmuch for non-inlinable application/mpeg parts" +id='message-with-application/mpeg-attachment@notmuchmail.org' +emacs_fcc_message \ + 'Message with application/mpeg attachment' \ + '' \ + "(message-goto-eoh) + (insert \"Message-ID: <$id>\n\") + (message-goto-body) + (mml-insert-part \"application/mpeg\") + (insert \"a fake mp3 file\")" +notmuch_counter_reset +test_emacs "(let ((notmuch-command \"$notmuch_counter_command\")) + (notmuch-show \"id:$id\"))" +test_expect_equal $(notmuch_counter_value) 1 + +test_begin_subtest "Do not call notmuch for non-inlinable audio/mpeg parts" +id='message-with-audio/mpeg-attachment@notmuchmail.org' +emacs_fcc_message \ + 'Message with audio/mpeg attachment' \ + '' \ + "(message-goto-eoh) + (insert \"Message-ID: <$id>\n\") + (message-goto-body) + (mml-insert-part \"audio/mpeg\") + (insert \"a fake mp3 file\")" +notmuch_counter_reset +test_emacs "(let ((notmuch-command \"$notmuch_counter_command\")) + (notmuch-show \"id:$id\"))" +test_expect_equal $(notmuch_counter_value) 1 + +test_begin_subtest "notmuch-hello-mode hook is called" +counter=$(test_emacs \ + '(let ((notmuch-hello-mode-hook-counter 0)) + (kill-buffer "*notmuch-hello*") + (notmuch-hello) + notmuch-hello-mode-hook-counter)' +) +test_expect_equal "$counter" 1 + +test_begin_subtest "notmuch-hello-mode hook is not called on updates" +counter=$(test_emacs \ + '(let ((notmuch-hello-mode-hook-counter 0)) + (kill-buffer "*notmuch-hello*") + (notmuch-hello) + (notmuch-hello-update) + notmuch-hello-mode-hook-counter)' +) +test_expect_equal "$counter" 1 + +test_begin_subtest "notmuch-hello-refresh hook is called" +counter=$(test_emacs \ + '(let ((notmuch-hello-refresh-hook-counter 0)) + (kill-buffer "*notmuch-hello*") + (notmuch-hello) + notmuch-hello-refresh-hook-counter)' +) +test_expect_equal "$counter" 1 + +test_begin_subtest "notmuch-hello-refresh hook is called on updates" +counter=$(test_emacs \ + '(let ((notmuch-hello-refresh-hook-counter 0)) + (kill-buffer "*notmuch-hello*") + (notmuch-hello) + (notmuch-hello-update) + notmuch-hello-refresh-hook-counter)' +) +test_expect_equal "$counter" 2 + + +add_message '[subject]="HTML mail with images"' \ + '[content-type]="multipart/related; boundary=abcd"' \ + '[body]="--abcd +Content-Type: text/html + +<img src="cid:330@goomoji.gmail"> smiley + +--abcd +Content-Type: image/gif +Content-Transfer-Encoding: base64 +Content-ID: <330@goomoji.gmail> + +R0lGODlhDAAMAKIFAF5LAP/zxAAAANyuAP/gaP///wAAAAAAACH5BAEAAAUALAAAAAAMAAwAAAMl +WLPcGjDKFYi9lxKBOaGcF35DhWHamZUW0K4mAbiwWtuf0uxFAgA7 +--abcd--"' +test_emacs "(let ((mm-text-html-renderer + (if (assq 'shr mm-text-html-renderer-alist) + 'shr 'html2text))) + (notmuch-show \"id:${gen_msg_id}\")) + (test-output)" > /dev/null +# Different Emacs versions and renderers give very different results, +# so just check that something reasonable showed up. We first cat the +# output so the test framework will print it if the test fails. +test_begin_subtest "Rendering HTML mail with images" +test_expect_success 'cat OUTPUT && grep -q smiley OUTPUT' + +test_begin_subtest "Search handles subprocess error exit codes" +cat > notmuch_fail <<EOF +#!/bin/sh +echo '()' +exit 1 +EOF +chmod a+x notmuch_fail +test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\")) + (with-current-buffer \"*Messages*\" + (let ((inhibit-read-only t)) (erase-buffer))) + (with-current-buffer (get-buffer-create \"*Notmuch errors*\") + (erase-buffer)) + (notmuch-search \"tag:inbox\") + (notmuch-test-wait) + (with-current-buffer \"*Messages*\" + (test-output \"MESSAGES\")) + (with-current-buffer \"*Notmuch errors*\" + (test-output \"ERROR\")) + (test-output))" + +test_expect_equal "$(notmuch_emacs_error_sanitize notmuch_fail OUTPUT MESSAGES ERROR)" "\ +=== OUTPUT === +End of search results. +=== MESSAGES === +YYY/notmuch_fail exited with status 1 (see *Notmuch errors* for more details) +=== ERROR === +[XXX] +YYY/notmuch_fail exited with status 1 +command: YYY/notmuch_fail search --format\=sexp --format-version\=4 --sort\=newest-first tag\:inbox +exit status: 1" + +test_begin_subtest "Search handles subprocess warnings" +cat > notmuch_fail <<EOF +#!/bin/sh +echo '()' +echo This is a warning >&2 +echo This is another warning >&2 +exit 0 +EOF +chmod a+x notmuch_fail +test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\")) + (with-current-buffer \"*Messages*\" + (let ((inhibit-read-only t)) (erase-buffer))) + (with-current-buffer (get-buffer-create \"*Notmuch errors*\") + (erase-buffer)) + (notmuch-search \"tag:inbox\") + (notmuch-test-wait) + (with-current-buffer \"*Messages*\" + (test-output \"MESSAGES\")) + (with-current-buffer \"*Notmuch errors*\" + (test-output \"ERROR\")) + (test-output))" +sed -i -e 's/^\[.*\]$/[XXX]/' ERROR +test_expect_equal "$(cat OUTPUT; echo ---; cat MESSAGES; echo ---; cat ERROR)" "\ +End of search results. +--- +This is a warning (see *Notmuch errors* for more details) +--- +[XXX] +This is a warning +This is another warning" + +test_begin_subtest "Search thread tag operations are race-free" +add_message '[subject]="Search race test"' +gen_msg_id_1=$gen_msg_id +generate_message '[in-reply-to]="<'$gen_msg_id_1'>"' \ + '[references]="<'$gen_msg_id_1'>"' \ + '[subject]="Search race test two"' +test_emacs '(notmuch-search "subject:\"search race test\"") + (notmuch-test-wait) + (notmuch-poll) + (execute-kbd-macro "+search-thread-race-tag")' +output=$(notmuch search --output=messages 'tag:search-thread-race-tag') +test_expect_equal "$output" "id:$gen_msg_id_1" + +test_begin_subtest "Search global tag operations are race-free" +generate_message '[in-reply-to]="<'$gen_msg_id_1'>"' \ + '[references]="<'$gen_msg_id_1'>"' \ + '[subject]="Re: Search race test"' +test_emacs '(notmuch-search "subject:\"search race test\" -subject:two") + (notmuch-test-wait) + (notmuch-poll) + (execute-kbd-macro "*+search-global-race-tag")' +output=$(notmuch search --output=messages 'tag:search-global-race-tag') +test_expect_equal "$output" "id:$gen_msg_id_1" + +test_begin_subtest "Term escaping" +output=$(test_emacs "(mapcar 'notmuch-escape-boolean-term (list + \"\" + \"abc\`~\!@#\$%^&*-=_+123\" + \"(abc\" + \")abc\" + \"\\\"abc\" + \"\x01xyz\" + \"\\x201cxyz\\x201d\"))") +test_expect_equal "$output" '("\"\"" "abc`~!@#$%^&*-=_+123" "\"(abc\"" "\")abc\"" "\"\"\"abc\"" "\"'$'\x01''xyz\"" "\"“xyzâ€\"")' + +test_begin_subtest "Sending a message calls the send message hooks" +emacs_deliver_message \ + 'Testing message sending hooks' \ + 'This is a test of the message sending hooks.' \ + "(message-goto-to) + (kill-whole-line) + (insert \"To: user@example.com\n\") + (add-hook 'notmuch-mua-send-hook (lambda () (goto-char (point-max)) (insert \"\nThis text added by the hook.\")))" +sed \ + -e s',^Message-ID: <.*>$,Message-ID: <XXX>,' \ + -e s',^\(Content-Type: text/plain\); charset=us-ascii$,\1,' < sent_message >OUTPUT +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: user@example.com +Subject: Testing message sending hooks +Date: 01 Jan 2000 12:00:00 -0000 +Message-ID: <XXX> +MIME-Version: 1.0 +Content-Type: text/plain + +This is a test of the message sending hooks. +This text added by the hook. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T320-emacs-large-search-buffer.sh b/test/T320-emacs-large-search-buffer.sh new file mode 100755 index 00000000..f61e8a97 --- /dev/null +++ b/test/T320-emacs-large-search-buffer.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +test_description="Emacs with large search results buffer" +. $(dirname "$0")/test-lib.sh || exit 1 + +x=xxxxxxxxxx # 10 +x=$x$x$x$x$x$x$x$x$x$x # 100 +x=$x$x$x$x$x$x$x$x$x # 900 + +# We generate a long subject here (over 900 bytes) so that the emacs +# search results get large quickly. With 30 such messages we should +# cross several 4kB page boundaries and see the bug. +n=30 +for i in $(seq 1 $n); do + # Roughly 100B2 KiB per message. That is, we need two messages in order to + # exceed the typical size of the pipe buffer (4 KiB on commodity systems). + generate_message '[subject]="$x $i of $n"' +done + +notmuch new > /dev/null + +test_begin_subtest "Ensure that emacs doesn't drop results" +notmuch search '*' > EXPECTED +sed -i -e 's/^thread:[0-9a-f]* //' -e 's/;//' -e 's/xx*/[BLOB]/' EXPECTED +echo 'End of search results.' >> EXPECTED + +test_emacs '(notmuch-search "*") + (notmuch-test-wait) + (test-output)' +sed -i -e s', *, ,g' -e 's/xxx*/[BLOB]/g' OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T330-emacs-subject-to-filename.sh b/test/T330-emacs-subject-to-filename.sh new file mode 100755 index 00000000..eaf7c980 --- /dev/null +++ b/test/T330-emacs-subject-to-filename.sh @@ -0,0 +1,138 @@ +#!/usr/bin/env bash + +test_description="emacs: mail subject to filename" +. $(dirname "$0")/test-lib.sh || exit 1 + +# emacs server can't be started in a child process with $(test_emacs ...) +test_emacs '(ignore)' > /dev/null + +# test notmuch-wash-subject-to-patch-sequence-number (subject) +test_begin_subtest "no patch sequence number" +output=$(test_emacs '(format "%S" (notmuch-wash-subject-to-patch-sequence-number + "[PATCH] A normal patch subject without numbers"))' +) +test_expect_equal "$output" '"nil"' + +test_begin_subtest "patch sequence number #1" +output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number + "[PATCH 2/3] A most regular patch subject")' +) +test_expect_equal "$output" 2 + +test_begin_subtest "patch sequence number #2" +output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number + " [dummy list prefix] [RFC PATCH v2 13/42] Special prefixes")' +) +test_expect_equal "$output" 13 + +test_begin_subtest "patch sequence number #3" +output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number + "[PATCH 2/3] [PATCH 032/037] use the last prefix")' +) +test_expect_equal "$output" 32 + +test_begin_subtest "patch sequence number #4" +output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number + "[dummy list prefix] [PATCH 2/3] PATCH 3/3] do not use a broken prefix")' +) +test_expect_equal "$output" 2 + +test_begin_subtest "patch sequence number #5" +output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number + "[RFC][PATCH 3/5][PATCH 4/5][PATCH 5/5] A made up test")' +) +test_expect_equal "$output" 5 + +test_begin_subtest "patch sequence number #6" +output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number + "[PATCH 2/3] this -> [PATCH 3/3] is not a prefix anymore [nor this 4/4]")' +) +test_expect_equal "$output" 2 + +test_begin_subtest "patch sequence number #7" +output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number + "[liberally accept crapola right before123/456and after] the numbers")' +) +test_expect_equal "$output" 123 + +# test notmuch-wash-subject-to-filename (subject &optional maxlen) +test_begin_subtest "filename #1" +output=$(test_emacs '(notmuch-wash-subject-to-filename + "just a subject line")' +) +test_expect_equal "$output" '"just-a-subject-line"' + +test_begin_subtest "filename #2" +output=$(test_emacs '(notmuch-wash-subject-to-filename + " [any] [prefixes are ] [removed!] from the subject")' +) +test_expect_equal "$output" '"from-the-subject"' + +test_begin_subtest "filename #3" +output=$(test_emacs '(notmuch-wash-subject-to-filename + " leading and trailing space ")' +) +test_expect_equal "$output" '"leading-and-trailing-space"' + +test_begin_subtest "filename #4" +output=$(test_emacs '(notmuch-wash-subject-to-filename + "!# leading ()// &%, and in between_and_trailing garbage ()(&%%")' +) +test_expect_equal "$output" '"-leading-and-in-between_and_trailing-garbage"' + +test_begin_subtest "filename #5" +output=$(test_emacs '(notmuch-wash-subject-to-filename + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_01234567890")' +) +test_expect_equal "$output" '"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_01234567890"' + +test_begin_subtest "filename #6" +output=$(test_emacs '(notmuch-wash-subject-to-filename + "sequences of ... are squashed and trailing are removed ...")' +) +test_expect_equal "$output" '"sequences-of-.-are-squashed-and-trailing-are-removed"' + +test_begin_subtest "filename #7" +output=$(test_emacs '(notmuch-wash-subject-to-filename + "max length test" 1)' +) +test_expect_equal "$output" '"m"' + +test_begin_subtest "filename #8" +output=$(test_emacs '(notmuch-wash-subject-to-filename + "max length test /&(/%&/%%&¤%¤" 20)' +) +test_expect_equal "$output" '"max-length-test"' + +test_begin_subtest "filename #9" +output=$(test_emacs '(notmuch-wash-subject-to-filename + "[a prefix] [is only separated] by [spaces], so \"by\" is not okay!")' +) +test_expect_equal "$output" '"by-spaces-so-by-is-not-okay"' + +# test notmuch-wash-subject-to-patch-filename (subject) +test_begin_subtest "patch filename #1" +output=$(test_emacs '(notmuch-wash-subject-to-patch-filename + "[RFC][PATCH 099/100] rewrite notmuch")' +) +test_expect_equal "$output" '"0099-rewrite-notmuch.patch"' + +test_begin_subtest "patch filename #2" +output=$(test_emacs '(notmuch-wash-subject-to-patch-filename + "[RFC PATCH v1] has no patch number, default to 1")' +) +test_expect_equal "$output" '"0001-has-no-patch-number-default-to-1.patch"' + +test_begin_subtest "patch filename #3" +output=$(test_emacs '(notmuch-wash-subject-to-patch-filename + "[PATCH 4/5] the maximum length of a patch filename is 52 + patch sequence number + .patch extension")' +) +test_expect_equal "$output" '"0004-the-maximum-length-of-a-patch-filename-is-52-patch-s.patch"' + +test_begin_subtest "patch filename #4" +output=$(test_emacs '(notmuch-wash-subject-to-patch-filename + "[PATCH 4/5] the maximum length of a patch filename is 52 + patchh ! sequence number + .patch extension, *before* trimming trailing - and .")' +) +test_expect_equal "$output" '"0004-the-maximum-length-of-a-patch-filename-is-52-patchh.patch"' + +test_done diff --git a/test/T340-maildir-sync.sh b/test/T340-maildir-sync.sh new file mode 100755 index 00000000..7fece5f2 --- /dev/null +++ b/test/T340-maildir-sync.sh @@ -0,0 +1,209 @@ +#!/usr/bin/env bash + +test_description="maildir synchronization" + +. $(dirname "$0")/test-lib.sh || exit 1 + +# Create the expected maildir structure +mkdir $MAIL_DIR/cur +mkdir $MAIL_DIR/new +mkdir $MAIL_DIR/tmp + +test_begin_subtest "Adding 'S' flag to existing filename removes 'unread' tag" +add_message [subject]='"Adding S flag"' [filename]='adding-s-flag:2,' [dir]=cur +output=$(notmuch search subject:"Adding S flag" | notmuch_search_sanitize) +output+=" +" +mv "${gen_msg_filename}" "${gen_msg_filename}S" +output+=$(NOTMUCH_NEW) +output+=" +" +output+=$(notmuch search subject:"Adding S flag" | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Adding S flag (inbox unread) +No new mail. Detected 1 file rename. +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Adding S flag (inbox)" + +test_begin_subtest "Adding message with 'S' flag prevents 'unread' tag" +add_message [subject]='"Adding message with S"' [filename]='adding-with-s-flag:2,S' [dir]=cur +output=$(notmuch search subject:"Adding message with S" | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Adding message with S (inbox)" + +test_begin_subtest "Adding message with 'S' w/o 'unread' in new.tags prevents 'unread' tag" +OLDCONFIG=$(notmuch config get new.tags) +notmuch config set new.tags "inbox" +add_message [subject]='"Adding message with S 2"' [filename]='adding-with-s-flag2:2,S' [dir]=cur +notmuch config set new.tags $OLDCONFIG +output=$(notmuch search subject:Adding-message-with-S-2 | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Adding message with S 2 (inbox)" + +test_begin_subtest "Adding 'replied' tag adds 'R' flag to filename" +add_message [subject]='"Adding replied tag"' [filename]='adding-replied-tag:2,S' [dir]=cur +notmuch tag +replied subject:"Adding replied tag" +output=$(cd ${MAIL_DIR}/cur; ls -1 adding-replied*) +test_expect_equal "$output" "adding-replied-tag:2,RS" + +test_begin_subtest "notmuch show works with renamed file (without notmuch new)" +output=$(notmuch show --format=json id:${gen_msg_id} | notmuch_json_show_sanitize) +test_expect_equal_json "$output" '[[[{"id": "XXXXX", +"match": true, +"excluded": false, +"filename": ["YYYYY"], +"timestamp": 42, +"date_relative": "2001-01-05", +"tags": ["inbox","replied"], +"headers": {"Subject": "Adding replied tag", +"From": "Notmuch Test Suite <test_suite@notmuchmail.org>", +"To": "Notmuch Test Suite <test_suite@notmuchmail.org>", +"Date": "GENERATED_DATE"}, +"body": [{"id": 1, +"content-type": "text/plain", +"content": "This is just a test message (#4)\n"}]}, +[]]]]' + +test_begin_subtest "notmuch reply works with renamed file (without notmuch new)" +test_expect_success 'notmuch reply id:${gen_msg_id}' + +test_begin_subtest "notmuch new detects no file rename after tag->flag synchronization" +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "No new mail." + +test_begin_subtest "When read, message moved from new to cur" +add_message [subject]='"Message to move to cur"' [date]='"Sat, 01 Jan 2000 12:00:00 -0000"' [filename]='message-to-move-to-cur' [dir]=new +notmuch tag -unread subject:"Message to move to cur" +output=$(cd "$MAIL_DIR/cur"; ls message-to-move*) +test_expect_equal "$output" "message-to-move-to-cur:2,S" + +test_begin_subtest "No rename should be detected by notmuch new" +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "No new mail." +# (*) If notmuch new was not run we've got "Processed 1 file in almost +# no time" here. The reason is that removing unread tag in a previous +# test created directory document in the database but this document +# was not linked as subdirectory of $MAIL_DIR. Therefore notmuch new +# could not reach the cur/ directory and its files in it during +# recursive traversal. +# +# XXX: The above sounds like a bug that should be fixed. If notmuch is +# creating new directories in the mail store, then it should be +# creating all necessary database state for those directories. + +test_begin_subtest "Adding non-maildir tags does not move message from new to cur" +add_message [subject]='"Message to stay in new"' \ + [date]='"Sat, 01 Jan 2000 12:00:00 -0000"' \ + [filename]='message-to-stay-in-new' [dir]=new +notmuch tag +donotmove subject:"Message to stay in new" +output=$(cd "$MAIL_DIR"; ls */message-to-stay-in-new*) +test_expect_equal "$output" "new/message-to-stay-in-new" + +test_begin_subtest "Message in cur lacking maildir info gets one on any tag change" +add_message [filename]='message-to-get-maildir-info' [dir]=cur +notmuch tag +anytag id:$gen_msg_id +output=$(cd "$MAIL_DIR"; ls */message-to-get-maildir-info*) +test_expect_equal "$output" "cur/message-to-get-maildir-info:2," + +test_begin_subtest "Message in new with maildir info is moved to cur on any tag change" +add_message [filename]='message-with-info-to-be-moved-to-cur:2,' [dir]=new +notmuch tag +anytag id:$gen_msg_id +output=$(cd "$MAIL_DIR"; ls */message-with-info-to-be-moved-to-cur*) +test_expect_equal "$output" "cur/message-with-info-to-be-moved-to-cur:2," + +test_begin_subtest "Removing 'S' flag from existing filename adds 'unread' tag" +add_message [subject]='"Removing S flag"' [filename]='removing-s-flag:2,S' [dir]=cur +output=$(notmuch search subject:"Removing S flag" | notmuch_search_sanitize) +output+=" +" +mv "${gen_msg_filename}" "${gen_msg_filename%S}" +output+=$(NOTMUCH_NEW) +output+=" +" +output+=$(notmuch search subject:"Removing S flag" | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Removing S flag (inbox) +No new mail. Detected 1 file rename. +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Removing S flag (inbox unread)" + +test_begin_subtest "Removing info from filename leaves tags unchanged" +add_message [subject]='"Message to lose maildir info"' [filename]='message-to-lose-maildir-info' [dir]=cur +notmuch tag -unread subject:"Message to lose maildir info" +mv "$MAIL_DIR/cur/message-to-lose-maildir-info:2,S" "$MAIL_DIR/cur/message-without-maildir-info" +output=$(NOTMUCH_NEW) +output+=" +" +output+=$(notmuch search subject:"Message to lose maildir info" | notmuch_search_sanitize) +test_expect_equal "$output" "No new mail. Detected 1 file rename. +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Message to lose maildir info (inbox)" + +test_begin_subtest "Can remove unread tag from message in non-maildir directory" +add_message [subject]='"Non-maildir message"' [dir]=notmaildir [filename]='non-maildir-message' +expected=$(notmuch search --output=files subject:"Non-maildir message") +test_expect_success 'notmuch tag -unread subject:"Non-maildir message"' + +test_begin_subtest "Message in non-maildir directory does not get renamed" +output=$(notmuch search --output=files subject:"Non-maildir message") +test_expect_equal "$output" "$expected" + +test_begin_subtest "notmuch dump/restore re-synchronizes maildir tags with flags" +# Capture current filename state +expected=$(ls $MAIL_DIR/cur) +# Add/remove some flags from filenames +mv $MAIL_DIR/cur/adding-replied-tag:2,RS $MAIL_DIR/cur/adding-replied-tag:2,S +mv $MAIL_DIR/cur/adding-s-flag:2,S $MAIL_DIR/cur/adding-s-flag:2, +mv $MAIL_DIR/cur/adding-with-s-flag:2,S $MAIL_DIR/cur/adding-with-s-flag:2,RS +mv $MAIL_DIR/cur/message-to-move-to-cur:2,S $MAIL_DIR/cur/message-to-move-to-cur:2,DS +notmuch dump --output=dump.txt +NOTMUCH_NEW >/dev/null +notmuch restore --input=dump.txt +output=$(ls $MAIL_DIR/cur) +test_expect_equal "$output" "$expected" + +test_begin_subtest 'Adding flags to duplicate message tags the mail' +add_message [subject]='"Duplicated message"' [dir]=cur [filename]='duplicated-message:2,' +cp "$MAIL_DIR/cur/duplicated-message:2," "$MAIL_DIR/cur/duplicated-message-copy:2,RS" +NOTMUCH_NEW > output +notmuch search subject:"Duplicated message" | notmuch_search_sanitize >> output +test_expect_equal "$(< output)" "No new mail. +thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Duplicated message (inbox replied)" + +test_begin_subtest "Adding duplicate message without flags does not remove tags" +cp "$MAIL_DIR/cur/duplicated-message-copy:2,RS" "$MAIL_DIR/cur/duplicated-message-another-copy:2," +NOTMUCH_NEW > output +notmuch search subject:"Duplicated message" | notmuch_search_sanitize >> output +test_expect_equal "$(< output)" "No new mail. +thread:XXX 2001-01-05 [1/1(3)] Notmuch Test Suite; Duplicated message (inbox replied)" + +test_begin_subtest "Tag changes modify flags of multiple files" +notmuch tag -replied subject:"Duplicated message" +(cd $MAIL_DIR/cur/; ls duplicated*) > actual +test_expect_equal "$(< actual)" "duplicated-message-another-copy:2,S +duplicated-message-copy:2,S +duplicated-message:2,S" + +test_begin_subtest "Synchronizing tag changes preserves unsupported maildir flags" +add_message [subject]='"Unsupported maildir flags"' [dir]=cur [filename]='unsupported-maildir-flags:2,FSZxyz' +notmuch tag +unread +draft -flagged subject:"Unsupported maildir flags" +test_expect_equal "$(cd $MAIL_DIR/cur/; ls unsupported*)" "unsupported-maildir-flags:2,DZxyz" + +test_begin_subtest "A file with non-compliant maildir info will not be renamed" +add_message [subject]='"Non-compliant maildir info"' [dir]=cur [filename]='non-compliant-maildir-info:2,These-are-not-flags-in-ASCII-order-donottouch' +notmuch tag +unread +draft -flagged subject:"Non-compliant maildir info" +test_expect_equal "$(cd $MAIL_DIR/cur/; ls non-compliant*)" "non-compliant-maildir-info:2,These-are-not-flags-in-ASCII-order-donottouch" + +test_begin_subtest "Files in new/ get default synchronized tags" +OLDCONFIG=$(notmuch config get new.tags) +notmuch config set new.tags "test;unread" +add_message [subject]='"File in new/"' [dir]=new [filename]='file-in-new' +notmuch config set new.tags $OLDCONFIG +notmuch search 'subject:"File in new"' | notmuch_search_sanitize > output +test_expect_equal "$(< output)" \ +"thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; File in new/ (test unread)" + +for tag in draft flagged passed replied; do + test_begin_subtest "$tag is valid in new.tags" + OLDCONFIG=$(notmuch config get new.tags) + notmuch config set new.tags "$tag;unread" + add_message [subject]="\"$tag sync in new\"" [dir]=new + notmuch config set new.tags $OLDCONFIG + notmuch search "subject:\"$tag sync in new\"" | notmuch_search_sanitize > output + test_expect_equal "$(< output)" \ + "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; $tag sync in new ($tag unread)" +done +test_done diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh new file mode 100755 index 00000000..a776ec35 --- /dev/null +++ b/test/T350-crypto.sh @@ -0,0 +1,458 @@ +#!/usr/bin/env bash + +# TODO: +# - decryption/verification with signer key not available +# - verification of signatures from expired/revoked keys + +test_description='PGP/MIME signature verification and decryption' +. $(dirname "$0")/test-lib.sh || exit 1 + +################################################## + +add_gnupg_home +# Change this if we ship a new test key +FINGERPRINT="5AEAB11F5E33DCE875DDB75B6D92612D94E46381" + +test_begin_subtest "emacs delivery of signed message" +test_expect_success \ +'emacs_fcc_message \ + "test signed message 001" \ + "This is a test signed message." \ + "(mml-secure-message-sign)"' + +test_begin_subtest "signed part content-type indexing" +output=$(notmuch search mimetype:multipart/signed and mimetype:application/pgp-signature | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test signed message 001 (inbox signed)" + +test_begin_subtest "signature verification" +output=$(notmuch show --format=json --verify subject:"test signed message 001" \ + | notmuch_json_show_sanitize \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') +expected='[[[{"id": "XXXXX", + "match": true, + "excluded": false, + "filename": ["YYYYY"], + "timestamp": 946728000, + "date_relative": "2000-01-01", + "tags": ["inbox","signed"], + "headers": {"Subject": "test signed message 001", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "test_suite@notmuchmail.org", + "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, + "body": [{"id": 1, + "sigstatus": [{"status": "good", + "fingerprint": "'$FINGERPRINT'", + "created": 946728000}], + "content-type": "multipart/signed", + "content": [{"id": 2, + "content-type": "text/plain", + "content": "This is a test signed message.\n"}, + {"id": 3, + "content-type": "application/pgp-signature", + "content-length": "NONZERO"}]}]}, + []]]]' +test_expect_equal_json \ + "$output" \ + "$expected" + +test_begin_subtest "detection of modified signed contents" +emacs_fcc_message \ + "bad signed message 001" \ + "Incriminating stuff. This is a test signed message." \ + "(mml-secure-message-sign)" + +file=$(notmuch search --output=files subject:"bad signed message 001") + +sed -i 's/Incriminating stuff. //' ${file} + +output=$(notmuch show --format=json --verify subject:"bad signed message 001" \ + | notmuch_json_show_sanitize \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') +expected='[[[{"id": "XXXXX", + "match": true, + "excluded": false, + "filename": ["YYYYY"], + "timestamp": 946728000, + "date_relative": "2000-01-01", + "tags": ["inbox","signed"], + "headers": {"Subject": "bad signed message 001", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "test_suite@notmuchmail.org", + "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, + "body": [{"id": 1, + "sigstatus": [{"status": "bad", + "keyid": "'$(echo $FINGERPRINT | cut -c 25-)'"}], + "content-type": "multipart/signed", + "content": [{"id": 2, + "content-type": "text/plain", + "content": "This is a test signed message.\n"}, + {"id": 3, + "content-type": "application/pgp-signature", + "content-length": "NONZERO"}]}]}, + []]]]' +test_expect_equal_json \ + "$output" \ + "$expected" + +test_begin_subtest "corrupted pgp/mime signature" +emacs_fcc_message \ + "bad signed message 002" \ + "Incriminating stuff. This is a test signed message." \ + "(mml-secure-message-sign)" + +file=$(notmuch search --output=files subject:"bad signed message 002") + +awk '/-----BEGIN PGP SIGNATURE-----/{flag=1;print;next} \ + /-----END PGP SIGNATURE-----/{flag=0;print;next} \ + flag{gsub(/[A-Za-z]/,"0");print}!flag{print}' $file > $file.new + +rm $file +mv $file.new $file + +output=$(notmuch show --format=json --verify subject:"bad signed message 002" \ + | notmuch_json_show_sanitize \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') +expected='[[[{"id": "XXXXX", + "match": true, + "excluded": false, + "filename": ["YYYYY"], + "timestamp": 946728000, + "date_relative": "2000-01-01", + "tags": ["inbox","signed"], + "headers": {"Subject": "bad signed message 002", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "test_suite@notmuchmail.org", + "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, + "body": [{"id": 1, + "sigstatus": [], + "content-type": "multipart/signed", + "content": [{"id": 2, + "content-type": "text/plain", + "content": "Incriminating stuff. This is a test signed message.\n"}, + {"id": 3, + "content-type": "application/pgp-signature", + "content-length": "NONZERO"}]}]}, + []]]]' +test_expect_equal_json \ + "$output" \ + "$expected" + +test_begin_subtest "signature verification with full owner trust" +test_subtest_broken_gmime_2 +# give the key full owner trust +echo "${FINGERPRINT}:6:" | gpg --no-tty --import-ownertrust >>"$GNUPGHOME"/trust.log 2>&1 +gpg --no-tty --check-trustdb >>"$GNUPGHOME"/trust.log 2>&1 +output=$(notmuch show --format=json --verify subject:"test signed message 001" \ + | notmuch_json_show_sanitize \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') +expected='[[[{"id": "XXXXX", + "match": true, + "excluded": false, + "filename": ["YYYYY"], + "timestamp": 946728000, + "date_relative": "2000-01-01", + "tags": ["inbox","signed"], + "headers": {"Subject": "test signed message 001", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "test_suite@notmuchmail.org", + "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, + "body": [{"id": 1, + "sigstatus": [{"status": "good", + "fingerprint": "'$FINGERPRINT'", + "created": 946728000, + "userid": "Notmuch Test Suite <test_suite@notmuchmail.org> (INSECURE!)"}], + "content-type": "multipart/signed", + "content": [{"id": 2, + "content-type": "text/plain", + "content": "This is a test signed message.\n"}, + {"id": 3, + "content-type": "application/pgp-signature", + "content-length": "NONZERO"}]}]}, + []]]]' +test_expect_equal_json \ + "$output" \ + "$expected" + +test_begin_subtest "signature verification with signer key unavailable" +# move the gnupghome temporarily out of the way +mv "${GNUPGHOME}"{,.bak} +output=$(notmuch show --format=json --verify subject:"test signed message 001" \ + | notmuch_json_show_sanitize \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') +expected='[[[{"id": "XXXXX", + "match": true, + "excluded": false, + "filename": ["YYYYY"], + "timestamp": 946728000, + "date_relative": "2000-01-01", + "tags": ["inbox","signed"], + "headers": {"Subject": "test signed message 001", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "test_suite@notmuchmail.org", + "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, + "body": [{"id": 1, + "sigstatus": [{"status": "error", + "keyid": "'$(echo $FINGERPRINT | cut -c 25-)'", + "errors": {"key-missing": true}}], + "content-type": "multipart/signed", + "content": [{"id": 2, + "content-type": "text/plain", + "content": "This is a test signed message.\n"}, + {"id": 3, + "content-type": "application/pgp-signature", + "content-length": "NONZERO"}]}]}, + []]]]' +test_expect_equal_json \ + "$output" \ + "$expected" +mv "${GNUPGHOME}"{.bak,} + +test_begin_subtest "emacs delivery of encrypted message with attachment" +# create a test encrypted message with attachment +cat <<EOF >TESTATTACHMENT +This is a test file. +EOF +test_expect_success \ +'emacs_fcc_message \ + "test encrypted message 001" \ + "This is a test encrypted message.\n" \ + "(mml-attach-file \"TESTATTACHMENT\") (mml-secure-message-encrypt)"' + +test_begin_subtest "encrypted part content-type indexing" +output=$(notmuch search mimetype:multipart/encrypted and mimetype:application/pgp-encrypted and mimetype:application/octet-stream | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message 001 (encrypted inbox)" + +test_begin_subtest "decryption, --format=text" +output=$(notmuch show --format=text --decrypt=true subject:"test encrypted message 001" \ + | notmuch_show_sanitize_all \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') +expected='message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (2000-01-01) (encrypted inbox) +Subject: test encrypted message 001 +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: test_suite@notmuchmail.org +Date: Sat, 01 Jan 2000 12:00:00 +0000 +header} +body{ +part{ ID: 1, Content-type: multipart/encrypted +part{ ID: 2, Content-type: application/pgp-encrypted +Non-text part: application/pgp-encrypted +part} +part{ ID: 3, Content-type: multipart/mixed +part{ ID: 4, Content-type: text/plain +This is a test encrypted message. +part} +attachment{ ID: 5, Filename: TESTATTACHMENT, Content-type: application/octet-stream +Non-text part: application/octet-stream +attachment} +part} +part} +body} +message}' +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "decryption, --format=json" +output=$(notmuch show --format=json --decrypt=true subject:"test encrypted message 001" \ + | notmuch_json_show_sanitize \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') +expected='[[[{"id": "XXXXX", + "match": true, + "excluded": false, + "filename": ["YYYYY"], + "timestamp": 946728000, + "date_relative": "2000-01-01", + "tags": ["encrypted","inbox"], + "headers": {"Subject": "test encrypted message 001", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "test_suite@notmuchmail.org", + "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, + "body": [{"id": 1, + "encstatus": [{"status": "good"}], + "sigstatus": [], + "content-type": "multipart/encrypted", + "content": [{"id": 2, + "content-type": "application/pgp-encrypted", + "content-length": "NONZERO"}, + {"id": 3, + "content-type": "multipart/mixed", + "content": [{"id": 4, + "content-type": "text/plain", + "content": "This is a test encrypted message.\n"}, + {"id": 5, + "content-type": "application/octet-stream", + "content-disposition": "attachment", + "content-length": "NONZERO", + "content-transfer-encoding": "base64", + "filename": "TESTATTACHMENT"}]}]}]}, + []]]]' +test_expect_equal_json \ + "$output" \ + "$expected" + +test_begin_subtest "decryption, --format=json, --part=4" +output=$(notmuch show --format=json --part=4 --decrypt=true subject:"test encrypted message 001" \ + | notmuch_json_show_sanitize \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') +expected='{"id": 4, + "content-type": "text/plain", + "content": "This is a test encrypted message.\n"}' +test_expect_equal_json \ + "$output" \ + "$expected" + +test_begin_subtest "decrypt attachment (--part=5 --format=raw)" +notmuch show \ + --format=raw \ + --part=5 \ + --decrypt=true \ + subject:"test encrypted message 001" >OUTPUT +test_expect_equal_file TESTATTACHMENT OUTPUT + +test_begin_subtest "decryption failure with missing key" +mv "${GNUPGHOME}"{,.bak} +output=$(notmuch show --format=json --decrypt=true subject:"test encrypted message 001" \ + | notmuch_json_show_sanitize \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') +expected='[[[{"id": "XXXXX", + "match": true, + "excluded": false, + "filename": ["YYYYY"], + "timestamp": 946728000, + "date_relative": "2000-01-01", + "tags": ["encrypted","inbox"], + "headers": {"Subject": "test encrypted message 001", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "test_suite@notmuchmail.org", + "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, + "body": [{"id": 1, + "encstatus": [{"status": "bad"}], + "content-type": "multipart/encrypted", + "content": [{"id": 2, + "content-type": "application/pgp-encrypted", + "content-length": "NONZERO"}, + {"id": 3, + "content-type": "application/octet-stream", + "content-length": "NONZERO"}]}]}, + []]]]' +test_expect_equal_json \ + "$output" \ + "$expected" +mv "${GNUPGHOME}"{.bak,} + +test_begin_subtest "emacs delivery of encrypted + signed message" +test_expect_success \ +'emacs_fcc_message \ + "test encrypted message 002" \ + "This is another test encrypted message.\n" \ + "(mml-secure-message-sign-encrypt)"' + +test_begin_subtest "decryption + signature verification" +test_subtest_broken_gmime_2 +output=$(notmuch show --format=json --decrypt=true subject:"test encrypted message 002" \ + | notmuch_json_show_sanitize \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') +expected='[[[{"id": "XXXXX", + "match": true, + "excluded": false, + "filename": ["YYYYY"], + "timestamp": 946728000, + "date_relative": "2000-01-01", + "tags": ["encrypted","inbox"], + "headers": {"Subject": "test encrypted message 002", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "test_suite@notmuchmail.org", + "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, + "body": [{"id": 1, + "encstatus": [{"status": "good"}], + "sigstatus": [{"status": "good", + "fingerprint": "'$FINGERPRINT'", + "created": 946728000, + "userid": "Notmuch Test Suite <test_suite@notmuchmail.org> (INSECURE!)"}], + "content-type": "multipart/encrypted", + "content": [{"id": 2, + "content-type": "application/pgp-encrypted", + "content-length": "NONZERO"}, + {"id": 3, + "content-type": "text/plain", + "content": "This is another test encrypted message.\n"}]}]}, + []]]]' +test_expect_equal_json \ + "$output" \ + "$expected" + +test_begin_subtest "reply to encrypted message" +output=$(notmuch reply --decrypt=true subject:"test encrypted message 002" \ + | notmuch_drop_mail_headers In-Reply-To References) +expected='From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: test encrypted message 002 + +On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote: +> This is another test encrypted message.' +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "Reply within emacs to an encrypted message" +test_emacs "(let ((message-hidden-headers '()) + (notmuch-crypto-process-mime 't)) + (notmuch-show \"subject:test.encrypted.message.002\") + (notmuch-show-reply) + (test-output))" +# the empty To: is probably a bug, but it's not to do with encryption +grep -v -e '^In-Reply-To:' -e '^References:' -e '^Fcc:' -e 'To:' < OUTPUT > OUTPUT.clean +cat <<EOF >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +Subject: Re: test encrypted message 002 +--text follows this line-- +<#secure method=pgpmime mode=signencrypt> +Notmuch Test Suite <test_suite@notmuchmail.org> writes: + +> This is another test encrypted message. +EOF +test_expect_equal_file EXPECTED OUTPUT.clean + +test_begin_subtest "signature verification with revoked key" +# generate revocation certificate and load it to revoke key +echo "y +1 +Notmuch Test Suite key revocation (automated) $(date '+%F_%T%z') + +y + +" \ + | gpg --no-tty --quiet --command-fd 0 --armor --gen-revoke "0x${FINGERPRINT}!" 2>/dev/null \ + | gpg --no-tty --quiet --import +output=$(notmuch show --format=json --verify subject:"test signed message 001" \ + | notmuch_json_show_sanitize \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|') +expected='[[[{"id": "XXXXX", + "match": true, + "excluded": false, + "filename": ["YYYYY"], + "timestamp": 946728000, + "date_relative": "2000-01-01", + "tags": ["inbox","signed"], + "headers": {"Subject": "test signed message 001", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "test_suite@notmuchmail.org", + "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, + "body": [{"id": 1, + "sigstatus": [{"status": "error", + "keyid": "6D92612D94E46381", + "errors": {"key-revoked": true}}], + "content-type": "multipart/signed", + "content": [{"id": 2, + "content-type": "text/plain", + "content": "This is a test signed message.\n"}, + {"id": 3, + "content-type": "application/pgp-signature", + "content-length": "NONZERO"}]}]}, + []]]]' +test_expect_equal_json \ + "$output" \ + "$expected" + +test_done diff --git a/test/T355-smime.sh b/test/T355-smime.sh new file mode 100755 index 00000000..be45e3b1 --- /dev/null +++ b/test/T355-smime.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash + +test_description='S/MIME signature verification and decryption' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_gpgsm_home () +{ + local fpr + [ -d ${GNUPGHOME} ] && return + _gnupg_exit () { gpgconf --kill all 2>/dev/null || true; } + at_exit_function _gnupg_exit + mkdir -m 0700 "$GNUPGHOME" + gpgsm --no-tty --no-common-certs-import --disable-dirmngr --import < $NOTMUCH_SRCDIR/test/smime/test.crt >"$GNUPGHOME"/import.log 2>&1 + fpr=$(gpgsm --list-key test_suite@notmuchmail.org | sed -n 's/.*fingerprint: //p') + echo "$fpr S relax" >> $GNUPGHOME/trustlist.txt + test_debug "cat $GNUPGHOME/import.log" +} + +test_require_external_prereq openssl +test_require_external_prereq gpgsm + +cp $NOTMUCH_SRCDIR/test/smime/key+cert.pem test_suite.pem + +FINGERPRINT=$(openssl x509 -fingerprint -in test_suite.pem -noout | sed -e 's/^.*=//' -e s/://g) + +add_gpgsm_home + +test_begin_subtest "emacs delivery of S/MIME signed message" +test_expect_success \ + 'emacs_fcc_message \ + "test signed message 001" \ + "This is a test signed message." \ + "(mml-secure-message-sign \"smime\")"' + +test_begin_subtest "emacs delivery of S/MIME encrypted + signed message" +# Hard code the MML to avoid several interactive questions +test_expect_success \ +'emacs_fcc_message \ + "test encrypted message 001" \ + "<#secure method=smime mode=signencrypt keyfile=\\\"test_suite.pem\\\" certfile=\\\"test_suite.pem\\\">\nThis is a test encrypted message.\n"' + +test_begin_subtest "Signature verification (openssl)" +notmuch show --format=raw subject:"test signed message 001" |\ + openssl smime -verify -CAfile $NOTMUCH_SRCDIR/test/smime/test.crt 2>OUTPUT +cat <<EOF > EXPECTED +Verification successful +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "signature verification (notmuch CLI)" +if [ "${NOTMUCH_GMIME_MAJOR}" -lt 3 ]; then + # gmime 2 can't report User IDs properly for S/MIME + USERID='' +else + USERID='"userid": "CN=Notmuch Test Suite",' +fi +output=$(notmuch show --format=json --verify subject:"test signed message 001" \ + | notmuch_json_show_sanitize \ + | sed -e 's|"created": [-1234567890]*|"created": 946728000|' \ + -e 's|"expires": [-1234567890]*|"expires": 424242424|' ) +expected='[[[{"id": "XXXXX", + "match": true, + "excluded": false, + "filename": ["YYYYY"], + "timestamp": 946728000, + "date_relative": "2000-01-01", + "tags": ["inbox","signed"], + "headers": {"Subject": "test signed message 001", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "test_suite@notmuchmail.org", + "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, + "body": [{"id": 1, + "sigstatus": [{"fingerprint": "'$FINGERPRINT'", + "status": "good",'$USERID' + "expires": 424242424, + "created": 946728000}], + "content-type": "multipart/signed", + "content": [{"id": 2, + "content-type": "text/plain", + "content": "This is a test signed message.\n"}, + {"id": 3, + "content-disposition": "attachment", + "content-length": "NONZERO", + "content-transfer-encoding": "base64", + "content-type": "application/x-pkcs7-signature", + "filename": "smime.p7s"}]}]}, + []]]]' +test_expect_equal_json \ + "$output" \ + "$expected" + +test_begin_subtest "Decryption and signature verification (openssl)" +notmuch show --format=raw subject:"test encrypted message 001" |\ + openssl smime -decrypt -recip test_suite.pem |\ + openssl smime -verify -CAfile $NOTMUCH_SRCDIR/test/smime/test.crt 2>OUTPUT +cat <<EOF > EXPECTED +Verification successful +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T357-index-decryption.sh b/test/T357-index-decryption.sh new file mode 100755 index 00000000..c5435f4f --- /dev/null +++ b/test/T357-index-decryption.sh @@ -0,0 +1,321 @@ +#!/usr/bin/env bash + +# TODO: test index.decryption=failed + +test_description='indexing decrypted mail' +. $(dirname "$0")/test-lib.sh || exit 1 + +################################################## + +add_gnupg_home +# get key fingerprint +FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-colons --fingerprint | grep '^fpr:' | cut -d: -f10) + +# create a test encrypted message +test_begin_subtest 'emacs delivery of encrypted message' +test_expect_success \ +'emacs_fcc_message \ + "test encrypted message for cleartext index 001" \ + "This is a test encrypted message with a wumpus.\n" \ + "(mml-secure-message-encrypt)"' + +test_begin_subtest "search for unindexed cleartext" +output=$(notmuch search wumpus) +expected='' +test_expect_equal \ + "$output" \ + "$expected" + +# create a test encrypted message that is indexed in the clear +test_begin_subtest 'emacs delivery of encrypted message' +test_expect_success \ +'emacs_fcc_message --decrypt=true \ + "test encrypted message for cleartext index 002" \ + "This is a test encrypted message with a wumpus.\n" \ + "(mml-secure-message-encrypt)"' + +test_begin_subtest "emacs delivery of encrypted message, indexed cleartext" +output=$(notmuch search wumpus) +expected='thread:0000000000000002 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (encrypted inbox)' +test_expect_equal \ + "$output" \ + "$expected" + +# and the same search, but by property ($expected is untouched): +test_begin_subtest "emacs search by property for one message" +output=$(notmuch search property:index.decryption=success) +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "show the message body of the encrypted message" +notmuch dump wumpus +output=$(notmuch show wumpus | notmuch_show_part 3) +expected='This is a test encrypted message with a wumpus.' +if [ $NOTMUCH_HAVE_GMIME_SESSION_KEYS -eq 0 ]; then + test_subtest_known_broken +fi +test_expect_equal \ + "$output" \ + "$expected" + + +test_begin_subtest "message should go away after deletion" +# cache the message in an env var and remove it: +fname=$(notmuch search --output=files wumpus) +contents="$(notmuch show --format=raw wumpus)" +rm -f "$fname" +notmuch new +output=$(notmuch search wumpus) +expected='' +test_expect_equal \ + "$output" \ + "$expected" + +# try reinserting it without decryption, should stay the same: +test_begin_subtest "message cleartext not present after insert" +notmuch insert --folder=sent <<<"$contents" +output=$(notmuch search wumpus) +test_expect_equal \ + "$output" \ + "$expected" + +# show the message using stashing decryption +test_begin_subtest "stash decryption during show" +output=$(notmuch show --decrypt=stash tag:encrypted subject:002 | notmuch_show_part 3) +expected='This is a test encrypted message with a wumpus.' +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "search should now find the contents" +output=$(notmuch search wumpus) +expected='thread:0000000000000003 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (encrypted inbox unread)' +if [ $NOTMUCH_HAVE_GMIME_SESSION_KEYS -eq 0 ]; then + test_subtest_known_broken +fi +test_expect_equal \ + "$output" \ + "$expected" + +# try reinserting it with decryption, should appear again, but now we +# have two copies of the message: +test_begin_subtest "message cleartext is present after reinserting with --decrypt=true" +notmuch insert --folder=sent --decrypt=true <<<"$contents" +output=$(notmuch search wumpus) +expected='thread:0000000000000003 2000-01-01 [1/1(2)] Notmuch Test Suite; test encrypted message for cleartext index 002 (encrypted inbox unread)' +test_expect_equal \ + "$output" \ + "$expected" + +# remove all copies +test_begin_subtest "delete all copies of the message" +mid="$(notmuch search --output=messages wumpus)" +rm -f $(notmuch search --output=files wumpus) +notmuch new +output=$(notmuch search "id:$mid") +expected='' +test_expect_equal \ + "$output" \ + "$expected" + +# try inserting it with decryption, should appear as a single copy +# (note: i think thread id skips 4 because of duplicate message-id +# insertion, above) +test_begin_subtest "message cleartext is present with insert --decrypt=true" +notmuch insert --folder=sent --decrypt=true <<<"$contents" +output=$(notmuch search wumpus) +expected='thread:0000000000000005 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (encrypted inbox unread)' +test_expect_equal \ + "$output" \ + "$expected" + + +# add a tag to all messages to ensure that it stays after reindexing +test_begin_subtest 'tagging all messages' +test_expect_success 'notmuch tag +blarney "encrypted message"' +test_begin_subtest "verify that tags have not changed" +output=$(notmuch search tag:blarney) +expected='thread:0000000000000001 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 001 (blarney encrypted inbox) +thread:0000000000000005 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (blarney encrypted inbox unread)' +test_expect_equal \ + "$output" \ + "$expected" + +# see if first message shows up after reindexing with --decrypt=true (same $expected, untouched): +test_begin_subtest 'reindex old messages' +test_expect_success 'notmuch reindex --decrypt=true tag:encrypted and not property:index.decryption=success' +test_begin_subtest "reindexed encrypted message, including cleartext" +output=$(notmuch search wumpus) +test_expect_equal \ + "$output" \ + "$expected" + +# and the same search, but by property ($expected is untouched): +test_begin_subtest "emacs search by property for both messages" +output=$(notmuch search property:index.decryption=success) +test_expect_equal \ + "$output" \ + "$expected" + +# try a simple reindex +test_begin_subtest 'reindex in auto mode' +test_expect_success 'notmuch reindex tag:encrypted and property:index.decryption=success' +test_begin_subtest "reindexed encrypted messages, should not have changed" +output=$(notmuch search wumpus) +if [ $NOTMUCH_HAVE_GMIME_SESSION_KEYS -eq 0 ]; then + test_subtest_known_broken +fi +test_expect_equal \ + "$output" \ + "$expected" + +# try to remove cleartext indexing +test_begin_subtest 'reindex without cleartext' +test_expect_success 'notmuch reindex --decrypt=false tag:encrypted and property:index.decryption=success' +test_begin_subtest "reindexed encrypted messages, without cleartext" +output=$(notmuch search wumpus) +expected='' +test_expect_equal \ + "$output" \ + "$expected" + +# ensure no session keys are present: +test_begin_subtest 'reindex using only session keys' +test_expect_success 'notmuch reindex tag:encrypted and property:index.decryption=success' +test_begin_subtest "reindexed encrypted messages, decrypting only with session keys" +output=$(notmuch search wumpus) +expected='' +test_expect_equal \ + "$output" \ + "$expected" + +# and the same search, but by property ($expected is untouched): +test_begin_subtest "emacs search by property with both messages unindexed" +output=$(notmuch search property:index.decryption=success) +test_expect_equal \ + "$output" \ + "$expected" + +# ensure that the tags remain even when we are dropping the cleartext. +test_begin_subtest "verify that tags remain without cleartext" +output=$(notmuch search tag:blarney) +expected='thread:0000000000000001 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 001 (blarney encrypted inbox) +thread:0000000000000005 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (blarney encrypted inbox unread)' +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "index cleartext without keeping session keys" +test_expect_success "notmuch reindex --decrypt=nostash tag:blarney" + +test_begin_subtest "Ensure that the indexed terms are present" +output=$(notmuch search wumpus) +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "show one of the messages with --decrypt=true" +output=$(notmuch show --decrypt=true thread:0000000000000001 | notmuch_show_part 3) +expected='This is a test encrypted message with a wumpus.' +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "Ensure that we cannot show the message with --decrypt=auto" +output=$(notmuch show thread:0000000000000001 | notmuch_show_part 3) +expected='Non-text part: application/octet-stream' +test_expect_equal \ + "$output" \ + "$expected" + +add_email_corpus crypto + +test_begin_subtest "indexing message fails when secret key not available" +notmuch reindex --decrypt=true id:simple-encrypted@crypto.notmuchmail.org +output=$(notmuch dump ) +expected='#notmuch-dump batch-tag:3 config,properties,tags ++encrypted +inbox +unread -- id:simple-encrypted@crypto.notmuchmail.org +#= simple-encrypted@crypto.notmuchmail.org index.decryption=failure' +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "cannot find cleartext index" +output=$(notmuch search sekrit) +expected='' +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "cleartext index recovery on reindexing with stashed session keys" +notmuch restore <<EOF +#notmuch-dump batch-tag:3 config,properties,tags +#= simple-encrypted@crypto.notmuchmail.org session-key=9%3AFC09987F5F927CC0CC0EE80A96E4C5BBF4A499818FB591207705DFDDD6112CF9 +EOF +notmuch reindex id:simple-encrypted@crypto.notmuchmail.org +output=$(notmuch search sekrit) +expected='thread:0000000000000001 2016-12-22 [1/1] Daniel Kahn Gillmor; encrypted message (encrypted inbox unread)' +if [ $NOTMUCH_HAVE_GMIME_SESSION_KEYS -eq 0 ]; then + test_subtest_known_broken +fi +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "notmuch reply should show cleartext if session key is present" +output=$(notmuch reply id:simple-encrypted@crypto.notmuchmail.org | grep '^>') +expected='> This is a top sekrit message.' +if [ $NOTMUCH_HAVE_GMIME_SESSION_KEYS -eq 0 ]; then + test_subtest_known_broken +fi +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "notmuch show should show cleartext if session key is present" +output=$(notmuch show id:simple-encrypted@crypto.notmuchmail.org | notmuch_show_part 3) +expected='This is a top sekrit message.' +if [ $NOTMUCH_HAVE_GMIME_SESSION_KEYS -eq 0 ]; then + test_subtest_known_broken +fi +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "notmuch show should show nothing if decryption is explicitly disallowed" +output=$(notmuch show --decrypt=false id:simple-encrypted@crypto.notmuchmail.org | notmuch_show_part 3) +expected='Non-text part: application/octet-stream' +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "purging stashed session keys should lose access to the cleartext" +notmuch reindex --decrypt=false id:simple-encrypted@crypto.notmuchmail.org +output=$(notmuch search sekrit) +expected='' +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "and cleartext should be unrecoverable now that there are no stashed session keys" +notmuch dump +notmuch reindex --decrypt=true id:simple-encrypted@crypto.notmuchmail.org +output=$(notmuch search sekrit) +expected='' +test_expect_equal \ + "$output" \ + "$expected" + + +# TODO: test removal of a message from the message store between +# indexing and reindexing. + +# TODO: insert the same message into the message store twice, index, +# remove one of them from the message store, and then reindex. +# reindexing should return a failure but the message should still be +# present? -- or what should the semantics be if you ask to reindex a +# message whose underlying files have been renamed or moved or +# removed? + +test_done diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh new file mode 100755 index 00000000..43921cb4 --- /dev/null +++ b/test/T360-symbol-hiding.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2011 David Bremner +# + +# This test tests whether hiding Xapian::Error symbols in libnotmuch +# also hides them for other users of libxapian. This is motivated by +# the discussion in https://gcc.gnu.org/wiki/Visibility' + +test_description='exception symbol hiding' + +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest 'running test' run_test +mkdir -p ${PWD}/fakedb/.notmuch +$TEST_DIRECTORY/symbol-test ${PWD}/fakedb ${PWD}/nonexistent 2>&1 \ + | notmuch_dir_sanitize | sed -e "s,\`,\',g" -e "s,${NOTMUCH_DEFAULT_XAPIAN_BACKEND},backend,g" > OUTPUT + +cat <<EOF > EXPECTED +A Xapian exception occurred opening database: Couldn't stat 'CWD/fakedb/.notmuch/xapian' +caught No backend database found at path 'CWD/nonexistent' +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'checking output' +test_expect_equal "$result" "$output" + +test_begin_subtest 'comparing existing to exported symbols' +nm -P $NOTMUCH_BUILDDIR/lib/libnotmuch.so | awk '$2 == "T" && $1 ~ "^notmuch" {print $1}' | sort | uniq > ACTUAL +sed -n 's/^\(notmuch_[a-zA-Z0-9_]*\)[[:blank:]]*(.*/\1/p' $NOTMUCH_SRCDIR/lib/notmuch.h | sort | uniq > EXPORTED +test_expect_equal_file EXPORTED ACTUAL + +test_done diff --git a/test/T370-search-folder-coherence.sh b/test/T370-search-folder-coherence.sh new file mode 100755 index 00000000..0a2727e7 --- /dev/null +++ b/test/T370-search-folder-coherence.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +test_description='folder tags removed and added through file renames remain consistent' +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "No new messages" +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "No new mail." + + +test_begin_subtest "Single new message" +generate_message +file_x=$gen_msg_filename +id_x=$gen_msg_id +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Add second folder for same message" +dir=$(dirname $file_x) +mkdir $dir/spam +cp $file_x $dir/spam +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "No new mail." + + +test_begin_subtest "Multiple files for same message" +cat <<EOF >EXPECTED +MAIL_DIR/msg-001 +MAIL_DIR/spam/msg-001 +EOF +notmuch search --output=files id:$id_x | notmuch_search_files_sanitize >OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Test matches folder:spam" +output=$(notmuch search folder:spam) +test_expect_equal "$output" "thread:0000000000000001 2001-01-05 [1/1(2)] Notmuch Test Suite; Single new message (inbox unread)" + +test_begin_subtest "Remove folder:spam copy of email" +rm $dir/spam/$(basename $file_x) +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "No new mail. Detected 1 file rename." + +test_begin_subtest "No mails match the folder:spam search" +output=$(notmuch search folder:spam) +test_expect_equal "$output" "" + +test_done diff --git a/test/T380-atomicity.sh b/test/T380-atomicity.sh new file mode 100755 index 00000000..45de2228 --- /dev/null +++ b/test/T380-atomicity.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash +test_description='atomicity' +. $(dirname "$0")/test-lib.sh || exit 1 + +# This script tests the effects of killing and restarting "notmuch +# new" at arbitrary points. If notmuch new is properly atomic, the +# final database contents should be the same regardless of when (or +# if) it is killed and restarted. + +if test_require_external_prereq gdb; then + +# Create a maildir structure to also stress flag synchronization + mkdir $MAIL_DIR/cur + mkdir $MAIL_DIR/new + mkdir $MAIL_DIR/tmp + mkdir $MAIL_DIR/.remove-dir + + # Prepare the initial database + generate_message [subject]='Duplicate' [filename]='duplicate:2,' [dir]=cur + generate_message [subject]='Remove' [filename]='remove:2,' [dir]=cur + generate_message [subject]='"Remove duplicate"' [filename]='remove-duplicate:2,' [dir]=cur + cp $MAIL_DIR/cur/remove-duplicate:2, $MAIL_DIR/cur/remove-duplicate-copy:2, + generate_message [subject]='Rename' [filename]='rename:2,' [dir]=cur + generate_message [subject]='"Rename duplicate"' [filename]='rename-duplicate:2,' [dir]=cur + generate_message [subject]='"Move 1"' [filename]='move1:2,' [dir]=cur + generate_message [subject]='"Move 2"' [filename]='move2:2,' [dir]=new + generate_message [subject]='Flag' [filename]='flag:2,' [dir]=cur + generate_message [subject]='"Flag duplicate"' [filename]='flag-duplicate:2,' [dir]=cur + cp $MAIL_DIR/cur/flag-duplicate:2, $MAIL_DIR/cur/flag-duplicate-copy:2,F + generate_message [subject]='"Remove directory"' [filename]='remove-directory:2,' [dir]=.remove-dir + generate_message [subject]='"Remove directory duplicate"' [filename]='remove-directory-duplicate:2,' [dir]=.remove-dir + cp $MAIL_DIR/.remove-dir/remove-directory-duplicate:2, $MAIL_DIR/cur/ + notmuch new > /dev/null + + # Make all maildir changes, but *don't* update the database + generate_message [subject]='Added' [filename]='added:2,' [dir]=cur + cp $MAIL_DIR/cur/duplicate:2, $MAIL_DIR/cur/duplicate-copy:2, + generate_message [subject]='"Add duplicate"' [filename]='add-duplicate:2,' [dir]=cur + generate_message [subject]='"Add duplicate copy"' [filename]='add-duplicate-copy:2,' [dir]=cur + rm $MAIL_DIR/cur/remove:2, + rm $MAIL_DIR/cur/remove-duplicate-copy:2, + mv $MAIL_DIR/cur/rename:2, $MAIL_DIR/cur/renamed:2, + mv $MAIL_DIR/cur/rename-duplicate:2, $MAIL_DIR/cur/renamed-duplicate:2, + mv $MAIL_DIR/cur/move1:2, $MAIL_DIR/new/move1:2, + mv $MAIL_DIR/new/move2:2, $MAIL_DIR/cur/move2:2, + mv $MAIL_DIR/cur/flag:2, $MAIL_DIR/cur/flag:2,F + rm $MAIL_DIR/cur/flag-duplicate-copy:2,F + rm $MAIL_DIR/.remove-dir/remove-directory:2, + rm $MAIL_DIR/.remove-dir/remove-directory-duplicate:2, + rmdir $MAIL_DIR/.remove-dir + + # Prepare a snapshot of the updated maildir. The gdb script will + # update the database in this snapshot as it goes. + cp -a $MAIL_DIR $MAIL_DIR.snap + cp ${NOTMUCH_CONFIG} ${NOTMUCH_CONFIG}.snap + NOTMUCH_CONFIG=${NOTMUCH_CONFIG}.snap notmuch config set database.path $MAIL_DIR.snap + + + + # Execute notmuch new and, at every call to rename, snapshot the + # database, run notmuch new again on the snapshot, and capture the + # results of search. + # + # -tty /dev/null works around a conflict between the 'timeout' wrapper + # and gdb's attempt to control the TTY. + export MAIL_DIR + ${TEST_GDB} -tty /dev/null -batch -x $NOTMUCH_SRCDIR/test/atomicity.py notmuch 1>gdb.out 2>&1 + + # Get the final, golden output + notmuch search '*' > expected + + # Check output against golden output + outcount=$(cat outcount) + echo -n > searchall + echo -n > expectall + for ((i = 0; i < $outcount; i++)); do + if ! cmp -s search.$i expected; then + # Find the range of interruptions that match this output + for ((end = $i + 1 ; end < $outcount; end++)); do + if ! cmp -s search.$i search.$end; then + break + fi + done + echo "When interrupted after $test/backtrace.$(expr $i - 1) (abort points $i-$(expr $end - 1))" >> searchall + cat search.$i >> searchall + cat expected >> expectall + echo >> searchall + echo >> expectall + + i=$(expr $end - 1) + fi + done +fi + +test_begin_subtest '"notmuch new" is idempotent under arbitrary aborts' +test_expect_equal_file searchall expectall + +test_begin_subtest "detected $outcount>10 abort points" +test_expect_success "test $outcount -gt 10" + +test_done diff --git a/test/T390-python.sh b/test/T390-python.sh new file mode 100755 index 00000000..9f71ce3c --- /dev/null +++ b/test/T390-python.sh @@ -0,0 +1,197 @@ +#!/usr/bin/env bash +test_description="python bindings" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_require_external_prereq ${NOTMUCH_PYTHON} + +add_email_corpus +add_gnupg_home + +test_begin_subtest "compare thread ids" +test_python <<EOF +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY) +q_new = notmuch.Query(db, 'tag:inbox') +q_new.set_sort(notmuch.Query.SORT.OLDEST_FIRST) +for t in q_new.search_threads(): + print (t.get_thread_id()) +EOF +notmuch search --sort=oldest-first --output=threads tag:inbox | sed s/^thread:// > EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "compare message ids" +test_python <<EOF +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY) +q_new = notmuch.Query(db, 'tag:inbox') +q_new.set_sort(notmuch.Query.SORT.OLDEST_FIRST) +for m in q_new.search_messages(): + print (m.get_message_id()) +EOF +notmuch search --sort=oldest-first --output=messages tag:inbox | sed s/^id:// > EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "get non-existent file" +test_python <<EOF +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY) +print (db.find_message_by_filename("i-dont-exist")) +EOF +test_expect_equal "$(cat OUTPUT)" "None" + +test_begin_subtest "get revision" +test_python ${MAIL_DIR} <<'EOF' +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY) +(revision, uuid) = db.get_revision() +print ("%s\t%lu" % (uuid, revision)) +EOF +notmuch_uuid_sanitize < OUTPUT > CLEAN +cat <<'EOF' >EXPECTED +UUID 53 +EOF +test_expect_equal_file EXPECTED CLEAN + +grep '^[0-9a-f]' OUTPUT > INITIAL_OUTPUT + +test_begin_subtest "output of count matches test code" +notmuch count --lastmod '*' | cut -f2-3 > OUTPUT +test_expect_equal_file INITIAL_OUTPUT OUTPUT +add_message '[content-type]="text/plain; charset=iso-8859-2"' \ + '[content-transfer-encoding]=8bit' \ + '[subject]="ISO-8859-2 encoded message"' \ + "[body]=$'Czech word tu\350\362\341\350\350\355 means pinguin\'s.'" # ISO-8859-2 characters are generated by shell's escape sequences +test_begin_subtest "Add ISO-8859-2 encoded message, call get_message_parts" +test_python <<EOF +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY) +q_new = notmuch.Query(db, 'ISO-8859-2 encoded message') +for m in q_new.search_messages(): + for mp in m.get_message_parts(): + continue + print(m.get_message_id()) +EOF + +notmuch search --sort=oldest-first --output=messages "tuÄňáÄÄÃ" | sed s/^id:// > EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +# TODO currently these tests for setting and getting config values are +# somewhat interdependent. This is because the config values stored in the +# database are not cleaned up after each test, so they remain there for the +# next test. The ./README file states that this can happen so it seems kind +# of ok. + +test_begin_subtest "set and get config values" +test_python <<'EOF' +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE) +db.set_config('testkey1', 'testvalue1') +db.set_config('testkey2', 'testvalue2') +v1 = db.get_config('testkey1') +v2 = db.get_config('testkey2') +print('testkey1 = ' + v1) +print('testkey2 = ' + v2) +EOF +cat <<'EOF' >EXPECTED +testkey1 = testvalue1 +testkey2 = testvalue2 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "get_configs with no match returns empty generator" +test_python <<'EOF' +import notmuch +db = notmuch.Database() +v = db.get_configs('nonexistent') +print(list(v) == []) +EOF +test_expect_equal "$(cat OUTPUT)" "True" + +test_begin_subtest "get_configs with no arguments returns all pairs" +test_python <<'EOF' +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE) +db.set_config("zzzafter", "afterval") +db.set_config("aaabefore", "beforeval") +v = db.get_configs() +for index, keyval in enumerate(v): + key, val = keyval + print('{}: {} => {}'.format(index, key, val)) +EOF +cat <<'EOF' >EXPECTED +0: aaabefore => beforeval +1: testkey1 => testvalue1 +2: testkey2 => testvalue2 +3: zzzafter => afterval +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "get_configs prefix is used to match keys" +test_python <<'EOF' +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE) +db.set_config('testkey1', 'testvalue1') +db.set_config('testkey2', 'testvalue2') +v = db.get_configs('testkey') +for index, keyval in enumerate(v): + key, val = keyval + print('{}: {} => {}'.format(index, key, val)) +EOF +cat <<'EOF' >EXPECTED +0: testkey1 => testvalue1 +1: testkey2 => testvalue2 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "set_config with no value will unset config entries" +test_python <<'EOF' +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE) +db.set_config('testkey1', '') +db.set_config('testkey2', '') +db.set_config("zzzafter", '') +db.set_config("aaabefore", '') +v = db.get_configs() +print(list(v) == []) +EOF +test_expect_equal "$(cat OUTPUT)" "True" + +mkdir -p "${MAIL_DIR}/cur" +fname="${MAIL_DIR}/cur/simplemsg.eml" +cat <<EOF > "$fname" +From: test_suite@notmuchmail.org +To: test_suite@notmuchmail.org +Subject: encrypted message +Date: Sat, 01 Jan 2000 12:00:00 +0000 +Message-ID: <simplemsg@crypto.notmuchmail.org> +MIME-Version: 1.0 +Content-Type: multipart/encrypted; boundary="=-=-="; + protocol="application/pgp-encrypted" + +--=-=-= +Content-Type: application/pgp-encrypted + +Version: 1 + +--=-=-= +Content-Type: application/octet-stream + +$(printf 'Content-Type: text/plain\n\nThis is the sekrit message\n' | gpg --no-tty --batch --quiet --trust-model=always --encrypt --armor --recipient test_suite@notmuchmail.org) +--=-=-=-- +EOF + +test_begin_subtest "index message with decryption" +test_python <<EOF +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE) +(m, status) = db.index_file('$fname', decrypt_policy=notmuch.Database.DECRYPTION_POLICY.TRUE) +if status == notmuch.errors.STATUS.DUPLICATE_MESSAGE_ID: + print("got duplicate message") +q_new = notmuch.Query(db, 'sekrit') +for m in q_new.search_messages(): + print(m.get_filename()) +EOF +echo "$fname" > EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh new file mode 100755 index 00000000..a0b76eb8 --- /dev/null +++ b/test/T395-ruby.sh @@ -0,0 +1,102 @@ +#!/usr/bin/env bash +test_description="ruby bindings" +. $(dirname "$0")/test-lib.sh || exit 1 + +if [ "${NOTMUCH_HAVE_RUBY_DEV}" = "0" ]; then + test_subtest_missing_external_prereq_["ruby development files"]=t +fi + +add_email_corpus + +test_begin_subtest "compare thread ids" +test_ruby <<"EOF" +require 'notmuch' +$maildir = ENV['MAIL_DIR'] +if not $maildir then + abort('environment variable MAIL_DIR must be set') +end +@db = Notmuch::Database.new($maildir) +@q = @db.query('tag:inbox') +@q.sort = Notmuch::SORT_OLDEST_FIRST +for t in @q.search_threads do + print t.thread_id, "\n" +end +EOF +notmuch search --sort=oldest-first --output=threads tag:inbox | sed s/^thread:// > EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "compare message ids" +test_ruby <<"EOF" +require 'notmuch' +$maildir = ENV['MAIL_DIR'] +if not $maildir then + abort('environment variable MAIL_DIR must be set') +end +@db = Notmuch::Database.new($maildir) +@q = @db.query('tag:inbox') +@q.sort = Notmuch::SORT_OLDEST_FIRST +for m in @q.search_messages do + print m.message_id, "\n" +end +EOF +notmuch search --sort=oldest-first --output=messages tag:inbox | sed s/^id:// > EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "get non-existent file" +test_ruby <<"EOF" +require 'notmuch' +$maildir = ENV['MAIL_DIR'] +if not $maildir then + abort('environment variable MAIL_DIR must be set') +end +@db = Notmuch::Database.new($maildir) +result = @db.find_message_by_filename('i-dont-exist') +print (result == nil) +EOF +test_expect_equal "$(cat OUTPUT)" "true" + +test_begin_subtest "count messages" +test_ruby <<"EOF" +require 'notmuch' +$maildir = ENV['MAIL_DIR'] +if not $maildir then + abort('environment variable MAIL_DIR must be set') +end +@db = Notmuch::Database.new($maildir) +@q = @db.query('tag:inbox') +print @q.count_messages(),"\n" +EOF +notmuch count --output=messages tag:inbox > EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "count threads" +test_ruby <<"EOF" +require 'notmuch' +$maildir = ENV['MAIL_DIR'] +if not $maildir then + abort('environment variable MAIL_DIR must be set') +end +@db = Notmuch::Database.new($maildir) +@q = @db.query('tag:inbox') +print @q.count_threads(),"\n" +EOF +notmuch count --output=threads tag:inbox > EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "get all tags" +test_ruby <<"EOF" +require 'notmuch' +$maildir = ENV['MAIL_DIR'] +if not $maildir then + abort('environment variable MAIL_DIR must be set') +end +@db = Notmuch::Database.new($maildir) +@t = @db.all_tags() +for tag in @t do + print tag,"\n" +end +EOF +notmuch search --output=tags '*' > EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T400-hooks.sh b/test/T400-hooks.sh new file mode 100755 index 00000000..49c690eb --- /dev/null +++ b/test/T400-hooks.sh @@ -0,0 +1,121 @@ +#!/usr/bin/env bash +test_description='hooks' +. $(dirname "$0")/test-lib.sh || exit 1 + +HOOK_DIR=${MAIL_DIR}/.notmuch/hooks + +create_echo_hook () { + local TOKEN="${RANDOM}" + mkdir -p ${HOOK_DIR} + cat <<EOF >"${HOOK_DIR}/${1}" +#!/bin/sh +echo "${TOKEN}" > ${3} +EOF + chmod +x "${HOOK_DIR}/${1}" + echo "${TOKEN}" > ${2} +} + +create_failing_hook () { + mkdir -p ${HOOK_DIR} + cat <<EOF >"${HOOK_DIR}/${1}" +#!/bin/sh +exit 13 +EOF + chmod +x "${HOOK_DIR}/${1}" +} + +rm_hooks () { + rm -rf ${HOOK_DIR} +} + +# add a message to generate mail dir and database +add_message +# create maildir structure for notmuch-insert +mkdir -p "$MAIL_DIR"/{cur,new,tmp} + +test_begin_subtest "pre-new is run" +rm_hooks +generate_message +create_echo_hook "pre-new" expected output +notmuch new > /dev/null +test_expect_equal_file expected output + +test_begin_subtest "post-new is run" +rm_hooks +generate_message +create_echo_hook "post-new" expected output +notmuch new > /dev/null +test_expect_equal_file expected output + +test_begin_subtest "post-insert hook is run" +rm_hooks +generate_message +create_echo_hook "post-insert" expected output +notmuch insert < "$gen_msg_filename" +test_expect_equal_file expected output + +test_begin_subtest "pre-new is run before post-new" +rm_hooks +generate_message +create_echo_hook "pre-new" pre-new.expected pre-new.output +create_echo_hook "post-new" post-new.expected post-new.output +notmuch new > /dev/null +test_expect_equal_file post-new.expected post-new.output + +test_begin_subtest "pre-new non-zero exit status (hook status)" +rm_hooks +generate_message +create_failing_hook "pre-new" +output=`notmuch new 2>&1` +test_expect_equal "$output" "Error: pre-new hook failed with status 13" + +# depends on the previous subtest leaving broken hook behind +test_begin_subtest "pre-new non-zero exit status (notmuch status)" +test_expect_code 1 "notmuch new" + +# depends on the previous subtests leaving 1 new message behind +test_begin_subtest "pre-new non-zero exit status aborts new" +rm_hooks +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "post-new non-zero exit status (hook status)" +rm_hooks +generate_message +create_failing_hook "post-new" +NOTMUCH_NEW 2>output.stderr >output +cat output.stderr >> output +echo "Added 1 new message to the database." > expected +echo "Error: post-new hook failed with status 13" >> expected +test_expect_equal_file expected output + +# depends on the previous subtest leaving broken hook behind +test_begin_subtest "post-new non-zero exit status (notmuch status)" +test_expect_code 1 "notmuch new" + +test_begin_subtest "post-insert hook does not affect insert status" +rm_hooks +generate_message +create_failing_hook "post-insert" +test_expect_success "notmuch insert < \"$gen_msg_filename\" > /dev/null" + +test_begin_subtest "hook without executable permissions" +rm_hooks +mkdir -p ${HOOK_DIR} +cat <<EOF >"${HOOK_DIR}/pre-new" +#!/bin/sh +echo foo +EOF +output=`notmuch new 2>&1` +test_expect_code 1 "notmuch new" + +test_begin_subtest "hook execution failure" +rm_hooks +mkdir -p ${HOOK_DIR} +cat <<EOF >"${HOOK_DIR}/pre-new" +no hashbang, execl fails +EOF +chmod +x "${HOOK_DIR}/pre-new" +test_expect_code 1 "notmuch new" + +test_done diff --git a/test/T410-argument-parsing.sh b/test/T410-argument-parsing.sh new file mode 100755 index 00000000..b31d239a --- /dev/null +++ b/test/T410-argument-parsing.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env bash +test_description="argument parsing" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "sanity check" +$TEST_DIRECTORY/arg-test pos1 --keyword=one --boolean --string=foo pos2 --int=7 --flag=one --flag=three > OUTPUT +cat <<EOF > EXPECTED +boolean 1 +keyword 1 +flags 5 +int 7 +string foo +positional arg 1 pos1 +positional arg 2 pos2 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "sanity check zero values" +$TEST_DIRECTORY/arg-test --keyword=zero --boolean=false --int=0 > OUTPUT +cat <<EOF > EXPECTED +boolean 0 +keyword 0 +int 0 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "space instead of = between parameter name and value" +# Note: spaces aren't allowed for booleans. false turns into a positional arg! +$TEST_DIRECTORY/arg-test --keyword one --boolean false --string foo --int 7 --flag one --flag three > OUTPUT +cat <<EOF > EXPECTED +boolean 1 +keyword 1 +flags 5 +int 7 +string foo +positional arg 1 false +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--boolean=true" +$TEST_DIRECTORY/arg-test --boolean=true > OUTPUT +cat <<EOF > EXPECTED +boolean 1 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--boolean=false" +$TEST_DIRECTORY/arg-test --boolean=false > OUTPUT +cat <<EOF > EXPECTED +boolean 0 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--no-boolean" +$TEST_DIRECTORY/arg-test --no-boolean > OUTPUT +cat <<EOF > EXPECTED +boolean 0 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--no-flag" +$TEST_DIRECTORY/arg-test --flag=one --flag=three --no-flag=three > OUTPUT +cat <<EOF > EXPECTED +flags 1 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "test keyword arguments without value" +$TEST_DIRECTORY/arg-test --boolkeyword bananas > OUTPUT +cat <<EOF > EXPECTED +boolkeyword 1 +positional arg 1 bananas +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "test keyword arguments with non-default value separated by a space" +$TEST_DIRECTORY/arg-test --boolkeyword false bananas > OUTPUT +cat <<EOF > EXPECTED +boolkeyword 0 +positional arg 1 bananas +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "test keyword arguments without value at the end" +$TEST_DIRECTORY/arg-test bananas --boolkeyword > OUTPUT +cat <<EOF > EXPECTED +boolkeyword 1 +positional arg 1 bananas +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "test keyword arguments without value but with = (should be an error)" +$TEST_DIRECTORY/arg-test bananas --boolkeyword= > OUTPUT 2>&1 +cat <<EOF > EXPECTED +Unknown keyword argument "" for option "boolkeyword". +Unrecognized option: --boolkeyword= +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T420-emacs-test-functions.sh b/test/T420-emacs-test-functions.sh new file mode 100755 index 00000000..bfc10be3 --- /dev/null +++ b/test/T420-emacs-test-functions.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +test_description="emacs test function sanity" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "emacs test function sanity" +test_emacs_expect_t 't' + +test_done diff --git a/test/T430-emacs-address-cleaning.sh b/test/T430-emacs-address-cleaning.sh new file mode 100755 index 00000000..02d3b411 --- /dev/null +++ b/test/T430-emacs-address-cleaning.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +test_description="emacs address cleaning" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "notmuch-test-address-clean part 1" +test_emacs_expect_t '(notmuch-test-address-cleaning-1)' + +test_begin_subtest "notmuch-test-address-clean part 2" +test_emacs_expect_t '(notmuch-test-address-cleaning-2)' + +test_begin_subtest "notmuch-test-address-clean part 3" +test_emacs_expect_t '(notmuch-test-address-cleaning-3)' + +test_done diff --git a/test/T440-emacs-hello.sh b/test/T440-emacs-hello.sh new file mode 100755 index 00000000..d23c1fca --- /dev/null +++ b/test/T440-emacs-hello.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash + +test_description="emacs notmuch-hello view" +. $(dirname "$0")/test-lib.sh || exit 1 + +EXPECTED=$NOTMUCH_SRCDIR/test/emacs.expected-output + +add_email_corpus + +test_begin_subtest "User-defined section with inbox tag" +test_emacs "(let ((notmuch-hello-sections + (list (lambda () (notmuch-hello-insert-searches + \"Test\" '((\"inbox\" . \"tag:inbox\"))))))) + (notmuch-hello) + (test-output))" +test_expect_equal_file $EXPECTED/notmuch-hello-new-section OUTPUT + +test_begin_subtest "User-defined section with empty, hidden entry" +test_emacs "(let ((notmuch-hello-sections + (list (lambda () (notmuch-hello-insert-searches + \"Test-with-empty\" + '((\"inbox\" . \"tag:inbox\") + (\"doesnotexist\" . \"tag:doesnotexist\")) + :hide-empty-searches t))))) + (notmuch-hello) + (test-output))" +test_expect_equal_file $EXPECTED/notmuch-hello-section-with-empty OUTPUT + +test_begin_subtest "User-defined section, unread tag filtered out" +test_emacs "(let ((notmuch-hello-sections + (list (lambda () (notmuch-hello-insert-tags-section + \"Test-with-filtered\" + :hide-tags '(\"unread\")))))) + (notmuch-hello) + (test-output))" +test_expect_equal_file $EXPECTED/notmuch-hello-section-hidden-tag OUTPUT + +test_begin_subtest "User-defined section, different query for counts" +test_emacs "(let ((notmuch-hello-sections + (list (lambda () (notmuch-hello-insert-tags-section + \"Test-with-counts\" + :filter-count \"tag:signed\"))))) + (notmuch-hello) + (test-output))" +test_expect_equal_file $EXPECTED/notmuch-hello-section-counts OUTPUT + +test_begin_subtest "Empty custom tags section" +test_emacs "(let* ((widget (widget-create 'notmuch-hello-tags-section)) + (notmuch-hello-sections (list (widget-value widget)))) + (notmuch-hello) + (test-output))" +test_expect_equal_file $EXPECTED/notmuch-hello-empty-custom-tags-section OUTPUT + +test_begin_subtest "Empty custom queries section" +test_emacs "(let* ((widget (widget-create 'notmuch-hello-query-section)) + (notmuch-hello-sections (list (widget-value widget)))) + (notmuch-hello) + (test-output))" +test_expect_equal_file $EXPECTED/notmuch-hello-empty-custom-queries-section OUTPUT + +test_begin_subtest "Column alignment for tag/queries with long names" +tag=a-very-long-tag # length carefully calculated for 80 characters window width +notmuch tag +$tag '*' +test_emacs '(notmuch-hello) + (test-output)' +notmuch tag -$tag '*' +test_expect_equal_file $EXPECTED/notmuch-hello-long-names OUTPUT + +test_done diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh new file mode 100755 index 00000000..3555a939 --- /dev/null +++ b/test/T450-emacs-show.sh @@ -0,0 +1,211 @@ +#!/usr/bin/env bash + +test_description="emacs notmuch-show view" +. $(dirname "$0")/test-lib.sh || exit 1 + +EXPECTED=$NOTMUCH_SRCDIR/test/emacs-show.expected-output + +add_email_corpus + +test_begin_subtest "Hiding Original Message region at beginning of a message" +message_id='OriginalMessageHiding.1@notmuchmail.org' +add_message \ + [id]="$message_id" \ + '[subject]="Hiding Original Message region at beginning of a message"' \ + '[body]="-----Original Message----- +Text here."' + +cat <<EOF >EXPECTED +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox) +Subject: Hiding Original Message region at beginning of a message +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: GENERATED_DATE + +[ 2-line hidden original message. Click/Enter to show. ] +EOF + +test_emacs "(notmuch-show \"id:$message_id\") + (test-visible-output \"OUTPUT.raw\")" +notmuch_date_sanitize < OUTPUT.raw > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Bare subject #1" +output=$(test_emacs '(notmuch-show-strip-re "Re: subject")') +test_expect_equal "$output" '"subject"' + +test_begin_subtest "Bare subject #2" +output=$(test_emacs '(notmuch-show-strip-re "re:Re: re: Re: re:subject")') +test_expect_equal "$output" '"subject"' + +test_begin_subtest "Bare subject #3" +output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")') +test_expect_equal "$output" '"the cure: fix the regexp"' + +test_begin_subtest "don't process cryptographic MIME parts" +test_emacs '(let ((notmuch-crypto-process-mime nil)) + (notmuch-show "id:20091117203301.GV3165@dottiness.seas.harvard.edu") + (test-visible-output))' +test_expect_equal_file $EXPECTED/notmuch-show-process-crypto-mime-parts-off OUTPUT + +test_begin_subtest "process cryptographic MIME parts" +test_emacs '(let ((notmuch-crypto-process-mime t)) + (notmuch-show "id:20091117203301.GV3165@dottiness.seas.harvard.edu") + (test-visible-output))' +test_expect_equal_file $EXPECTED/notmuch-show-process-crypto-mime-parts-on OUTPUT + +test_begin_subtest "process cryptographic MIME parts (w/ notmuch-show-toggle-process-crypto)" +test_emacs '(let ((notmuch-crypto-process-mime nil)) + (notmuch-show "id:20091117203301.GV3165@dottiness.seas.harvard.edu") + (notmuch-show-toggle-process-crypto) + (test-visible-output))' +test_expect_equal_file $EXPECTED/notmuch-show-process-crypto-mime-parts-on OUTPUT + +test_begin_subtest "notmuch-show: don't elide non-matching messages" +test_emacs '(let ((notmuch-show-only-matching-messages nil)) + (notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"") + (notmuch-test-wait) + (notmuch-search-show-thread) + (notmuch-test-wait) + (test-visible-output))' +test_expect_equal_file $EXPECTED/notmuch-show-elide-non-matching-messages-off OUTPUT + +test_begin_subtest "notmuch-show: elide non-matching messages" +test_emacs '(let ((notmuch-show-only-matching-messages t)) + (notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"") + (notmuch-test-wait) + (notmuch-search-show-thread) + (notmuch-test-wait) + (test-visible-output))' +test_expect_equal_file $EXPECTED/notmuch-show-elide-non-matching-messages-on OUTPUT + +test_begin_subtest "notmuch-show: elide non-matching messages (w/ notmuch-show-toggle-elide-non-matching)" +test_emacs '(let ((notmuch-show-only-matching-messages nil)) + (notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"") + (notmuch-test-wait) + (notmuch-search-show-thread) + (notmuch-test-wait) + (notmuch-show-toggle-elide-non-matching) + (test-visible-output))' +test_expect_equal_file $EXPECTED/notmuch-show-elide-non-matching-messages-on OUTPUT + +test_begin_subtest "notmuch-show: elide non-matching messages (w/ prefix arg to notmuch-show)" +test_emacs '(let ((notmuch-show-only-matching-messages nil)) + (notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"") + (notmuch-test-wait) + (notmuch-search-show-thread t) + (notmuch-test-wait) + (test-visible-output))' +test_expect_equal_file $EXPECTED/notmuch-show-elide-non-matching-messages-on OUTPUT + +test_begin_subtest "notmuch-show: disable indentation of thread content (w/ notmuch-show-toggle-thread-indentation)" +test_emacs '(notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"") + (notmuch-test-wait) + (notmuch-search-show-thread) + (notmuch-test-wait) + (notmuch-show-toggle-thread-indentation) + (test-visible-output)' +test_expect_equal_file $EXPECTED/notmuch-show-indent-thread-content-off OUTPUT + +test_begin_subtest "id buttonization" +add_message '[body]=" +id:abc +id:abc.def. id:abc,def, id:abc;def; id:abc:def: +id:foo@bar.?baz? id:foo@bar!.baz! +(id:foo@bar.baz) [id:foo@bar.baz] +id:foo@bar.baz... +id:2+2=5 +id:=_-:/.[]@$%+ +id:abc)def +id:ab\"c def +id:\"abc\"def +id:\"ab\"\"c\"def +id:\"ab c\"def +id:\"abc\".def +id:\"abc +\" +id:) +id: +cid:xxx +mid:abc mid:abc/def +mid:abc%20def +mid:abc. mid:abc, mid:abc;"' +test_emacs '(notmuch-show "id:'$gen_msg_id'") + (notmuch-test-mark-links) + (test-visible-output "OUTPUT.raw")' +cat <<EOF >EXPECTED +Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox) +Subject: id buttonization +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: GENERATED_DATE + +<<id:abc>> +<<id:abc.def>>. <<id:abc,def>>, <<id:abc;def>>; <<id:abc:def>>: +<<id:foo@bar.?baz>>? <<id:foo@bar!.baz>>! +(<<id:foo@bar.baz>>) [<<id:foo@bar.baz>>] +<<id:foo@bar.baz>>... +<<id:2+2=5>> +<<id:=_-:/.[]@$%+>> +<<id:abc>>)def +<<id:ab"c>> def +<<id:"abc">>def +<<id:"ab""c">>def +<<id:"ab c">>def +<<id:"abc">>.def +id:"abc +" +id:) +id: +cid:xxx +<<mid:abc>> <<mid:abc/def>> +<<mid:abc%20def>> +<<mid:abc>>. <<mid:abc>>, <<mid:abc>>; +EOF +notmuch_date_sanitize < OUTPUT.raw > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + + +test_begin_subtest "Show handles subprocess errors" +cat > notmuch_fail <<EOF +#!/bin/sh +echo This is output +echo This is an error >&2 +exit 1 +EOF +chmod a+x notmuch_fail +test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\")) + (with-current-buffer \"*Messages*\" + (let ((inhibit-read-only t)) (erase-buffer))) + (condition-case err + (notmuch-show \"*\") + (error (message \"%s\" (second err)))) + (notmuch-test-wait) + (with-current-buffer \"*Messages*\" + (test-output \"MESSAGES\")) + (with-current-buffer \"*Notmuch errors*\" + (test-output \"ERROR\")) + (test-output))" +test_expect_equal "$(notmuch_emacs_error_sanitize notmuch_fail OUTPUT MESSAGES ERROR)" "\ +=== OUTPUT === +=== MESSAGES === +This is an error (see *Notmuch errors* for more details) +=== ERROR === +[XXX] +This is an error +command: YYY/notmuch_fail show --format\\=sexp --format-version\\=4 --decrypt\\=true --exclude\\=false \\' \\* \\' +exit status: 1 +stderr: +This is an error +stdout: +This is output" + +test_begin_subtest "text/enriched exploit mitigation" +add_message '[content-type]="text/enriched" + [body]=" +<x-display><param>(when (progn (read-only-mode -1) (insert ?p ?0 ?w ?n ?e ?d)) nil)</param>test</x-display> +"' +test_emacs '(notmuch-show "id:'$gen_msg_id'") + (test-visible-output "OUTPUT.raw")' +output=$(head -1 OUTPUT.raw|cut -f1-4 -d' ') +test_expect_equal "$output" "Notmuch Test Suite <test_suite@notmuchmail.org>" + +test_done diff --git a/test/T455-emacs-charsets.sh b/test/T455-emacs-charsets.sh new file mode 100755 index 00000000..cb1297ca --- /dev/null +++ b/test/T455-emacs-charsets.sh @@ -0,0 +1,140 @@ +#!/usr/bin/env bash + +test_description="emacs notmuch-show charset handling" +. $(dirname "$0")/test-lib.sh || exit 1 + + +UTF8_YEN=$'\xef\xbf\xa5' +BIG5_YEN=$'\xa2\x44' + +# Add four messages with unusual encoding requirements: +# +# 1) text/plain in quoted-printable big5 +generate_message \ + [id]=test-plain@example.com \ + '[content-type]="text/plain; charset=big5"' \ + '[content-transfer-encoding]=quoted-printable' \ + '[body]="Yen: =A2=44"' + +# 2) text/plain in 8bit big5 +generate_message \ + [id]=test-plain-8bit@example.com \ + '[content-type]="text/plain; charset=big5"' \ + '[content-transfer-encoding]=8bit' \ + '[body]="Yen: '$BIG5_YEN'"' + +# 3) text/html in quoted-printable big5 +generate_message \ + [id]=test-html@example.com \ + '[content-type]="text/html; charset=big5"' \ + '[content-transfer-encoding]=quoted-printable' \ + '[body]="<html><body>Yen: =A2=44</body></html>"' + +# 4) application/octet-stream in quoted-printable of big5 text +generate_message \ + [id]=test-binary@example.com \ + '[content-type]="application/octet-stream"' \ + '[content-transfer-encoding]=quoted-printable' \ + '[body]="Yen: =A2=44"' + +notmuch new > /dev/null + +# Test rendering + +test_begin_subtest "Text parts are decoded when rendering" +test_emacs '(notmuch-show "id:test-plain@example.com") + (test-visible-output "OUTPUT.raw")' +awk 'show {print} /^$/ {show=1}' < OUTPUT.raw > OUTPUT +cat <<EOF >EXPECTED +Yen: $UTF8_YEN +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "8bit text parts are decoded when rendering" +test_emacs '(notmuch-show "id:test-plain-8bit@example.com") + (test-visible-output "OUTPUT.raw")' +awk 'show {print} /^$/ {show=1}' < OUTPUT.raw > OUTPUT +cat <<EOF >EXPECTED +Yen: $UTF8_YEN +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "HTML parts are decoded when rendering" +test_emacs '(notmuch-show "id:test-html@example.com") + (test-visible-output "OUTPUT.raw")' +awk 'show {print} /^$/ {show=1}' < OUTPUT.raw > OUTPUT +cat <<EOF >EXPECTED +[ text/html ] +Yen: $UTF8_YEN +EOF +test_expect_equal_file EXPECTED OUTPUT + +# Test saving + +test_begin_subtest "Text parts are not decoded when saving" +rm -f part +test_emacs '(notmuch-show "id:test-plain@example.com") + (search-forward "Yen") + (let ((standard-input "\"part\"")) + (notmuch-show-save-part))' +cat <<EOF >EXPECTED +Yen: $BIG5_YEN +EOF +test_expect_equal_file part EXPECTED + +test_begin_subtest "8bit text parts are not decoded when saving" +rm -f part +test_emacs '(notmuch-show "id:test-plain-8bit@example.com") + (search-forward "Yen") + (let ((standard-input "\"part\"")) + (notmuch-show-save-part))' +cat <<EOF >EXPECTED +Yen: $BIG5_YEN +EOF +test_expect_equal_file part EXPECTED + +test_begin_subtest "HTML parts are not decoded when saving" +rm -f part +test_emacs '(notmuch-show "id:test-html@example.com") + (search-forward "Yen") + (let ((standard-input "\"part\"")) + (notmuch-show-save-part))' +cat <<EOF >EXPECTED +<html><body>Yen: $BIG5_YEN</body></html> +EOF +test_expect_equal_file part EXPECTED + +test_begin_subtest "Binary parts are not decoded when saving" +rm -f part +test_emacs '(notmuch-show "id:test-binary@example.com") + (search-forward "application/") + (let ((standard-input "\"part\"")) + (notmuch-show-save-part))' +cat <<EOF >EXPECTED +Yen: $BIG5_YEN +EOF +test_expect_equal_file part EXPECTED + +# Test message viewing + +test_begin_subtest "Text message are not decoded when viewing" +test_emacs '(notmuch-show "id:test-plain@example.com") + (notmuch-show-view-raw-message) + (test-visible-output "OUTPUT.raw")' +awk 'show {print} /^$/ {show=1}' < OUTPUT.raw > OUTPUT +cat <<EOF >EXPECTED +Yen: =A2=44 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "8bit text message are not decoded when viewing" +test_emacs '(notmuch-show "id:test-plain-8bit@example.com") + (notmuch-show-view-raw-message) + (test-visible-output "OUTPUT.raw")' +awk 'show {print} /^$/ {show=1}' < OUTPUT.raw > OUTPUT +cat <<EOF >EXPECTED +Yen: $BIG5_YEN +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T460-emacs-tree.sh b/test/T460-emacs-tree.sh new file mode 100755 index 00000000..cb2c90b8 --- /dev/null +++ b/test/T460-emacs-tree.sh @@ -0,0 +1,180 @@ +#!/usr/bin/env bash + +test_description="emacs tree view interface" +. $(dirname "$0")/test-lib.sh || exit 1 + +EXPECTED=$NOTMUCH_SRCDIR/test/emacs-tree.expected-output + +add_email_corpus + +test_begin_subtest "Basic notmuch-tree view in emacs" +test_emacs '(notmuch-tree "tag:inbox") + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox OUTPUT + +test_begin_subtest "Refreshed notmuch-tree view in emacs" +test_emacs '(notmuch-tree "tag:inbox") + (notmuch-test-wait) + (notmuch-tree-refresh-view) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox OUTPUT + +# In the following tag tests we make sure the display is updated +# correctly and, in a separate test, that the database is updated +# correctly. + +test_begin_subtest "Tag message in notmuch tree view (display)" +test_emacs '(notmuch-tree "tag:inbox") + (notmuch-test-wait) + (forward-line) + (notmuch-tree-tag (list "+test_tag")) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox-tagged OUTPUT + +test_begin_subtest "Tag message in notmuch tree view (database)" +output=$(notmuch search --output=messages 'tag:test_tag') +test_expect_equal "$output" "id:877h1wv7mg.fsf@inf-8657.int-evry.fr" + +test_begin_subtest "Untag message in notmuch tree view" +test_emacs '(notmuch-tree "tag:inbox") + (notmuch-test-wait) + (forward-line) + (notmuch-tree-tag (list "-test_tag")) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox OUTPUT + +test_begin_subtest "Untag message in notmuch tree view (database)" +output=$(notmuch search --output=messages 'tag:test_tag') +test_expect_equal "$output" "" + +test_begin_subtest "Tag thread in notmuch tree view" +test_emacs '(notmuch-tree "tag:inbox") + (notmuch-test-wait) + ;; move to a sizable thread + (forward-line 26) + (notmuch-tree-tag-thread (list "+test_thread_tag")) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox-thread-tagged OUTPUT + +test_begin_subtest "Tag message in notmuch tree view (database)" +output=$(notmuch search --output=messages 'tag:test_thread_tag') +test_expect_equal "$output" \ +"id:87ocn0qh6d.fsf@yoom.home.cworth.org +id:20091118005040.GA25380@dottiness.seas.harvard.edu +id:yunaayketfm.fsf@aiko.keithp.com +id:87fx8can9z.fsf@vertex.dottedmag +id:20091117203301.GV3165@dottiness.seas.harvard.edu +id:87iqd9rn3l.fsf@vertex.dottedmag +id:20091117190054.GU3165@dottiness.seas.harvard.edu" + +test_begin_subtest "Untag thread in notmuch tree view" +test_emacs '(notmuch-tree "tag:inbox") + (notmuch-test-wait) + ;; move to the same sizable thread as above + (forward-line 26) + (notmuch-tree-tag-thread (list "-test_thread_tag")) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox OUTPUT + +test_begin_subtest "Untag message in notmuch tree view (database)" +output=$(notmuch search --output=messages 'tag:test_thread_tag') +test_expect_equal "$output" "" + +test_begin_subtest "Navigation of notmuch-hello to search results" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-tree-from-search-current-query) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox OUTPUT + +test_begin_subtest "Tree view of a single thread (from search)" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-tree-from-search-thread) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-single-thread OUTPUT + +test_begin_subtest "Tree view of a single thread (from show)" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-search-show-thread) + (notmuch-tree-from-show-current-query) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-single-thread OUTPUT + +test_begin_subtest "Message window of tree view" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-search-next-thread) + (notmuch-tree-from-search-thread) + (notmuch-test-wait) + (select-window notmuch-tree-message-window) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-show-window OUTPUT + +test_begin_subtest "Stash id" +output=$(test_emacs '(notmuch-tree "id:1258498485-sup-142@elly") + (notmuch-test-wait) + (notmuch-show-stash-message-id)') +test_expect_equal "$output" "\"Stashed: id:1258498485-sup-142@elly\"" + +test_begin_subtest "Move to next matching message" +output=$(test_emacs '(notmuch-tree "from:cworth") + (notmuch-test-wait) + (notmuch-tree-next-matching-message) + (notmuch-show-stash-message-id)') +test_expect_equal "$output" "\"Stashed: id:878we4qdqf.fsf@yoom.home.cworth.org\"" + +test_begin_subtest "Move to next thread" +output=$(test_emacs '(notmuch-tree "tag:inbox") + (notmuch-test-wait) + (forward-line 26) + (notmuch-tree-next-thread) + (notmuch-show-stash-message-id)') +test_expect_equal "$output" "\"Stashed: id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net\"" + +test_begin_subtest "Move to previous thread" +output=$(test_emacs '(notmuch-tree "tag:inbox") + (notmuch-test-wait) + (forward-line 26) + (notmuch-tree-prev-thread) + (notmuch-show-stash-message-id)') +test_expect_equal "$output" "\"Stashed: id:20091117190054.GU3165@dottiness.seas.harvard.edu\"" + +test_begin_subtest "Move to previous previous thread" +output=$(test_emacs '(notmuch-tree "tag:inbox") + (notmuch-test-wait) + (forward-line 26) + (notmuch-tree-prev-thread) + (notmuch-tree-prev-thread) + (notmuch-show-stash-message-id)') +test_expect_equal "$output" "\"Stashed: id:1258493565-13508-1-git-send-email-keithp@keithp.com\"" + +test_done diff --git a/test/T470-missing-headers.sh b/test/T470-missing-headers.sh new file mode 100755 index 00000000..555fd4e9 --- /dev/null +++ b/test/T470-missing-headers.sh @@ -0,0 +1,164 @@ +#!/usr/bin/env bash +test_description='messages with missing headers' +. $(dirname "$0")/test-lib.sh || exit 1 + +# Notmuch requires at least one of from, subject, or to or it will +# ignore the file. Generate two messages so that together they cover +# all possible missing headers. We also give one of the messages a +# date to ensure stable result ordering. + +cat <<EOF > "${MAIL_DIR}/msg-2" +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Fri, 05 Jan 2001 15:43:57 +0000 + +Body +EOF + +cat <<EOF > "${MAIL_DIR}/msg-1" +From: Notmuch Test Suite <test_suite@notmuchmail.org> + +Body +EOF + +NOTMUCH_NEW >/dev/null + +test_begin_subtest "Search: text" +output=$(notmuch search '*' | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] ; (inbox unread) +thread:XXX 1970-01-01 [1/1] Notmuch Test Suite; (inbox unread)" + +test_begin_subtest "Search: json" +output=$(notmuch search --format=json '*' | notmuch_search_sanitize) +test_expect_equal_json "$output" ' +[ + { + "authors": "", + "date_relative": "2001-01-05", + "matched": 1, + "subject": "", + "tags": [ + "inbox", + "unread" + ], + "thread": "XXX", + "timestamp": 978709437, + "total": 1, + "query": ["id:notmuch-sha1-7a6e4eac383ef958fcd3ebf2143db71b8ff01161", null] + }, + { + "authors": "Notmuch Test Suite", + "date_relative": "1970-01-01", + "matched": 1, + "subject": "", + "tags": [ + "inbox", + "unread" + ], + "thread": "XXX", + "timestamp": 0, + "total": 1, + "query": ["id:notmuch-sha1-ca55943aff7a72baf2ab21fa74fab3d632401334", null] + } +]' + +test_begin_subtest "Show: text" +output=$(notmuch show '*' | notmuch_show_sanitize) +test_expect_equal "$output" "\ +message{ id:notmuch-sha1-7a6e4eac383ef958fcd3ebf2143db71b8ff01161 depth:0 match:1 excluded:0 filename:/XXX/mail/msg-2 +header{ + (2001-01-05) (inbox unread) +Subject: (null) +From: (null) +To: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Fri, 05 Jan 2001 15:43:57 +0000 +header} +body{ +part{ ID: 1, Content-type: text/plain +Body +part} +body} +message} +message{ id:notmuch-sha1-ca55943aff7a72baf2ab21fa74fab3d632401334 depth:0 match:1 excluded:0 filename:/XXX/mail/msg-1 +header{ +Notmuch Test Suite <test_suite@notmuchmail.org> (1970-01-01) (inbox unread) +Subject: (null) +From: Notmuch Test Suite <test_suite@notmuchmail.org> +Date: Thu, 01 Jan 1970 00:00:00 +0000 +header} +body{ +part{ ID: 1, Content-type: text/plain +Body +part} +body} +message}" + +test_begin_subtest "Show: json" +output=$(notmuch show --format=json '*' | notmuch_json_show_sanitize) +expected=$(notmuch_json_show_sanitize <<EOF +[ + [ + [ + { + "body": [ + { + "content": "Body\n", + "content-type": "text/plain", + "id": 1 + } + ], + "date_relative": "2001-01-05", + "excluded": false, + "filename": ["YYYYY"], + "headers": { + "Date": "Fri, 05 Jan 2001 15:43:57 +0000", + "From": "", + "Subject": "", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>" + }, + "id": "XXXXX", + "match": true, + "tags": [ + "inbox", + "unread" + ], + "timestamp": 978709437 + }, + [] + ] + ], + [ + [ + { + "body": [ + { + "content": "Body\n", + "content-type": "text/plain", + "id": 1 + } + ], + "date_relative": "1970-01-01", + "excluded": false, + "filename": ["YYYYY"], + "headers": { + "Date": "Thu, 01 Jan 1970 00:00:00 +0000", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Subject": "" + }, + "id": "XXXXX", + "match": true, + "tags": [ + "inbox", + "unread" + ], + "timestamp": 0 + }, + [] + ] + ] +] +EOF +) +test_expect_equal_json "$output" "$expected" + +test_done diff --git a/test/T480-hex-escaping.sh b/test/T480-hex-escaping.sh new file mode 100755 index 00000000..2c5bbb63 --- /dev/null +++ b/test/T480-hex-escaping.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +test_description="hex encoding and decoding" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "round trip" +find $NOTMUCH_SRCDIR/test/corpora/default -type f -print | sort | xargs cat > EXPECTED +$TEST_DIRECTORY/hex-xcode --direction=encode < EXPECTED | $TEST_DIRECTORY/hex-xcode --direction=decode > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "punctuation" +tag1='comic_swear=$&^%$^%\\//-+$^%$' +tag_enc1=$($TEST_DIRECTORY/hex-xcode --direction=encode "$tag1") +test_expect_equal "$tag_enc1" "comic_swear=%24%26%5e%25%24%5e%25%5c%5c%2f%2f-+%24%5e%25%24" + +test_begin_subtest "round trip newlines" +printf 'this\n tag\t has\n spaces\n' > EXPECTED.$test_count +$TEST_DIRECTORY/hex-xcode --direction=encode < EXPECTED.$test_count |\ + $TEST_DIRECTORY/hex-xcode --direction=decode > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest "round trip 8bit chars" +echo '%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a' > EXPECTED.$test_count +$TEST_DIRECTORY/hex-xcode --direction=decode < EXPECTED.$test_count |\ + $TEST_DIRECTORY/hex-xcode --direction=encode > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest "round trip (in-place)" +find $NOTMUCH_SRCDIR/test/corpora/default -type f -print | sort | xargs cat > EXPECTED +$TEST_DIRECTORY/hex-xcode --in-place --direction=encode < EXPECTED |\ + $TEST_DIRECTORY/hex-xcode --in-place --direction=decode > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "punctuation (in-place)" +tag1='comic_swear=$&^%$^%\\//-+$^%$' +tag_enc1=$($TEST_DIRECTORY/hex-xcode --in-place --direction=encode "$tag1") +test_expect_equal "$tag_enc1" "comic_swear=%24%26%5e%25%24%5e%25%5c%5c%2f%2f-+%24%5e%25%24" + +test_begin_subtest "round trip newlines (in-place)" +printf 'this\n tag\t has\n spaces\n' > EXPECTED.$test_count +$TEST_DIRECTORY/hex-xcode --in-place --direction=encode < EXPECTED.$test_count |\ + $TEST_DIRECTORY/hex-xcode --in-place --direction=decode > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_begin_subtest "round trip 8bit chars (in-place)" +echo '%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a' > EXPECTED.$test_count +$TEST_DIRECTORY/hex-xcode --in-place --direction=decode < EXPECTED.$test_count |\ + $TEST_DIRECTORY/hex-xcode --in-place --direction=encode > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +test_done diff --git a/test/T490-parse-time-string.sh b/test/T490-parse-time-string.sh new file mode 100755 index 00000000..d1c70cfa --- /dev/null +++ b/test/T490-parse-time-string.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash +test_description="date/time parser module" +. $(dirname "$0")/test-lib.sh || exit 1 + +# Sanity/smoke tests for the date/time parser independent of notmuch + +_date () +{ + date -d "$*" +%s +} + +_parse_time () +{ + ${TEST_DIRECTORY}/parse-time --format=%s "$*" +} + +test_begin_subtest "date(1) default format without TZ code" +test_expect_equal "$(_parse_time Fri Aug 3 23:06:06 2012)" "$(_date Fri Aug 3 23:06:06 2012)" + +test_begin_subtest "date(1) --rfc-2822 format" +test_expect_equal "$(_parse_time Fri, 03 Aug 2012 23:07:46 +0100)" "$(_date Fri, 03 Aug 2012 23:07:46 +0100)" + +test_begin_subtest "date(1) --rfc=3339=seconds format" +test_expect_equal "$(_parse_time 2012-08-03 23:09:37+03:00)" "$(_date 2012-08-03 23:09:37+03:00)" + +test_begin_subtest "Date parser tests" +REFERENCE=$(_date Tue Jan 11 12:13:14 +0000 2011) +cat <<EOF > INPUT +now ==> Tue Jan 11 12:13:14 +0000 2011 +2010-1-1 ==> ERROR: DATEFORMAT +Jan 2 ==> Sun Jan 02 12:13:14 +0000 2011 +Mon ==> Mon Jan 10 12:13:14 +0000 2011 +last Friday ==> ERROR: FORMAT +2 hours ago ==> Tue Jan 11 10:13:14 +0000 2011 +last month ==> Sat Dec 11 12:13:14 +0000 2010 +month ago ==> Sat Dec 11 12:13:14 +0000 2010 +two mo ==> Thu Nov 11 12:13:14 +0000 2010 +3M ==> Mon Oct 11 12:13:14 +0000 2010 +4-mont ==> Sat Sep 11 12:13:14 +0000 2010 +5m ==> Tue Jan 11 12:08:14 +0000 2011 +dozen mi ==> Tue Jan 11 12:01:14 +0000 2011 +8am ==> Tue Jan 11 08:00:00 +0000 2011 +monday ==> Mon Jan 10 12:13:14 +0000 2011 +yesterday ==> Mon Jan 10 12:13:14 +0000 2011 +tomorrow ==> ERROR: KEYWORD + ==> Tue Jan 11 12:13:14 +0000 2011 # empty string is reference time + +Aug 3 23:06:06 2012 ==> Fri Aug 03 23:06:06 +0000 2012 # date(1) default format without TZ code +Fri, 03 Aug 2012 23:07:46 +0100 ==> Fri Aug 03 22:07:46 +0000 2012 # rfc-2822 +2012-08-03 23:09:37+03:00 ==> Fri Aug 03 20:09:37 +0000 2012 # rfc-3339 seconds + +10:30:40 ==> Tue Jan 11 10:30:40 +0000 2011 +10:30:40 ==^> Tue Jan 11 10:30:40 +0000 2011 +10:30:40 ==^^> Tue Jan 11 10:30:40 +0000 2011 +10:30:40 ==_> Tue Jan 11 10:30:40 +0000 2011 + +10s ==> Tue Jan 11 12:13:04 +0000 2011 +19701223s ==> Fri May 28 11:39:31 +0000 2010 +19701223 ==> Wed Dec 23 12:13:14 +0000 1970 + +19701223 +0100 ==> Wed Dec 23 12:13:14 +0000 1970 # Timezone is ignored without an error + +today ==^^> Wed Jan 12 00:00:00 +0000 2011 +today ==^> Tue Jan 11 23:59:59 +0000 2011 +today ==_> Tue Jan 11 00:00:00 +0000 2011 + +this week ==^^> Sun Jan 16 00:00:00 +0000 2011 +this week ==^> Sat Jan 15 23:59:59 +0000 2011 +this week ==_> Sun Jan 09 00:00:00 +0000 2011 + +two months ago ==> Thu Nov 11 12:13:14 +0000 2010 +two months ==> Thu Nov 11 12:13:14 +0000 2010 + +@1348569850 ==> Tue Sep 25 10:44:10 +0000 2012 +@10 ==> Thu Jan 01 00:00:10 +0000 1970 +EOF + +${TEST_DIRECTORY}/parse-time --ref=${REFERENCE} < INPUT > OUTPUT +test_expect_equal_file INPUT OUTPUT + +test_begin_subtest "Second rounding tests" +REFERENCE=$(_date Tue Jan 11 12:13:14 +0000 2011) +cat <<EOF > INPUT +9:15 ==> Tue Jan 11 09:15:14 +0000 2011 +12:34 ==> Tue Jan 11 12:34:14 +0000 2011 +10:30 ==> Tue Jan 11 10:30:14 +0000 2011 +10:30 ==^> Tue Jan 11 10:30:59 +0000 2011 +10:30 ==^^> Tue Jan 11 10:31:00 +0000 2011 +10:30 ==_> Tue Jan 11 10:30:00 +0000 2011 +EOF +${TEST_DIRECTORY}/parse-time --ref=${REFERENCE} < INPUT > OUTPUT +test_expect_equal_file INPUT OUTPUT + +test_done diff --git a/test/T500-search-date.sh b/test/T500-search-date.sh new file mode 100755 index 00000000..f84b0962 --- /dev/null +++ b/test/T500-search-date.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +test_description="date:since..until queries" +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +test_begin_subtest "Absolute date range" +output=$(notmuch search date:2010-12-16..12/16/2010 | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2010-12-16 [1/1] Olivier Berger; Essai accentué (inbox unread)" + +test_begin_subtest "Absolute date range with 'same' operator" +output=$(notmuch search date:2010-12-16..! | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2010-12-16 [1/1] Olivier Berger; Essai accentué (inbox unread)" + +test_begin_subtest "Absolute date field" +output=$(notmuch search date:2010-12-16 | notmuch_search_sanitize) +if [ $NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR -ne 1 ]; then + test_subtest_known_broken +fi +test_expect_equal "$output" "thread:XXX 2010-12-16 [1/1] Olivier Berger; Essai accentué (inbox unread)" + +test_begin_subtest "Absolute time range with TZ" +notmuch search date:18-Nov-2009_02:19:26-0800..2009-11-18_04:49:52-06:00 | notmuch_search_sanitize > OUTPUT +cat <<EOF >EXPECTED +thread:XXX 2009-11-18 [1/3] Carl Worth| Jan Janak; [notmuch] What a great idea! (inbox unread) +thread:XXX 2009-11-18 [1/2] Carl Worth| Jan Janak; [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) +thread:XXX 2009-11-18 [1/3(4)] Carl Worth| Aron Griffis, Keith Packard; [notmuch] archive (inbox unread) +thread:XXX 2009-11-18 [1/2] Carl Worth| Keith Packard; [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T510-thread-replies.sh b/test/T510-thread-replies.sh new file mode 100755 index 00000000..5d6bea7e --- /dev/null +++ b/test/T510-thread-replies.sh @@ -0,0 +1,225 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2013 Aaron Ecay +# + +test_description='test of proper handling of in-reply-to and references headers' + +# This test makes sure that the thread structure in the notmuch +# database is constructed properly, even in the presence of +# non-RFC-compliant headers' + +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Use References when In-Reply-To is broken" +add_message '[id]="foo@one.com"' \ + '[subject]=one' +add_message '[in-reply-to]="mumble"' \ + '[references]="<foo@one.com>"' \ + '[subject]="Re: one"' +output=$(notmuch show --format=json 'subject:one' | notmuch_json_show_sanitize) +expected='[[[{"id": "foo@one.com", + "match": true, + "excluded": false, + "filename": ["YYYYY"], + "timestamp": 978709437, + "date_relative": "2001-01-05", + "tags": ["inbox", "unread"], + "headers": {"Subject": "one", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, + "body": [{"id": 1, + "content-type": "text/plain", + "content": "This is just a test message (#1)\n"}]}, + [[{"id": "msg-002@notmuch-test-suite", + "match": true, "excluded": false, + "filename": ["YYYYY"], + "timestamp": 978709437, "date_relative": "2001-01-05", + "tags": ["inbox", "unread"], "headers": {"Subject": "Re: one", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, + "body": [{"id": 1, "content-type": "text/plain", + "content": "This is just a test message (#2)\n"}]}, []]]]]]' +expected=`echo "$expected" | notmuch_json_show_sanitize` +test_expect_equal_json "$output" "$expected" + +test_begin_subtest "Prefer References to dodgy In-Reply-To" +add_message '[id]="foo@two.com"' \ + '[subject]=two' +add_message '[in-reply-to]="Your message of December 31 1999 <bar@baz.com>"' \ + '[references]="<foo@two.com>"' \ + '[subject]="Re: two"' +output=$(notmuch show --format=json 'subject:two' | notmuch_json_show_sanitize) +expected='[[[{"id": "foo@two.com", + "match": true, "excluded": false, + "filename": ["YYYYY"], + "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox", "unread"], + "headers": {"Subject": "two", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, + "body": [{"id": 1, "content-type": "text/plain", + "content": "This is just a test message (#3)\n"}]}, + [[{"id": "msg-004@notmuch-test-suite", "match": true, "excluded": false, + "filename": ["YYYYY"], + "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox", "unread"], + "headers": {"Subject": "Re: two", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, + "body": [{"id": 1, + "content-type": "text/plain", "content": "This is just a test message (#4)\n"}]}, + []]]]]]' +expected=`echo "$expected" | notmuch_json_show_sanitize` +test_expect_equal_json "$output" "$expected" + +test_begin_subtest "Use In-Reply-To when no References" +add_message '[id]="foo@three.com"' \ + '[subject]="three"' +add_message '[in-reply-to]="<foo@three.com>"' \ + '[subject]="Re: three"' +output=$(notmuch show --format=json 'subject:three' | notmuch_json_show_sanitize) +expected='[[[{"id": "foo@three.com", "match": true, "excluded": false, + "filename": ["YYYYY"], + "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox", "unread"], + "headers": {"Subject": "three", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [{"id": 1, + "content-type": "text/plain", "content": "This is just a test message (#5)\n"}]}, + [[{"id": "msg-006@notmuch-test-suite", "match": true, "excluded": false, + "filename": ["YYYYY"], + "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox", "unread"], + "headers": {"Subject": "Re: three", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [{"id": 1, + "content-type": "text/plain", "content": "This is just a test message (#6)\n"}]}, + []]]]]]' +expected=`echo "$expected" | notmuch_json_show_sanitize` +test_expect_equal_json "$output" "$expected" + +test_begin_subtest "Use last Reference when In-Reply-To is dodgy" +add_message '[id]="foo@four.com"' \ + '[subject]="four"' +add_message '[id]="bar@four.com"' \ + '[subject]="not-four"' +add_message '[in-reply-to]="<baz@four.com> (RFC822 4lyfe)"' \ + '[references]="<baz@four.com> <foo@four.com>"' \ + '[subject]="neither"' +output=$(notmuch show --format=json 'subject:four' | notmuch_json_show_sanitize) +expected='[[[{"id": "foo@four.com", "match": true, "excluded": false, + "filename": ["YYYYY"], + "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox", "unread"], + "headers": {"Subject": "four", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [{"id": 1, + "content-type": "text/plain", "content": "This is just a test message (#7)\n"}]}, + [[{"id": "msg-009@notmuch-test-suite", "match": false, "excluded": false, + "filename": ["YYYYY"], + "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox", "unread"], + "headers": {"Subject": "neither", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [{"id": 1, + "content-type": "text/plain", "content": "This is just a test message (#9)\n"}]}, + []]]]], [[{"id": "bar@four.com", "match": true, "excluded": false, + "filename": ["YYYYY"], + "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox", "unread"], + "headers": {"Subject": "not-four", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [{"id": 1, + "content-type": "text/plain", "content": "This is just a test message (#8)\n"}]}, []]]]' +expected=`echo "$expected" | notmuch_json_show_sanitize` +test_expect_equal_json "$output" "$expected" + +test_begin_subtest "Ignore garbage at the end of References" +add_message '[id]="foo@five.com"' \ + '[subject]="five"' +add_message '[id]="bar@five.com"' \ + '[references]="<foo@five.com> (garbage)"' \ + '[subject]="not-five"' +output=$(notmuch show --format=json 'subject:five' | notmuch_json_show_sanitize) +expected='[[[{"id": "XXXXX", "match": true, "excluded": false, + "filename": ["YYYYY"], "timestamp": 42, "date_relative": "2001-01-05", + "tags": ["inbox", "unread"], "headers": {"Subject": "five", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "GENERATED_DATE"}, "body": [{"id": 1, + "content-type": "text/plain", + "content": "This is just a test message (#10)\n"}]}, + [[{"id": "XXXXX", "match": true, "excluded": false, + "filename": ["YYYYY"], "timestamp": 42, "date_relative": "2001-01-05", + "tags": ["inbox", "unread"], + "headers": {"Subject": "not-five", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "GENERATED_DATE"}, + "body": [{"id": 1, "content-type": "text/plain", + "content": "This is just a test message (#11)\n"}]}, []]]]]]' +expected=`echo "$expected" | notmuch_json_show_sanitize` +test_expect_equal_json "$output" "$expected" + +add_email_corpus threading + +test_begin_subtest "reply to ghost" +notmuch show --entire-thread=true id:000-real-root@example.org | grep ^Subject: | head -1 > OUTPUT +cat <<EOF > EXPECTED +Subject: root message +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "reply to ghost (tree view)" +test_emacs '(notmuch-tree "id:000-real-root@example.org") + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +cat <<EOF > EXPECTED + 2016-06-17 Alice ┬►root message (inbox unread) + 2016-06-18 Alice ╰┬►child message (inbox unread) + 2016-06-17 Mallory ├─►fake root message (inbox unread) + 2016-06-18 Alice ├┬►grand-child message (inbox unread) + 2016-06-18 Alice │╰─►great grand-child message (inbox unread) + 2016-06-18 Daniel ╰─►grand-child message 2 (inbox unread) +End of search results. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "reply to ghost (RT)" +notmuch show --entire-thread=true id:87bmc6lp3h.fsf@len.workgroup | grep ^Subject: | head -1 > OUTPUT +cat <<EOF > EXPECTED +Subject: FYI: xxxx xxxxxxx xxxxxxxxxxxx xxx +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "reply to ghost (RT/tree view)" +test_emacs '(notmuch-tree "id:87bmc6lp3h.fsf@len.workgroup") + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +cat <<EOF > EXPECTED + 2016-06-19 Gregor Zattler ┬┬►FYI: xxxx xxxxxxx xxxxxxxxxxxx xxx (inbox unread) + 2016-06-19 via RT │╰─►[support.xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de #33575] AutoReply: FYI: xxxx xxxxxxx xxxxxxxxxxxx xxx (inbox unread) + 2016-06-26 via RT ╰─►[support.xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de #33575] Resolved: FYI: xxxx xxxxxxx xxxxxxxxxxxx xxx (inbox unread) +End of search results. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "trusting reply-to (tree view)" +test_emacs '(notmuch-tree "id:B00-root@example.org") + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +cat <<EOF > EXPECTED + 2016-06-17 Alice ┬►root message (inbox unread) + 2016-06-18 Alice ╰┬►child message (inbox unread) + 2016-06-18 Alice ╰─►grand-child message (inbox unread) +End of search results. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T520-show.sh b/test/T520-show.sh new file mode 100755 index 00000000..16222650 --- /dev/null +++ b/test/T520-show.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +test_description='"notmuch show"' + +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +test_begin_subtest "exit code for show invalid query" +notmuch show foo.. +exit_code=$? +test_expect_equal 1 $exit_code + +test_done diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh new file mode 100755 index 00000000..69ebec68 --- /dev/null +++ b/test/T530-upgrade.sh @@ -0,0 +1,120 @@ +#!/usr/bin/env bash +test_description="database upgrade" + +. $(dirname "$0")/test-lib.sh || exit 1 + +dbtarball=database-v1.tar.xz + +# XXX: Accomplish the same with test lib helpers +if [ ! -e ${TEST_DIRECTORY}/test-databases/${dbtarball} ]; then + test_subtest_missing_external_prereq_["${dbtarball} - fetch with 'make download-test-databases'"]=t +fi + +test_begin_subtest "database checksum" +test_expect_success \ + '( cd $TEST_DIRECTORY/test-databases && + sha256sum --quiet --check --status ${dbtarball}.sha256 )' + +tar xf $TEST_DIRECTORY/test-databases/${dbtarball} -C ${MAIL_DIR} --strip-components=1 + +test_begin_subtest "folder: search does not work with old database version" +output=$(notmuch search folder:foo) +test_expect_equal "$output" "" + +test_begin_subtest "path: search does not work with old database version" +output=$(notmuch search path:foo) +test_expect_equal "$output" "" + +test_begin_subtest "pre upgrade dump" +test_expect_success 'notmuch dump | sort > pre-upgrade-dump' + +test_begin_subtest "database upgrade from format version 1" +output=$(notmuch new | sed -e 's/^Backing up tags to .*$/Backing up tags to FILENAME/') +test_expect_equal "$output" "\ +Welcome to a new version of notmuch! Your database will now be upgraded. +This process is safe to interrupt. +Backing up tags to FILENAME +Your notmuch database has now been upgraded. +No new mail." + +test_begin_subtest "tag backup matches pre-upgrade dump" +gunzip -c ${MAIL_DIR}/.notmuch/dump-*.gz | sort > backup-dump +test_expect_equal_file pre-upgrade-dump backup-dump + +test_begin_subtest "folder: no longer matches in the middle of path" +output=$(notmuch search folder:baz) +test_expect_equal "$output" "" + +test_begin_subtest "folder: search" +output=$(notmuch search --output=files folder:foo | notmuch_search_files_sanitize | sort) +test_expect_equal "$output" "MAIL_DIR/foo/06:2, +MAIL_DIR/foo/cur/07:2, +MAIL_DIR/foo/cur/08:2, +MAIL_DIR/foo/new/03:2, +MAIL_DIR/foo/new/09:2, +MAIL_DIR/foo/new/10:2," + +test_begin_subtest "top level folder: search" +output=$(notmuch search --output=files folder:'""' | notmuch_search_files_sanitize | sort) +# bar/18:2, is a duplicate of cur/51:2, +test_expect_equal "$output" "MAIL_DIR/01:2, +MAIL_DIR/02:2, +MAIL_DIR/bar/18:2, +MAIL_DIR/cur/29:2, +MAIL_DIR/cur/30:2, +MAIL_DIR/cur/31:2, +MAIL_DIR/cur/32:2, +MAIL_DIR/cur/33:2, +MAIL_DIR/cur/34:2, +MAIL_DIR/cur/35:2, +MAIL_DIR/cur/36:2, +MAIL_DIR/cur/37:2, +MAIL_DIR/cur/38:2, +MAIL_DIR/cur/39:2, +MAIL_DIR/cur/40:2, +MAIL_DIR/cur/41:2, +MAIL_DIR/cur/42:2, +MAIL_DIR/cur/43:2, +MAIL_DIR/cur/44:2, +MAIL_DIR/cur/45:2, +MAIL_DIR/cur/46:2, +MAIL_DIR/cur/47:2, +MAIL_DIR/cur/48:2, +MAIL_DIR/cur/49:2, +MAIL_DIR/cur/50:2, +MAIL_DIR/cur/51:2, +MAIL_DIR/cur/52:2, +MAIL_DIR/cur/53:2, +MAIL_DIR/new/04:2," + +test_begin_subtest "path: search" +output=$(notmuch search --output=files path:"bar" | notmuch_search_files_sanitize | sort) +# cur/51:2, is a duplicate of bar/18:2, +test_expect_equal "$output" "MAIL_DIR/bar/17:2, +MAIL_DIR/bar/18:2, +MAIL_DIR/cur/51:2," + +test_begin_subtest "top level path: search" +output=$(notmuch search --output=files path:'""' | notmuch_search_files_sanitize | sort) +test_expect_equal "$output" "MAIL_DIR/01:2, +MAIL_DIR/02:2," + +test_begin_subtest "recursive path: search" +output=$(notmuch search --output=files path:"bar/**" | notmuch_search_files_sanitize | sort) +# cur/51:2, is a duplicate of bar/18:2, +test_expect_equal "$output" "MAIL_DIR/bar/17:2, +MAIL_DIR/bar/18:2, +MAIL_DIR/bar/baz/05:2, +MAIL_DIR/bar/baz/23:2, +MAIL_DIR/bar/baz/24:2, +MAIL_DIR/bar/baz/cur/25:2, +MAIL_DIR/bar/baz/cur/26:2, +MAIL_DIR/bar/baz/new/27:2, +MAIL_DIR/bar/baz/new/28:2, +MAIL_DIR/bar/cur/19:2, +MAIL_DIR/bar/cur/20:2, +MAIL_DIR/bar/new/21:2, +MAIL_DIR/bar/new/22:2, +MAIL_DIR/cur/51:2," + +test_done diff --git a/test/T550-db-features.sh b/test/T550-db-features.sh new file mode 100755 index 00000000..9d5a9e70 --- /dev/null +++ b/test/T550-db-features.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +test_description="database version and feature compatibility" + +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "future database versions abort open" +${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 9999 "" +output=$(notmuch search x 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/') +rm -rf ${MAIL_DIR}/.notmuch +test_expect_equal "$output" "\ +Error: Notmuch database at FILENAME + has a newer database format version (9999) than supported by this + version of notmuch (3)." + +test_begin_subtest "unknown 'rw' feature aborts read/write open" +${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 3 $'test feature\trw' +output=$(notmuch new 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/') +rm -rf ${MAIL_DIR}/.notmuch +test_expect_equal "$output" "\ +Error: Notmuch database at FILENAME + requires features (test feature) + not supported by this version of notmuch." + +test_begin_subtest "unknown 'rw' feature aborts read-only open" +${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 3 $'test feature\trw' +output=$(notmuch search x 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/') +rm -rf ${MAIL_DIR}/.notmuch +test_expect_equal "$output" "\ +Error: Notmuch database at FILENAME + requires features (test feature) + not supported by this version of notmuch." + +test_begin_subtest "unknown 'w' feature aborts read/write open" +${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 3 $'test feature\tw' +output=$(notmuch new 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/') +rm -rf ${MAIL_DIR}/.notmuch +test_expect_equal "$output" "\ +Error: Notmuch database at FILENAME + requires features (test feature) + not supported by this version of notmuch." + +test_begin_subtest "unknown 'w' feature does not abort read-only open" +${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 3 $'test feature\tw' +output=$(notmuch search x 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/') +rm -rf ${MAIL_DIR}/.notmuch +test_expect_equal "$output" "" + +test_done diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh new file mode 100755 index 00000000..06a6b860 --- /dev/null +++ b/test/T560-lib-error.sh @@ -0,0 +1,321 @@ +#!/usr/bin/env bash +test_description="error reporting for library" + +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +test_begin_subtest "building database" +test_expect_success "NOTMUCH_NEW" + +test_begin_subtest "Open null pointer" +test_C <<'EOF' +#include <stdio.h> +#include <notmuch.h> +int main (int argc, char** argv) +{ + notmuch_database_t *db; + notmuch_status_t stat; + stat = notmuch_database_open (NULL, 0, 0); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +Error: Cannot open a database for a NULL path. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Open relative path" +test_C <<'EOF' +#include <stdio.h> +#include <notmuch.h> +int main (int argc, char** argv) +{ + notmuch_database_t *db; + notmuch_status_t stat; + stat = notmuch_database_open ("./nonexistent/foo", 0, 0); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +Error: Database path must be absolute. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Create database in relative path" +test_C <<'EOF' +#include <stdio.h> +#include <notmuch.h> +int main (int argc, char** argv) +{ + notmuch_database_t *db; + notmuch_status_t stat; + stat = notmuch_database_create ("./nonexistent/foo", &db); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +Error: Database path must be absolute. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Open nonexistent database" +test_C ${PWD}/nonexistent/foo <<'EOF' +#include <stdio.h> +#include <notmuch.h> +int main (int argc, char** argv) +{ + notmuch_database_t *db; + notmuch_status_t stat; + stat = notmuch_database_open (argv[1], 0, 0); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +Error opening database at CWD/nonexistent/foo/.notmuch: No such file or directory +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "create NULL path" +test_C <<'EOF' +#include <stdio.h> +#include <notmuch.h> +int main (int argc, char** argv) +{ + notmuch_status_t stat; + stat = notmuch_database_create (NULL, NULL); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +Error: Cannot create a database for a NULL path. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Create database in nonexistent directory" +test_C ${PWD}/nonexistent/foo<<'EOF' +#include <stdio.h> +#include <notmuch.h> +int main (int argc, char** argv) +{ + notmuch_database_t *db; + notmuch_status_t stat; + stat = notmuch_database_create (argv[1], &db); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +Error: Cannot create database at CWD/nonexistent/foo: No such file or directory. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Write to read-only database" +test_C ${MAIL_DIR} <<'EOF' +#include <stdio.h> +#include <notmuch.h> +int main (int argc, char** argv) +{ + notmuch_database_t *db; + notmuch_status_t stat; + stat = notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_ONLY, &db); + if (stat != NOTMUCH_STATUS_SUCCESS) { + fprintf (stderr, "error opening database: %d\n", stat); + } + stat = notmuch_database_index_file (db, "/dev/null", NULL, NULL); + if (stat) + fputs (notmuch_database_status_string (db), stderr); + +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +Cannot write to a read-only database. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Add non-existent file" +test_C ${MAIL_DIR} <<'EOF' +#include <stdio.h> +#include <notmuch.h> +int main (int argc, char** argv) +{ + notmuch_database_t *db; + notmuch_status_t stat; + stat = notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db); + if (stat != NOTMUCH_STATUS_SUCCESS) { + fprintf (stderr, "error opening database: %d\n", stat); + } + stat = notmuch_database_index_file (db, "./nonexistent", NULL, NULL); + if (stat) { + char *status_string = notmuch_database_status_string (db); + if (status_string) fputs (status_string, stderr); + } +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +Error opening ./nonexistent: No such file or directory +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "compact, overwriting existing backup" +test_C ${MAIL_DIR} <<'EOF' +#include <stdio.h> +#include <notmuch.h> +static void +status_cb (const char *msg, void *closure) +{ + printf ("%s\n", msg); +} +int main (int argc, char** argv) +{ + notmuch_database_t *db; + notmuch_status_t stat; + stat = notmuch_database_compact (argv[1], argv[1], status_cb, NULL); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +Path already exists: MAIL_DIR + +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +cat <<EOF > c_head +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <talloc.h> +#include <notmuch.h> + +int main (int argc, char** argv) +{ + notmuch_database_t *db; + notmuch_status_t stat; + char *path; + char *msg = NULL; + int fd; + + stat = notmuch_database_open_verbose (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db, &msg); + if (stat != NOTMUCH_STATUS_SUCCESS) { + fprintf (stderr, "error opening database: %d %s\n", stat, msg ? msg : ""); + exit (1); + } + path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.${db_ending}", argv[1]); + fd = open(path,O_WRONLY|O_TRUNC); + if (fd < 0) { + fprintf (stderr, "error opening %s\n", argv[1]); + exit (1); + } +EOF +cat <<'EOF' > c_tail + if (stat) { + const char *stat_str = notmuch_database_status_string (db); + if (stat_str) + fputs (stat_str, stderr); + } + +} +EOF + +backup_database +test_begin_subtest "Xapian exception finding message" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_message_t *message = NULL; + stat = notmuch_database_find_message (db, "id:nonexistent", &message); + } +EOF +sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' < OUTPUT > OUTPUT.clean +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +A Xapian exception occurred finding message +EOF +test_expect_equal_file EXPECTED OUTPUT.clean +restore_database + +backup_database +test_begin_subtest "Xapian exception getting tags" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_tags_t *tags = NULL; + tags = notmuch_database_get_all_tags (db); + stat = (tags == NULL); + } +EOF +sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' < OUTPUT > OUTPUT.clean +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +A Xapian exception occurred getting tags +EOF +test_expect_equal_file EXPECTED OUTPUT.clean +restore_database + +backup_database +test_begin_subtest "Xapian exception creating directory" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_directory_t *directory = NULL; + stat = notmuch_database_get_directory (db, "none/existing", &directory); + } +EOF +sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' < OUTPUT > OUTPUT.clean +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +A Xapian exception occurred creating a directory +EOF +test_expect_equal_file EXPECTED OUTPUT.clean +restore_database + +backup_database +test_begin_subtest "Xapian exception searching messages" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_messages_t *messages = NULL; + notmuch_query_t *query=notmuch_query_create (db, "*"); + stat = notmuch_query_search_messages (query, &messages); + } +EOF +sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' < OUTPUT > OUTPUT.clean +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +A Xapian exception occurred performing query +Query string was: * +EOF +test_expect_equal_file EXPECTED OUTPUT.clean +restore_database + +backup_database +test_begin_subtest "Xapian exception counting messages" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + int count; + notmuch_query_t *query=notmuch_query_create (db, "id:87ocn0qh6d.fsf@yoom.home.cworth.org"); + stat = notmuch_query_count_messages (query, &count); + } +EOF +sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' < OUTPUT > OUTPUT.clean +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +A Xapian exception occurred performing query +Query string was: id:87ocn0qh6d.fsf@yoom.home.cworth.org +EOF +test_expect_equal_file EXPECTED OUTPUT.clean +restore_database + +test_done diff --git a/test/T570-revision-tracking.sh b/test/T570-revision-tracking.sh new file mode 100755 index 00000000..a59e7c98 --- /dev/null +++ b/test/T570-revision-tracking.sh @@ -0,0 +1,93 @@ +#!/usr/bin/env bash +test_description="database revision tracking" + +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +test_begin_subtest "notmuch_database_get_revision" +test_C ${MAIL_DIR} <<'EOF' +#include <stdio.h> +#include <string.h> +#include <notmuch.h> +int main (int argc, char** argv) +{ + notmuch_database_t *db; + notmuch_status_t stat; + unsigned long revision; + const char *uuid; + + unsigned long rev; + + stat = notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_ONLY, &db); + if (stat) + fputs ("open failed\n", stderr); + revision = notmuch_database_get_revision (db, &uuid); + printf("%s\t%lu\n", uuid, revision); +} +EOF +notmuch_uuid_sanitize < OUTPUT > CLEAN +cat <<'EOF' >EXPECTED +== stdout == +UUID 53 +== stderr == +EOF +test_expect_equal_file EXPECTED CLEAN + +grep '^[0-9a-f]' OUTPUT > INITIAL_OUTPUT + +test_begin_subtest "output of count matches test code" +notmuch count --lastmod '*' | cut -f2-3 > OUTPUT +test_expect_equal_file INITIAL_OUTPUT OUTPUT + +test_begin_subtest "modification count increases" +before=$(notmuch count --lastmod '*' | cut -f3) +notmuch tag +a-random-tag-8743632 '*' +after=$(notmuch count --lastmod '*' | cut -f3) +result=$(($before < $after)) +test_expect_equal 1 ${result} + +notmuch count --lastmod '*' | cut -f2 > UUID + +test_begin_subtest "search succeeds with correct uuid" +test_expect_success "notmuch search --uuid=$(cat UUID) '*'" + +test_begin_subtest "uuid works as global option" +test_expect_success "notmuch --uuid=$(cat UUID) search '*'" + +test_begin_subtest "uuid works as global option II" +test_expect_code 1 "notmuch --uuid=this-is-no-uuid search '*'" + +test_begin_subtest "search fails with incorrect uuid" +test_expect_code 1 "notmuch search --uuid=this-is-no-uuid '*'" + +test_begin_subtest "show succeeds with correct uuid" +test_expect_success "notmuch show --uuid=$(cat UUID) '*'" + +test_begin_subtest "show fails with incorrect uuid" +test_expect_code 1 "notmuch show --uuid=this-is-no-uuid '*'" + +test_begin_subtest "tag succeeds with correct uuid" +test_expect_success "notmuch tag --uuid=$(cat UUID) +test '*'" + +test_begin_subtest "tag fails with incorrect uuid" +test_expect_code 1 "notmuch tag --uuid=this-is-no-uuid '*' +test2" + +test_begin_subtest 'lastmod:0.. matches everything' +total=$(notmuch count '*') +modtotal=$(notmuch count lastmod:0..) +test_expect_equal "$total" "$modtotal" + +test_begin_subtest 'lastmod:1000000.. matches nothing' +modtotal=$(notmuch count lastmod:1000000..) +test_expect_equal 0 "$modtotal" + +test_begin_subtest 'exclude one message using lastmod' +lastmod=$(notmuch count --lastmod '*' | cut -f3) +total=$(notmuch count '*') +notmuch tag +4EFC743A.3060609@april.org id:4EFC743A.3060609@april.org +subtotal=$(notmuch count lastmod:..$lastmod) +result=$(($subtotal == $total-1)) +test_expect_equal 1 "$result" + +test_done diff --git a/test/T580-thread-search.sh b/test/T580-thread-search.sh new file mode 100755 index 00000000..01aa3efd --- /dev/null +++ b/test/T580-thread-search.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2015 David Bremner +# + +test_description='test of searching by thread-id' + +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +test_begin_subtest "Every message is found in exactly one thread" + +count=0 +success=0 +for id in $(notmuch search --output=messages '*'); do + count=$((count +1)) + matches=$((`notmuch search --output=threads "$id" | wc -l`)) + if [ "$matches" = 1 ]; then + success=$((success + 1)) + fi +done + +test_expect_equal "$count" "$success" + +test_begin_subtest "roundtripping message-ids via thread-ids" + +count=0 +success=0 +for id in $(notmuch search --output=messages '*'); do + count=$((count +1)) + thread=$(notmuch search --output=threads "$id") + matched=$(notmuch search --output=messages "$thread" | grep "$id") + if [ "$matched" = "$id" ]; then + success=$((success + 1)) + fi +done + +test_expect_equal "$count" "$success" + + +test_done diff --git a/test/T585-thread-subquery.sh b/test/T585-thread-subquery.sh new file mode 100755 index 00000000..bf9894d3 --- /dev/null +++ b/test/T585-thread-subquery.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2018 David Bremner +# + +test_description='test of searching by using thread subqueries' + +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +test_begin_subtest "Basic query that matches no messages" +count=$(notmuch count from:keithp and to:keithp) +test_expect_equal 0 "$count" + +test_begin_subtest "Same query against threads" +if [ $NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR -eq 0 ]; then + test_subtest_known_broken +fi +notmuch search thread:{from:keithp} and thread:{to:keithp} | notmuch_search_sanitize > OUTPUT +cat<<EOF > EXPECTED +thread:XXX 2009-11-18 [7/7] Lars Kellogg-Stedman, Mikhail Gusarov, Keith Packard, Carl Worth; [notmuch] Working with Maildir storage? (inbox signed unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Mix thread and non-threads query" +if [ $NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR -eq 0 ]; then + test_subtest_known_broken +fi +notmuch search thread:{from:keithp} and to:keithp | notmuch_search_sanitize > OUTPUT +cat<<EOF > EXPECTED +thread:XXX 2009-11-18 [1/7] Lars Kellogg-Stedman| Mikhail Gusarov, Keith Packard, Carl Worth; [notmuch] Working with Maildir storage? (inbox signed unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Compound subquery" +if [ $NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR -eq 0 ]; then + test_subtest_known_broken +fi +notmuch search 'thread:"{from:keithp and date:2009}" and thread:{to:keithp}' | notmuch_search_sanitize > OUTPUT +cat<<EOF > EXPECTED +thread:XXX 2009-11-18 [7/7] Lars Kellogg-Stedman, Mikhail Gusarov, Keith Packard, Carl Worth; [notmuch] Working with Maildir storage? (inbox signed unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Syntax/quoting error in subquery" +if [ $NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR -eq 0 ]; then + test_subtest_known_broken +fi +notmuch search 'thread:{from:keithp and date:2009} and thread:{to:keithp}' 1>OUTPUT 2>&1 +cat<<EOF > EXPECTED +notmuch search: A Xapian exception occurred +A Xapian exception occurred parsing query: missing } in '{from:keithp' +Query string was: thread:{from:keithp and date:2009} and thread:{to:keithp} +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh new file mode 100755 index 00000000..46f3a76d --- /dev/null +++ b/test/T590-libconfig.sh @@ -0,0 +1,135 @@ +#!/usr/bin/env bash +test_description="library config API" + +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +cat <<EOF > c_head +#include <string.h> +#include <stdlib.h> +#include <notmuch-test.h> + +int main (int argc, char** argv) +{ + notmuch_database_t *db; + char *val; + notmuch_status_t stat; + + EXPECT0(notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db)); + +EOF + +cat <<EOF > c_tail + EXPECT0(notmuch_database_destroy(db)); +} +EOF + +test_begin_subtest "notmuch_database_{set,get}_config" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +{ + EXPECT0(notmuch_database_set_config (db, "testkey1", "testvalue1")); + EXPECT0(notmuch_database_set_config (db, "testkey2", "testvalue2")); + EXPECT0(notmuch_database_get_config (db, "testkey1", &val)); + printf("testkey1 = %s\n", val); + EXPECT0(notmuch_database_get_config (db, "testkey2", &val)); + printf("testkey2 = %s\n", val); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +testkey1 = testvalue1 +testkey2 = testvalue2 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + + +test_begin_subtest "notmuch_database_get_config_list: empty list" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +{ + notmuch_config_list_t *list; + EXPECT0(notmuch_database_get_config_list (db, "nonexistent", &list)); + printf("valid = %d\n", notmuch_config_list_valid (list)); + notmuch_config_list_destroy (list); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +valid = 0 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + + +test_begin_subtest "notmuch_database_get_config_list: all pairs" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +{ + notmuch_config_list_t *list; + EXPECT0(notmuch_database_set_config (db, "zzzafter", "afterval")); + EXPECT0(notmuch_database_set_config (db, "aaabefore", "beforeval")); + EXPECT0(notmuch_database_get_config_list (db, "", &list)); + for (; notmuch_config_list_valid (list); notmuch_config_list_move_to_next (list)) { + printf("%s %s\n", notmuch_config_list_key (list), notmuch_config_list_value(list)); + } + notmuch_config_list_destroy (list); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +aaabefore beforeval +testkey1 testvalue1 +testkey2 testvalue2 +zzzafter afterval +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "notmuch_database_get_config_list: one prefix" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +{ + notmuch_config_list_t *list; + EXPECT0(notmuch_database_get_config_list (db, "testkey", &list)); + for (; notmuch_config_list_valid (list); notmuch_config_list_move_to_next (list)) { + printf("%s %s\n", notmuch_config_list_key (list), notmuch_config_list_value(list)); + } + notmuch_config_list_destroy (list); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +testkey1 testvalue1 +testkey2 testvalue2 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "dump config" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +{ + EXPECT0(notmuch_database_set_config (db, "key with spaces", "value, with, spaces!")); +} +EOF +notmuch dump --include=config >OUTPUT +cat <<'EOF' >EXPECTED +#notmuch-dump batch-tag:3 config +#@ aaabefore beforeval +#@ key%20with%20spaces value,%20with,%20spaces%21 +#@ testkey1 testvalue1 +#@ testkey2 testvalue2 +#@ zzzafter afterval +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "restore config" +notmuch dump --include=config >EXPECTED +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +{ + EXPECT0(notmuch_database_set_config (db, "testkey1", "mutatedvalue")); +} +EOF +notmuch restore --include=config <EXPECTED +notmuch dump --include=config >OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T590-thread-breakage.sh b/test/T590-thread-breakage.sh new file mode 100755 index 00000000..aeb82cf4 --- /dev/null +++ b/test/T590-thread-breakage.sh @@ -0,0 +1,124 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2016 Daniel Kahn Gillmor +# + +test_description='thread breakage during reindexing' + +# notmuch uses ghost documents to track messages we have seen references +# to but have never seen. Regardless of the order of delivery, message +# deletion, and reindexing, the list of ghost messages for a given +# stored corpus should not vary, so that threads can be reassmebled +# cleanly. +# +# In practice, we accept a small amount of variation (and therefore +# traffic pattern metadata leakage to be stored in the index) for the +# sake of efficiency. +# +# This test also embeds some subtests to ensure that indexing actually +# works properly and attempted fixes to threading issues do not break +# the expected contents of the index. + +. $(dirname "$0")/test-lib.sh || exit 1 + +message_a() { + mkdir -p ${MAIL_DIR}/cur + cat > ${MAIL_DIR}/cur/a <<EOF +Subject: First message +Message-ID: <a@example.net> +From: Alice <alice@example.net> +To: Bob <bob@example.net> +Date: Thu, 31 Mar 2016 20:10:00 -0400 + +This is the first message in the thread. +Apple +EOF +} + +message_b() { + mkdir -p ${MAIL_DIR}/cur + cat > ${MAIL_DIR}/cur/b <<EOF +Subject: Second message +Message-ID: <b@example.net> +In-Reply-To: <a@example.net> +References: <a@example.net> +From: Bob <bob@example.net> +To: Alice <alice@example.net> +Date: Thu, 31 Mar 2016 20:15:00 -0400 + +This is the second message in the thread. +Banana +EOF +} + + +test_content_count() { + test_begin_subtest "${3:-looking for $2 instance of '$1'}" + count=$(notmuch count --output=threads "$1") + test_expect_equal "$count" "$2" +} + +test_thread_count() { + test_begin_subtest "${2:-Expecting $1 thread(s)}" + count=$(notmuch count --output=threads) + test_expect_equal "$count" "$1" +} + +test_ghost_count() { + test_begin_subtest "${2:-Expecting $1 ghosts(s)}" + ghosts=$($NOTMUCH_BUILDDIR/test/ghost-report ${MAIL_DIR}/.notmuch/xapian) + test_expect_equal "$ghosts" "$1" +} + +notmuch new >/dev/null + +test_thread_count 0 'There should be no threads initially' +test_ghost_count 0 'There should be no ghosts initially' + +message_a +notmuch new >/dev/null +test_thread_count 1 'One message in: one thread' +test_content_count apple 1 +test_content_count banana 0 +test_ghost_count 0 + +message_b +notmuch new >/dev/null +test_thread_count 1 'Second message in the same thread: one thread' +test_content_count apple 1 +test_content_count banana 1 +test_ghost_count 0 + +rm -f ${MAIL_DIR}/cur/a +notmuch new >/dev/null +test_thread_count 1 'First message removed: still only one thread' +test_content_count apple 0 +test_content_count banana 1 +test_ghost_count 1 'should be one ghost after first message removed' + +message_a +notmuch new >/dev/null +test_thread_count 1 'First message reappears: should return to the same thread' +test_content_count apple 1 +test_content_count banana 1 +test_ghost_count 0 + +rm -f ${MAIL_DIR}/cur/b +notmuch new >/dev/null +test_thread_count 1 'Removing second message: still only one thread' +test_content_count apple 1 +test_content_count banana 0 +test_begin_subtest 'No ghosts should remain after deletion of second message' +# this is known to fail; we are leaking ghost messages deliberately +test_subtest_known_broken +ghosts=$($NOTMUCH_BUILDDIR/test/ghost-report ${MAIL_DIR}/.notmuch/xapian) +test_expect_equal "$ghosts" "0" + +rm -f ${MAIL_DIR}/cur/a +notmuch new >/dev/null +test_thread_count 0 'All messages gone: no threads' +test_content_count apple 0 +test_content_count banana 0 +test_ghost_count 0 'No ghosts should remain after full thread deletion' + +test_done diff --git a/test/T600-named-queries.sh b/test/T600-named-queries.sh new file mode 100755 index 00000000..abaee3b7 --- /dev/null +++ b/test/T600-named-queries.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +test_description='named queries' +. $(dirname "$0")/test-lib.sh || exit 1 + +QUERYSTR="date:2009-11-18..2009-11-18 and tag:unread" + +test_begin_subtest "error adding named query before initializing DB" +test_expect_code 1 "notmuch config set query.test \"$QUERYSTR\"" + +add_email_corpus + +test_begin_subtest "adding named query" +test_expect_success "notmuch config set query.test \"$QUERYSTR\"" + +test_begin_subtest "adding nested named query" +QUERYSTR2="query:test and subject:Maildir" +test_expect_success "notmuch config set query.test2 \"$QUERYSTR2\"" + +test_begin_subtest "retrieve named query" +output=$(notmuch config get query.test) +test_expect_equal "$QUERYSTR" "$output" + +test_begin_subtest "List all queries" +notmuch config list | grep ^query | notmuch_config_sanitize > OUTPUT +cat <<EOF > EXPECTED +query.test=date:2009-11-18..2009-11-18 and tag:unread +query.test2=query:test and subject:Maildir +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "dump named queries" +notmuch dump | grep '^#@' > OUTPUT +cat<<EOF > QUERIES.BEFORE +#@ query.test date%3a2009-11-18..2009-11-18%20and%20tag%3aunread +#@ query.test2 query%3atest%20and%20subject%3aMaildir +EOF +test_expect_equal_file QUERIES.BEFORE OUTPUT + +test_begin_subtest "delete named queries" +notmuch dump > BEFORE +notmuch config set query.test +notmuch dump | grep '^#@' > OUTPUT +cat<<EOF > EXPECTED +#@ query.test2 query%3atest%20and%20subject%3aMaildir +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "restore named queries" +notmuch restore < BEFORE +notmuch dump | grep '^#@' > OUTPUT +test_expect_equal_file QUERIES.BEFORE OUTPUT + +test_begin_subtest "search named query" +notmuch search query:test > OUTPUT +notmuch search $QUERYSTR > EXPECTED +if [ $NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR -ne 1 ]; then + test_subtest_known_broken +fi +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "search named query with other terms" +notmuch search query:test and subject:Maildir > OUTPUT +notmuch search $QUERYSTR and subject:Maildir > EXPECTED +if [ $NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR -ne 1 ]; then + test_subtest_known_broken +fi +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "search nested named query" +notmuch search query:test2 > OUTPUT +notmuch search $QUERYSTR2 > EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh new file mode 100755 index 00000000..0abef824 --- /dev/null +++ b/test/T610-message-property.sh @@ -0,0 +1,318 @@ +#!/usr/bin/env bash +test_description="message property API" + +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +cat <<EOF > c_head +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <talloc.h> +#include <notmuch-test.h> + +void print_properties (notmuch_message_t *message, const char *prefix, notmuch_bool_t exact) { + notmuch_message_properties_t *list; + for (list = notmuch_message_get_properties (message, prefix, exact); + notmuch_message_properties_valid (list); notmuch_message_properties_move_to_next (list)) { + printf("%s\n", notmuch_message_properties_value(list)); + } + notmuch_message_properties_destroy (list); +} + +int main (int argc, char** argv) +{ + notmuch_database_t *db; + notmuch_message_t *message = NULL; + const char *val; + notmuch_status_t stat; + + EXPECT0(notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db)); + EXPECT0(notmuch_database_find_message(db, "4EFC743A.3060609@april.org", &message)); + if (message == NULL) { + fprintf (stderr, "unable to find message"); + exit (1); + } +EOF + +cat <<EOF > c_tail + EXPECT0(notmuch_database_destroy(db)); +} +EOF + +test_begin_subtest "notmuch_message_{add,get,remove}_property" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +{ + EXPECT0(notmuch_message_add_property (message, "testkey1", "testvalue1")); + EXPECT0(notmuch_message_get_property (message, "testkey1", &val)); + printf("testkey1[1] = %s\n", val); + EXPECT0(notmuch_message_add_property (message, "testkey2", "this value has spaces and = sign")); + EXPECT0(notmuch_message_get_property (message, "testkey1", &val)); + printf("testkey1[2] = %s\n", val); + EXPECT0(notmuch_message_get_property (message, "testkey1", &val)); + + EXPECT0(notmuch_message_get_property (message, "testkey2", &val)); + printf("testkey2 = %s\n", val); + + /* Add second value for key */ + EXPECT0(notmuch_message_add_property (message, "testkey2", "zztestvalue3")); + EXPECT0(notmuch_message_get_property (message, "testkey2", &val)); + printf("testkey2 = %s\n", val); + + /* remove first value for key */ + EXPECT0(notmuch_message_remove_property (message, "testkey2", "this value has spaces and = sign")); + EXPECT0(notmuch_message_get_property (message, "testkey2", &val)); + printf("testkey2 = %s\n", val); + + /* remove non-existant value for key */ + EXPECT0(notmuch_message_remove_property (message, "testkey2", "this value has spaces and = sign")); + EXPECT0(notmuch_message_get_property (message, "testkey2", &val)); + printf("testkey2 = %s\n", val); + + /* remove only value for key */ + EXPECT0(notmuch_message_remove_property (message, "testkey2", "zztestvalue3")); + EXPECT0(notmuch_message_get_property (message, "testkey2", &val)); + printf("testkey2 = %s\n", val == NULL ? "NULL" : val); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +testkey1[1] = testvalue1 +testkey1[2] = testvalue1 +testkey2 = this value has spaces and = sign +testkey2 = this value has spaces and = sign +testkey2 = zztestvalue3 +testkey2 = zztestvalue3 +testkey2 = NULL +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "notmuch_message_remove_all_properties" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +EXPECT0(notmuch_message_remove_all_properties (message, NULL)); +print_properties (message, "", FALSE); +EOF +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "notmuch_message_get_properties: empty list" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +{ + notmuch_message_properties_t *list; + list = notmuch_message_get_properties (message, "nonexistent", TRUE); + printf("valid = %d\n", notmuch_message_properties_valid (list)); + notmuch_message_properties_destroy (list); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +valid = 0 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "notmuch_message_properties: one value" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +print_properties (message, "testkey1", TRUE); +EOF +cat <<'EOF' >EXPECTED +== stdout == +testvalue1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "notmuch_message_properties: multiple values" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +EXPECT0(notmuch_message_add_property (message, "testkey1", "bob")); +EXPECT0(notmuch_message_add_property (message, "testkey1", "testvalue2")); +EXPECT0(notmuch_message_add_property (message, "testkey1", "alice")); +print_properties (message, "testkey1", TRUE); +EOF +cat <<'EOF' >EXPECTED +== stdout == +alice +bob +testvalue1 +testvalue2 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "notmuch_message_properties: prefix" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +EXPECT0(notmuch_message_add_property (message, "testkey3", "bob3")); +EXPECT0(notmuch_message_add_property (message, "testkey3", "testvalue3")); +EXPECT0(notmuch_message_add_property (message, "testkey3", "alice3")); +print_properties (message, "testkey", FALSE); +EOF +cat <<'EOF' >EXPECTED +== stdout == +alice +bob +testvalue1 +testvalue2 +alice3 +bob3 +testvalue3 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "notmuch_message_properties: modify during iteration" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +{ + const char *keys[1000] = {NULL}; + const char *vals[1000] = {NULL}; + notmuch_message_properties_t *properties; + int i; + + for (properties = notmuch_message_get_properties (message, "", FALSE), i=0; + notmuch_message_properties_valid (properties); + notmuch_message_properties_move_to_next (properties), i++) + { + const char *key, *value; + + keys[i]=talloc_strdup(message, + notmuch_message_properties_key (properties)); + vals[i]=talloc_strdup(message, + notmuch_message_properties_value (properties)); + + EXPECT0(notmuch_message_remove_property (message, keys[i], vals[i])); + } + + print_properties (message, "", FALSE); + + for (i = 0; keys[i] && vals[i]; i++) { + EXPECT0(notmuch_message_add_property (message, keys[i], vals[i])); + } +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "dump message properties" +cat <<EOF > PROPERTIES +#= 4EFC743A.3060609@april.org fancy%20key%20with%20%c3%a1cc%c3%a8nts=import%20value%20with%20= testkey1=alice testkey1=bob testkey1=testvalue1 testkey1=testvalue2 testkey3=alice3 testkey3=bob3 testkey3=testvalue3 +EOF +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +EXPECT0(notmuch_message_add_property (message, "fancy key with áccènts", "import value with =")); +EOF +notmuch dump | grep '^#=' > OUTPUT +test_expect_equal_file PROPERTIES OUTPUT + +test_begin_subtest "dump _only_ message properties" +cat <<EOF > EXPECTED +#notmuch-dump batch-tag:3 properties +#= 4EFC743A.3060609@april.org fancy%20key%20with%20%c3%a1cc%c3%a8nts=import%20value%20with%20= testkey1=alice testkey1=bob testkey1=testvalue1 testkey1=testvalue2 testkey3=alice3 testkey3=bob3 testkey3=testvalue3 +EOF +notmuch dump --include=properties > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + + +test_begin_subtest "restore missing message property (single line)" +notmuch dump | grep '^#=' > BEFORE1 +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +EXPECT0(notmuch_message_remove_property (message, "testkey1", "bob")); +EOF +notmuch restore < BEFORE1 +notmuch dump | grep '^#=' > OUTPUT +test_expect_equal_file PROPERTIES OUTPUT + + +test_begin_subtest "restore missing message property (full dump)" +notmuch dump > BEFORE2 +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +EXPECT0(notmuch_message_remove_property (message, "testkey1", "bob")); +EOF +notmuch restore < BEFORE2 +notmuch dump | grep '^#=' > OUTPUT +test_expect_equal_file PROPERTIES OUTPUT + +test_begin_subtest "restore clear extra message property" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +EXPECT0(notmuch_message_add_property (message, "testkey1", "charles")); +EOF +notmuch restore < BEFORE2 +notmuch dump | grep '^#=' > OUTPUT +test_expect_equal_file PROPERTIES OUTPUT + +test_begin_subtest "test 'property:' queries: empty" +notmuch search property:testkey1=charles > OUTPUT +test_expect_equal_file /dev/null OUTPUT + +test_begin_subtest "test 'property:' queries: single message" +notmuch search --output=messages property:testkey1=alice > OUTPUT +cat <<EOF >EXPECTED +id:4EFC743A.3060609@april.org +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "msg.get_property (python)" +test_python <<'EOF' +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE) +msg = db.find_message("4EFC743A.3060609@april.org") +print("testkey1 = {0}".format(msg.get_property("testkey1"))) +print("testkey3 = {0}".format(msg.get_property("testkey3"))) +EOF +cat <<'EOF' > EXPECTED +testkey1 = alice +testkey3 = alice3 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "msg.get_properties (python)" +test_python <<'EOF' +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY) +msg = db.find_message("4EFC743A.3060609@april.org") +for (key,val) in msg.get_properties("testkey1"): + print("{0} = {1}".format(key,val)) +EOF +cat <<'EOF' > EXPECTED +testkey1 = alice +testkey1 = bob +testkey1 = testvalue1 +testkey1 = testvalue2 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "msg.get_properties (python, prefix)" +test_python <<'EOF' +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY) +msg = db.find_message("4EFC743A.3060609@april.org") +for (key,val) in msg.get_properties("testkey"): + print("{0} = {1}".format(key,val)) +EOF +cat <<'EOF' > EXPECTED +testkey1 = alice +testkey1 = bob +testkey1 = testvalue1 +testkey1 = testvalue2 +testkey3 = alice3 +testkey3 = bob3 +testkey3 = testvalue3 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "msg.get_properties (python, exact)" +test_python <<'EOF' +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY) +msg = db.find_message("4EFC743A.3060609@april.org") +for (key,val) in msg.get_properties("testkey",True): + print("{0} = {1}".format(key,val)) +EOF +test_expect_equal_file /dev/null OUTPUT + +test_done diff --git a/test/T620-lock.sh b/test/T620-lock.sh new file mode 100755 index 00000000..7aaaff2a --- /dev/null +++ b/test/T620-lock.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +test_description="locking" +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +test_begin_subtest "blocking open" +if [ $NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK -ne 1 ]; then + test_subtest_known_broken +fi +test_C ${MAIL_DIR} <<'EOF' +#include <unistd.h> +#include <stdlib.h> +#include <sys/wait.h> +#include <notmuch-test.h> + +void +taggit (notmuch_database_t *db, const char *tag) +{ + notmuch_message_t *message; + + EXPECT0 (notmuch_database_find_message (db, "4EFC743A.3060609@april.org", &message)); + if (message == NULL) { + fprintf (stderr, "unable to find message"); + exit (1); + } + + EXPECT0 (notmuch_message_add_tag (message, tag)); + notmuch_message_destroy (message); +} + +int +main (int argc, char **argv) +{ + pid_t child; + const char *path = argv[1]; + + child = fork (); + if (child == -1) { + fprintf (stderr, "fork failed\n"); + exit (1); + } + + if (child == 0) { + notmuch_database_t *db2; + + sleep (1); + EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &db2)); + taggit (db2, "child"); + EXPECT0 (notmuch_database_close (db2)); + } else { + notmuch_database_t *db; + + EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &db)); + taggit (db, "parent"); + sleep (2); + EXPECT0 (notmuch_database_close (db)); + wait (NULL); + } +} + +EOF +notmuch search --output=tags id:4EFC743A.3060609@april.org >> OUTPUT +cat <<'EOF' >EXPECTED +== stdout == +== stderr == +child +inbox +parent +unread +EOF +if [ $NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK -ne 1 ]; then + test_subtest_known_broken +fi +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T630-emacs-draft.sh b/test/T630-emacs-draft.sh new file mode 100755 index 00000000..d7903ce7 --- /dev/null +++ b/test/T630-emacs-draft.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +test_description="Emacs Draft Handling" +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +notmuch config set search.exclude_tags deleted + +test_begin_subtest "Saving a draft indexes it" +test_emacs '(notmuch-mua-mail) + (message-goto-subject) + (insert "draft-test-0001") + (notmuch-draft-save) + (test-output)' +count1=$(notmuch count tag:draft) +count2=$(notmuch count subject:draft-test-0001) +test_expect_equal "$count1=$count2" "1=1" + +test_begin_subtest "Saving a draft tags previous draft as deleted" +test_emacs '(notmuch-mua-mail) + (message-goto-subject) + (insert "draft-test-0002") + (notmuch-draft-save) + (notmuch-draft-save) + (test-output)' +count1=$(notmuch count tag:draft) +count2=$(notmuch count subject:draft-test-0002) + +test_expect_equal "$count1,$count2" "2,1" + +test_begin_subtest "Saving a signed draft adds header" +test_emacs '(notmuch-mua-mail) + (message-goto-subject) + (insert "draft-test-0003") + ;; We would use (mml-secure-message-sign) but on emacs23 + ;; that only signs the part, not the whole message. + (mml-secure-message mml-secure-method '\''sign) + (notmuch-draft-save) + (test-output)' +header_count=$(notmuch show --format=raw subject:draft-test-0003 | grep -c ^X-Notmuch-Emacs-Secure) +body_count=$(notmuch notmuch show --format=raw subject:draft-test-0003 | grep -c '^\<#secure') +test_expect_equal "$header_count,$body_count" "1,0" + +test_begin_subtest "Refusing to save an encrypted draft" +test_emacs '(notmuch-mua-mail) + (message-goto-subject) + (insert "draft-test-0004") + (mml-secure-message-sign-encrypt) + (let ((notmuch-draft-save-plaintext nil)) + (notmuch-draft-save)) + (test-output)' +count1=$(notmuch count tag:draft) +count2=$(notmuch count subject:draft-test-0004) + +test_expect_equal "$count1,$count2" "3,0" + +test_begin_subtest "Resuming a signed draft" + +test_emacs '(notmuch-show "subject:draft-test-0003") + (notmuch-show-resume-message) + (test-output)' +notmuch_dir_sanitize OUTPUT > OUTPUT.clean +cat <<EOF | notmuch_dir_sanitize >EXPECTED +From: Notmuch Test Suite <test_suite@notmuchmail.org> +To: +Subject: draft-test-0003 +Fcc: MAIL_DIR/sent +--text follows this line-- +<#secure method=pgpmime mode=sign> +EOF +test_expect_equal_file EXPECTED OUTPUT.clean +test_done diff --git a/test/T640-database-modified.sh b/test/T640-database-modified.sh new file mode 100755 index 00000000..274105c7 --- /dev/null +++ b/test/T640-database-modified.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +test_description="DatabaseModifiedError handling" +. $(dirname "$0")/test-lib.sh || exit 1 + +# add enough messages to trigger the exception +add_email_corpus + +test_begin_subtest "catching DatabaseModifiedError in _notmuch_message_ensure_metadata" +# it seems to need to be an early document to trigger the exception +first_id=$(notmuch search --output=messages '*'| head -1 | sed s/^id://) + +test_C ${MAIL_DIR} <<EOF +#include <unistd.h> +#include <stdlib.h> +#include <notmuch-test.h> +#include <talloc.h> +#include <assert.h> +int +main (int argc, char **argv) +{ + const char *path = argv[1]; + + notmuch_database_t *rw_db, *ro_db; + notmuch_messages_t *messages; + notmuch_message_t *message, *ro_message; + notmuch_query_t *query; + notmuch_tags_t *tags; + int i; + + EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_ONLY, &ro_db)); + assert(ro_db); + + EXPECT0 (notmuch_database_find_message (ro_db, "${first_id}", &ro_message)); + assert(ro_message); + + EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &rw_db)); + query = notmuch_query_create(rw_db, ""); + EXPECT0 (notmuch_query_search_messages (query, &messages)); + + for (; + notmuch_messages_valid (messages); + notmuch_messages_move_to_next (messages)) { + message = notmuch_messages_get (messages); + for (i=0; i<200; i++) { + char *tag_str = talloc_asprintf(rw_db, "%d", i); + EXPECT0 (notmuch_message_add_tag (message, tag_str)); + talloc_free (tag_str); + } + } + + notmuch_database_close (rw_db); + + tags = notmuch_message_get_tags (ro_message); + if (tags) + printf("SUCCESS\n"); + return 0; +} +EOF + +cat <<'EOF' >EXPECTED +== stdout == +SUCCESS +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T650-regexp-query.sh b/test/T650-regexp-query.sh new file mode 100755 index 00000000..4085340f --- /dev/null +++ b/test/T650-regexp-query.sh @@ -0,0 +1,175 @@ +#!/usr/bin/env bash +test_description='regular expression searches' +. $(dirname "$0")/test-lib.sh || exit 1 + +if [ $NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR -eq 0 ]; then + test_done +fi + +add_message '[dir]=bad' '[subject]="To the bone"' +add_message '[dir]=.' '[subject]="Top level"' +add_message '[dir]=bad/news' '[subject]="Bears"' +mkdir -p "${MAIL_DIR}/duplicate/bad/news" +cp "$gen_msg_filename" "${MAIL_DIR}/duplicate/bad/news" + +add_message '[dir]=things' '[subject]="These are a few"' +add_message '[dir]=things/favorite' '[subject]="Raindrops, whiskers, kettles"' +add_message '[dir]=things/bad' '[subject]="Bites, stings, sad feelings"' + +test_begin_subtest "empty path:// search" +notmuch search 'path:""' > EXPECTED +notmuch search 'path:/^$/' > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "empty folder:// search" +notmuch search 'folder:""' > EXPECTED +notmuch search 'folder:/^$/' > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "unanchored folder:// specification" +output=$(notmuch search folder:/bad/ | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread) +thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Bears (inbox unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bites, stings, sad feelings (inbox unread)" + +test_begin_subtest "anchored folder:// search" +output=$(notmuch search 'folder:/^bad$/' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread)" + +test_begin_subtest "unanchored path:// specification" +output=$(notmuch search path:/bad/ | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread) +thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Bears (inbox unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bites, stings, sad feelings (inbox unread)" + +test_begin_subtest "anchored path:// search" +output=$(notmuch search 'path:/^bad$/' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread)" + +# Use "standard" corpus from here on. +rm -rf $MAIL_DIR +add_email_corpus + +notmuch search --output=messages from:cworth > cworth.msg-ids + +# these headers will generate no document terms +add_message '[from]="-" [subject]="empty from"' +add_message '[subject]="-"' + +test_begin_subtest "null from: search" +notmuch search 'from:""' | notmuch_search_sanitize > OUTPUT +cat <<EOF > EXPECTED +thread:XXX 2001-01-05 [1/1] -; empty from (inbox unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "null subject: search" +notmuch search 'subject:""' | notmuch_search_sanitize > OUTPUT +cat <<EOF > EXPECTED +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; - (inbox unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "xapian wildcard search for from:" +notmuch search --output=messages 'from:cwo*' > OUTPUT +test_expect_equal_file cworth.msg-ids OUTPUT + +test_begin_subtest "xapian wildcard search for subject:" +test_expect_equal $(notmuch count 'subject:count*') 1 + +test_begin_subtest "regexp from search, case sensitive" +notmuch search --output=messages from:/carl/ > OUTPUT +test_expect_equal_file /dev/null OUTPUT + +test_begin_subtest "empty regexp or query" +notmuch search --output=messages from:/carl/ or from:/cworth/ > OUTPUT +test_expect_equal_file cworth.msg-ids OUTPUT + +test_begin_subtest "non-empty regexp and query" +notmuch search from:/cworth@cworth.org/ and subject:patch | notmuch_search_sanitize > OUTPUT +cat <<EOF > EXPECTED +thread:XXX 2009-11-18 [1/2] Carl Worth| Alex Botero-Lowry; [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) +thread:XXX 2009-11-18 [1/2] Carl Worth| Ingmar Vanhassel; [notmuch] [PATCH] Typsos (inbox unread) +thread:XXX 2009-11-18 [1/2] Carl Worth| Jan Janak; [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) +thread:XXX 2009-11-18 [1/2] Carl Worth| Keith Packard; [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) +thread:XXX 2009-11-18 [2/5] Carl Worth| Mikhail Gusarov, Keith Packard; [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "regexp from search, duplicate term search" +notmuch search --output=messages from:/cworth/ > OUTPUT +test_expect_equal_file cworth.msg-ids OUTPUT + +test_begin_subtest "long enough regexp matches only desired senders" +notmuch search --output=messages 'from:"/C.* Wo/"' > OUTPUT +test_expect_equal_file cworth.msg-ids OUTPUT + +test_begin_subtest "shorter regexp matches one more sender" +notmuch search --output=messages 'from:"/C.* W/"' > OUTPUT +{ echo id:1258544095-16616-1-git-send-email-chris@chris-wilson.co.uk; cat cworth.msg-ids; } > EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "regexp subject search, non-ASCII" +notmuch search --output=messages subject:/accentué/ > OUTPUT +echo id:877h1wv7mg.fsf@inf-8657.int-evry.fr > EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "regexp subject search, punctuation" +notmuch search subject:/\'X\'/ | notmuch_search_sanitize > OUTPUT +cat <<EOF > EXPECTED +thread:XXX 2009-11-18 [2/2] Keith Packard, Carl Worth; [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "regexp subject search, no punctuation" +notmuch search subject:/X/ | notmuch_search_sanitize > OUTPUT +cat <<EOF > EXPECTED +thread:XXX 2009-11-18 [2/2] Keith Packard, Carl Worth; [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) +thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "combine regexp from and subject" +notmuch search subject:/-C/ and from:/.an.k/ | notmuch_search_sanitize > OUTPUT +cat <<EOF > EXPECTED +thread:XXX 2009-11-17 [1/2] Jan Janak| Carl Worth; [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "regexp error reporting" +notmuch search 'from:/unbalanced[/' 1>OUTPUT 2>&1 +cat <<EOF > EXPECTED +notmuch search: A Xapian exception occurred +A Xapian exception occurred parsing query: Invalid regular expression +Query string was: from:/unbalanced[/ +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "empty mid search" +notmuch search --output=messages mid:yoom > OUTPUT +cp /dev/null EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "non-empty mid regex search" +notmuch search --output=messages mid:/yoom/ > OUTPUT +test_expect_equal_file cworth.msg-ids OUTPUT + +test_begin_subtest "combine regexp mid and subject" +notmuch search subject:/-C/ and mid:/y..m/ | notmuch_search_sanitize > OUTPUT +cat <<EOF > EXPECTED +thread:XXX 2009-11-18 [1/2] Carl Worth| Jan Janak; [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "unanchored tag search" +notmuch search tag:signed or tag:inbox > EXPECTED +notmuch search tag:/i/ > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +notmuch tag +testsi '*' +test_begin_subtest "anchored tag search" +notmuch search tag:signed > EXPECTED +notmuch search tag:/^si/ > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T660-bad-date.sh b/test/T660-bad-date.sh new file mode 100755 index 00000000..f65544b9 --- /dev/null +++ b/test/T660-bad-date.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +test_description="parsing of bad dates" +. $(dirname "$0")/test-lib.sh || exit 1 + +add_message [date]='"()"' + +test_begin_subtest 'Bad dates translate to a date after the Unix epoch' +cat <<EOF >EXPECTED +thread:0000000000000001 1970-01-01 [1/1] Notmuch Test Suite; Test message #1 (inbox unread) +EOF +notmuch search '*' > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T670-duplicate-mid.sh b/test/T670-duplicate-mid.sh new file mode 100755 index 00000000..fd7df057 --- /dev/null +++ b/test/T670-duplicate-mid.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash +test_description="duplicate message ids" +. $(dirname "$0")/test-lib.sh || exit 1 + +add_message '[id]="duplicate"' '[subject]="message 1" [filename]=copy1' +add_message '[id]="duplicate"' '[subject]="message 2" [filename]=copy2' + +add_message '[id]="duplicate"' '[subject]="message 0" [filename]=copy0' +test_begin_subtest 'search: first indexed subject preserved' +cat <<EOF > EXPECTED +thread:XXX 2001-01-05 [1/1(3)] Notmuch Test Suite; message 1 (inbox unread) +EOF +notmuch search id:duplicate | notmuch_search_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'First subject preserved in notmuch-show (json)' +test_subtest_known_broken +output=$(notmuch show --body=false --format=json id:duplicate | notmuch_json_show_sanitize) +expected='[[[{ + "id": "XXXXX", + "match": true, + "excluded": false, + "filename": [ + "'"${MAIL_DIR}"/copy0'", + "'"${MAIL_DIR}"/copy1'", + "'"${MAIL_DIR}"/copy2'" + ], + "timestamp": 42, + "date_relative": "2001-01-05", + "tags": ["inbox","unread"], + "headers": { + "Subject": "message 1", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "GENERATED_DATE" + } + }, +[]]]]' +test_expect_equal_json "$output" "$expected" + +test_begin_subtest 'Search for second subject' +cat <<EOF >EXPECTED +MAIL_DIR/copy0 +MAIL_DIR/copy1 +MAIL_DIR/copy2 +EOF +notmuch search --output=files subject:'"message 2"' | notmuch_dir_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'Regexp search for second subject' +# Note that missing field processor support really means the test +# doesn't make sense, but it happens to pass. +if [ $NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR -eq 1 ]; then + test_subtest_known_broken +fi +cat <<EOF >EXPECTED +MAIL_DIR/copy0 +MAIL_DIR/copy1 +MAIL_DIR/copy2 +EOF +notmuch search --output=files 'subject:"/message 2/"' | notmuch_dir_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +add_message '[id]="duplicate"' '[body]="sekrit" [filename]=copy3' +test_begin_subtest 'search for body in duplicate file' +cat <<EOF >EXPECTED +MAIL_DIR/copy0 +MAIL_DIR/copy1 +MAIL_DIR/copy2 +MAIL_DIR/copy3 +EOF +notmuch search --output=files "sekrit" | notmuch_dir_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +rm ${MAIL_DIR}/copy3 +test_begin_subtest 'reindex drops terms in duplicate file' +cp /dev/null EXPECTED +notmuch reindex '*' +notmuch search --output=files "sekrit" | notmuch_dir_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'reindex choses subject from first filename' +cat <<EOF > EXPECTED +thread:XXX 2001-01-05 [1/1(3)] Notmuch Test Suite; message 0 (inbox unread) +EOF +notmuch search id:duplicate | notmuch_search_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +rm ${MAIL_DIR}/copy0 +test_begin_subtest 'Deleted first duplicate file does not stop notmuch show from working' +output=$(notmuch show --body=false --format=json id:duplicate | + notmuch_json_show_sanitize | sed 's/message [0-9]/A_SUBJECT/') +expected='[[[{ + "id": "XXXXX", + "match": true, + "excluded": false, + "filename": [ + "'"${MAIL_DIR}"/copy0'", + "'"${MAIL_DIR}"/copy1'", + "'"${MAIL_DIR}"/copy2'" + ], + "timestamp": 42, + "date_relative": "2001-01-05", + "tags": ["inbox","unread"], + "headers": { + "Subject": "A_SUBJECT", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "Date": "GENERATED_DATE" + } + }, +[]]]]' + +test_expect_equal_json "$output" "$expected" + +test_done diff --git a/test/T680-html-indexing.sh b/test/T680-html-indexing.sh new file mode 100755 index 00000000..62ba8498 --- /dev/null +++ b/test/T680-html-indexing.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +test_description="indexing of html parts" +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus html + +test_begin_subtest 'embedded images should not be indexed' +notmuch search kwpza7svrgjzqwi8fhb2msggwtxtwgqcxp4wbqr4wjddstqmeqa7 > OUTPUT +test_expect_equal_file /dev/null OUTPUT + +test_begin_subtest 'ignore > in attribute text' +notmuch search swordfish | notmuch_search_sanitize > OUTPUT +test_expect_equal_file /dev/null OUTPUT + +test_begin_subtest 'non tag text should be indexed' +notmuch search hunter2 | notmuch_search_sanitize > OUTPUT +cat <<EOF > EXPECTED +thread:XXX 2009-11-17 [1/1] David Bremner; test html attachment (inbox unread) +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T690-command-line-args.sh b/test/T690-command-line-args.sh new file mode 100755 index 00000000..9aa47611 --- /dev/null +++ b/test/T690-command-line-args.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash + +test_description="command line arguments" +. $(dirname "$0")/test-lib.sh || exit 1 + +add_message + +test_begin_subtest 'bad option to show' +notmuch show --frobnicate >& OUTPUT +cat <<EOF > EXPECTED +Unrecognized option: --frobnicate +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'string option with space' +cp /dev/null EXPECTED +notmuch dump --output foo.txt '*' >& OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'string option with =' +cp /dev/null EXPECTED +notmuch dump --output=foo.txt '*' >& OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'string option with :' +cp /dev/null EXPECTED +notmuch dump --output:foo.txt '*' >& OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'single keyword option with space' +cat <<EOF > EXPECTED +id:msg-001@notmuch-test-suite +EOF +notmuch search --output messages '*' >& OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'single keyword option with =' +cat <<EOF > EXPECTED +id:msg-001@notmuch-test-suite +EOF +notmuch search --output=messages '*' >& OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'single keyword option with :' +cat <<EOF > EXPECTED +id:msg-001@notmuch-test-suite +EOF +notmuch search --output:messages '*' >& OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'multiple keyword options with space' +cat <<EOF > EXPECTED +["msg-001@notmuch-test-suite"] +EOF +notmuch search --output messages --format json '*' >& OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'multiple keyword options with =' +cat <<EOF > EXPECTED +["msg-001@notmuch-test-suite"] +EOF +notmuch search --output=messages --format=json '*' >& OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'mixed space and = delimiters' +cat <<EOF > EXPECTED +["msg-001@notmuch-test-suite"] +EOF +notmuch search --output messages --format=json '*' >& OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'mixed space and : delimiters' +cat <<EOF > EXPECTED +["msg-001@notmuch-test-suite"] +EOF +notmuch search --output:messages --format json '*' >& OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'show --entire-thread' +test_expect_success 'notmuch show --entire-thread tag:test > /dev/null' + +test_begin_subtest 'show --exclude' +test_expect_success 'notmuch show --exclude tag:test > /dev/null' + +test_done diff --git a/test/T700-reindex.sh b/test/T700-reindex.sh new file mode 100755 index 00000000..9e795896 --- /dev/null +++ b/test/T700-reindex.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +test_description='reindexing messages' +. $(dirname "$0")/test-lib.sh || exit 1 + +add_email_corpus + +notmuch tag +usertag1 '*' + +notmuch search '*' | notmuch_search_sanitize > initial-threads +notmuch search --output=messages '*' > initial-message-ids +notmuch dump > initial-dump + +test_begin_subtest 'reindex preserves threads' +notmuch reindex '*' +notmuch search '*' | notmuch_search_sanitize > OUTPUT +test_expect_equal_file initial-threads OUTPUT + +test_begin_subtest 'reindex after removing duplicate file preserves threads' +# remove one copy +sed 's,3/3(4),3/3,' < initial-threads > EXPECTED +mv $MAIL_DIR/bar/18:2, duplicate-msg-1.eml +notmuch reindex '*' +notmuch search '*' | notmuch_search_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'reindex preserves message-ids' +notmuch reindex '*' +notmuch search --output=messages '*' > OUTPUT +test_expect_equal_file initial-message-ids OUTPUT + +test_begin_subtest 'reindex preserves tags' +notmuch reindex '*' +notmuch dump > OUTPUT +test_expect_equal_file initial-dump OUTPUT + +test_begin_subtest 'reindex moves a message between threads' +notmuch search --output=threads id:87iqd9rn3l.fsf@vertex.dottedmag > EXPECTED +# re-parent +sed -i 's/1258471718-6781-1-git-send-email-dottedmag@dottedmag.net/87iqd9rn3l.fsf@vertex.dottedmag/' $MAIL_DIR/02:2,* +notmuch reindex id:1258471718-6781-2-git-send-email-dottedmag@dottedmag.net +notmuch search --output=threads id:1258471718-6781-2-git-send-email-dottedmag@dottedmag.net > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest 'reindex detects removal of all files' +notmuch search --output=messages not id:20091117232137.GA7669@griffis1.net> EXPECTED +# remove both copies +mv $MAIL_DIR/cur/51:2,* duplicate-message-2.eml +notmuch reindex id:20091117232137.GA7669@griffis1.net +notmuch search --output=messages '*' > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "reindex preserves properties" +cat <<EOF > prop-dump +#= 1258471718-6781-1-git-send-email-dottedmag@dottedmag.net userprop=userval +#= 1258471718-6781-2-git-send-email-dottedmag@dottedmag.net userprop=userval +#= 1258491078-29658-1-git-send-email-dottedmag@dottedmag.net userprop=userval1 +#= 20091117190054.GU3165@dottiness.seas.harvard.edu userprop=userval +#= 20091117203301.GV3165@dottiness.seas.harvard.edu userprop=userval3 +#= 87fx8can9z.fsf@vertex.dottedmag userprop=userval2 +#= 87iqd9rn3l.fsf@vertex.dottedmag userprop=userval +#= 87lji4lx9v.fsf@yoom.home.cworth.org userprop=userval3 +#= 87lji5cbwo.fsf@yoom.home.cworth.org userprop=userval +#= cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com userprop=userval +EOF +notmuch restore < prop-dump +notmuch reindex '*' +notmuch dump | grep '^#=' | sort > OUTPUT +test_expect_equal_file prop-dump OUTPUT + +add_email_corpus lkml + +test_begin_subtest "reindex of lkml corpus preserves threads" +notmuch search '*' | notmuch_search_sanitize > EXPECTED +notmuch reindex '*' +notmuch search '*' | notmuch_search_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_done diff --git a/test/T710-message-id.sh b/test/T710-message-id.sh new file mode 100755 index 00000000..e73d6ba9 --- /dev/null +++ b/test/T710-message-id.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +test_description="message id parsing" + +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "good message ids" +${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT +<018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org> +<1530507300.raoomurnbf.astroid@strange.none> +<1258787708-21121-2-git-send-email-keithp@keithp.com> +EOF +cat <<EOF >EXPECTED +GOOD: 018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org +GOOD: 1530507300.raoomurnbf.astroid@strange.none +GOOD: 1258787708-21121-2-git-send-email-keithp@keithp.com +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "leading and trailing space is OK" +${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT + <018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org> +<1530507300.raoomurnbf.astroid@strange.none> + <1258787708-21121-2-git-send-email-keithp@keithp.com> +EOF +cat <<EOF >EXPECTED +GOOD: 018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org +GOOD: 1530507300.raoomurnbf.astroid@strange.none +GOOD: 1258787708-21121-2-git-send-email-keithp@keithp.com +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "<> delimeters are required" +${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT +018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org> +<1530507300.raoomurnbf.astroid@strange.none +1258787708-21121-2-git-send-email-keithp@keithp.com +EOF +cat <<EOF >EXPECTED +BAD: 018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org> +BAD: <1530507300.raoomurnbf.astroid@strange.none +BAD: 1258787708-21121-2-git-send-email-keithp@keithp.com +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "embedded whitespace is forbidden" +${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT +<018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915 .git.jani@nikula.org> +<1530507300.raoomurnbf.astroid @strange.none> +<1258787708-21121-2-git-send-email-keithp@keithp.com> +EOF +cat <<EOF >EXPECTED +BAD: <018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915 .git.jani@nikula.org> +BAD: <1530507300.raoomurnbf.astroid @strange.none> +BAD: <1258787708-21121-2-git-send-email-keithp@keithp.com> +EOF +test_expect_equal_file EXPECTED OUTPUT + + +test_begin_subtest "folded real life bad In-Reply-To values" +${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT +<22597.31869.380767.339702@chiark.greenend.org.uk> (Ian Jackson's message of "Mon, 5 Dec 2016 14:41:01 +0000") +<20170625141242.loaalhis2eodo66n@gaara.hadrons.org> <149719990964.27883.13021127452105787770.reportbug@seneca.home.org> +Your message of Tue, 09 Dec 2014 13:21:11 +0100. <1900758.CgLNVPbY9N@liber> +EOF +cat <<EOF >EXPECTED +BAD: <22597.31869.380767.339702@chiark.greenend.org.uk> (Ian Jackson's message of "Mon, 5 Dec 2016 14:41:01 +0000") +BAD: <20170625141242.loaalhis2eodo66n@gaara.hadrons.org> <149719990964.27883.13021127452105787770.reportbug@seneca.home.org> +BAD: Your message of Tue, 09 Dec 2014 13:21:11 +0100. <1900758.CgLNVPbY9N@liber> +EOF +test_expect_equal_file EXPECTED OUTPUT + + +test_done diff --git a/test/aggregate-results.sh b/test/aggregate-results.sh new file mode 100755 index 00000000..63228546 --- /dev/null +++ b/test/aggregate-results.sh @@ -0,0 +1,93 @@ +#!/usr/bin/env bash + +set -eu + +fixed=0 +success=0 +failed=0 +broken=0 +total=0 + +for file +do + while read type value + do + case $type in + '') + continue ;; + fixed) + fixed=$(($fixed + $value)) ;; + success) + success=$(($success + $value)) ;; + failed) + failed=$(($failed + $value)) ;; + broken) + broken=$(($broken + $value)) ;; + total) + total=$(($total + $value)) ;; + esac + done <"$file" +done + +pluralize () { + case $2 in + 1) + case $1 in + test) + echo test ;; + failure) + echo failure ;; + esac + ;; + *) + case $1 in + test) + echo tests ;; + failure) + echo failures ;; + esac + ;; + esac +} + +echo "Notmuch test suite complete." +if [ "$fixed" = "0" ] && [ "$failed" = "0" ]; then + tests=$(pluralize "test" $total) + printf "All $total $tests " + if [ "$broken" = "0" ]; then + echo "passed." + else + failures=$(pluralize "failure" $broken) + echo "behaved as expected ($broken expected $failures)." + fi; +else + echo "$success/$total tests passed." + if [ "$broken" != "0" ]; then + tests=$(pluralize "test" $broken) + echo "$broken broken $tests failed as expected." + fi + if [ "$fixed" != "0" ]; then + tests=$(pluralize "test" $fixed) + echo "$fixed broken $tests now fixed." + fi + if [ "$failed" != "0" ]; then + tests=$(pluralize "test" $failed) + echo "$failed $tests failed." + fi +fi + +skipped=$(($total - $fixed - $success - $failed - $broken)) +if [ "$skipped" != "0" ]; then + tests=$(pluralize "test" $skipped) + echo "$skipped $tests skipped." +fi + +# Note that we currently do not consider skipped tests as failing the +# build. + +if [ $success -gt 0 -a $fixed -eq 0 -a $failed -eq 0 ] +then + exit 0 +else + exit 1 +fi diff --git a/test/arg-test.c b/test/arg-test.c new file mode 100644 index 00000000..a218f967 --- /dev/null +++ b/test/arg-test.c @@ -0,0 +1,85 @@ +#include <stdio.h> +#include "command-line-arguments.h" + + +int main(int argc, char **argv){ + + int opt_index=1; + + int kw_val=0; + int kwb_val=0; + int fl_val=0; + int int_val=0; + const char *pos_arg1=NULL; + const char *pos_arg2=NULL; + const char *string_val=NULL; + bool bool_val = false; + bool fl_set = false, int_set = false, bool_set = false, kwb_set = false, + kw_set = false, string_set = false, pos1_set = false, pos2_set = false; + + notmuch_opt_desc_t parent_options[] = { + { .opt_flags = &fl_val, .name = "flag", .present = &fl_set, .keywords = + (notmuch_keyword_t []){ { "one", 1 << 0}, + { "two", 1 << 1 }, + { "three", 1 << 2 }, + { 0, 0 } } }, + { .opt_int = &int_val, .name = "int", .present = &int_set }, + { } + }; + + notmuch_opt_desc_t options[] = { + { .opt_bool = &bool_val, .name = "boolean", .present = &bool_set }, + { .opt_keyword = &kw_val, .name = "keyword", .present = &kw_set, .keywords = + (notmuch_keyword_t []){ { "zero", 0 }, + { "one", 1 }, + { "two", 2 }, + { 0, 0 } } }, + { .opt_keyword = &kwb_val, .name = "boolkeyword", .present = &kwb_set, + .keyword_no_arg_value = "true", .keywords = + (notmuch_keyword_t []){ { "false", 0 }, + { "true", 1 }, + { "auto", 2 }, + { 0, 0 } } }, + { .opt_inherit = parent_options }, + { .opt_string = &string_val, .name = "string", .present = &string_set }, + { .opt_position = &pos_arg1, .present = &pos1_set }, + { .opt_position = &pos_arg2, .present = &pos2_set }, + { } + }; + + opt_index = parse_arguments(argc, argv, options, 1); + + if (opt_index < 0) + return 1; + + if (bool_set) + printf("boolean %d\n", bool_val); + + if (kw_set) + printf("keyword %d\n", kw_val); + + if (kwb_set) + printf("boolkeyword %d\n", kwb_val); + + if (fl_set) + printf("flags %d\n", fl_val); + + if (int_set) + printf("int %d\n", int_val); + + if (string_set) + printf("string %s\n", string_val); + + if (pos1_set) + printf("positional arg 1 %s\n", pos_arg1); + + if (pos2_set) + printf("positional arg 2 %s\n", pos_arg2); + + + for ( ; opt_index < argc ; opt_index ++) { + printf("non parsed arg %d = %s\n", opt_index, argv[opt_index]); + } + + return 0; +} diff --git a/test/atomicity.py b/test/atomicity.py new file mode 100644 index 00000000..389517e1 --- /dev/null +++ b/test/atomicity.py @@ -0,0 +1,78 @@ +# This gdb Python script runs notmuch new and simulates killing and +# restarting notmuch new after every Xapian commit. To simulate this +# more efficiently, this script runs notmuch new and, immediately +# after every Xapian commit, it *pauses* the running notmuch new, +# copies the entire database and maildir to a snapshot directory, and +# executes a full notmuch new on that snapshot, comparing the final +# results with the expected output. It can then resume the paused +# notmuch new, which is still running on the original maildir, and +# repeat this process. + +import gdb +import os +import glob +import shutil +import subprocess + +gdb.execute('set args new') + +# Make Xapian commit after every operation instead of batching +gdb.execute('set environment XAPIAN_FLUSH_THRESHOLD = 1') + +maildir = os.environ['MAIL_DIR'] + +# Trap calls to rename, which happens just before Xapian commits +class RenameBreakpoint(gdb.Breakpoint): + def __init__(self, *args, **kwargs): + super(RenameBreakpoint, self).__init__(*args, **kwargs) + self.last_inodes = {} + self.n = 0 + + def stop(self): + xapiandir = '%s/.notmuch/xapian' % maildir + if os.path.isfile('%s/iamchert' % xapiandir): + # As an optimization, only consider snapshots after a + # Xapian has really committed. The chert backend + # overwrites record.base? as the last step in the commit, + # so keep an eye on their inumbers. + inodes = {} + for path in glob.glob('%s/record.base*' % xapiandir): + inodes[path] = os.stat(path).st_ino + if inodes == self.last_inodes: + # Continue + return False + self.last_inodes = inodes + + # Save a backtrace in case the test does fail + backtrace = gdb.execute('backtrace', to_string=True) + open('backtrace.%d' % self.n, 'w').write(backtrace) + + # Snapshot the database + shutil.rmtree('%s.snap/.notmuch' % maildir) + shutil.copytree('%s/.notmuch' % maildir, '%s.snap/.notmuch' % maildir) + # Restore the mtime of $MAIL_DIR.snap/ + shutil.copystat('%s/.notmuch' % maildir, '%s.snap/.notmuch' % maildir) + + # Run notmuch new to completion on the snapshot + env = os.environ.copy() + env.update(NOTMUCH_CONFIG=os.environ['NOTMUCH_CONFIG'] + '.snap', + XAPIAN_FLUSH_THRESHOLD='1000') + subprocess.check_call( + ['notmuch', 'new'], env=env, stdout=open('/dev/null', 'w')) + subprocess.check_call( + ['notmuch', 'search', '*'], env=env, + stdout=open('search.%d' % self.n, 'w')) + + # Tell the shell how far we've gotten + open('outcount', 'w').write(str(self.n + 1)) + + # Continue + self.n += 1 + return False +RenameBreakpoint('rename') + +try: + gdb.execute('run') +except Exception: + import traceback + raise SystemExit(traceback.format_exc()) diff --git a/test/corpora/README b/test/corpora/README new file mode 100644 index 00000000..05ea386d --- /dev/null +++ b/test/corpora/README @@ -0,0 +1,19 @@ +This directory contains email corpora for testing. + +default + The default corpus is based on about 50 messages from early in the + history of the notmuch mailing list, which allows for reliably + testing commands that need to operate on a not-totally-trivial + number of messages. + +broken + The broken corpus contains messages that are broken and/or RFC + non-compliant, ensuring we deal with them in a sane way. + +html + The html corpus contains html parts + +crypto + The crypto corpus contains encrypted messages for testing. + It should probably also contain signed messages in the future. + Please add them! diff --git a/test/corpora/broken/broken-cc b/test/corpora/broken/broken-cc new file mode 100644 index 00000000..57ae9ba9 --- /dev/null +++ b/test/corpora/broken/broken-cc @@ -0,0 +1,9 @@ +From: Alice <alice@example.org> +To: Daniel <daniel@example.org> +Cc: Bob <bob@example.org> +Subject: wowsers! +cc: Charles <charles@example.org> +Message-Id: <multiple-cc@example.org> +Date: Thu, 16 Jun 2016 22:14:41 -0400 + +Note the Cc: and cc: headers. diff --git a/test/corpora/broken/loop/loop-12 b/test/corpora/broken/loop/loop-12 new file mode 100644 index 00000000..b5c3af7e --- /dev/null +++ b/test/corpora/broken/loop/loop-12 @@ -0,0 +1,8 @@ +From: Alice <alice@example.org> +To: Daniel <daniel@example.org> +Subject: referencing in-reply-to-loop-21 +Message-ID: <mid-loop-12@example.org> +In-Reply-To: <mid-loop-21@example.org> +Date: Thu, 16 Jun 2016 22:14:41 -0400 + +Note Message-ID and In-Reply-To: in file in-reply-to-loop-21 diff --git a/test/corpora/broken/loop/loop-21 b/test/corpora/broken/loop/loop-21 new file mode 100644 index 00000000..234f0323 --- /dev/null +++ b/test/corpora/broken/loop/loop-21 @@ -0,0 +1,8 @@ +From: Alice <alice@example.org> +To: Daniel <daniel@example.org> +Subject: referencing in-reply-to-loop-12 +Message-ID: <mid-loop-21@example.org> +In-Reply-To: <mid-loop-12@example.org> +Date: Fri, 17 Jun 2016 22:14:41 -0400 + +Note Message-ID and In-Reply-To: in file in-reply-to-loop-12 diff --git a/test/corpora/crypto/simple-encrypted b/test/corpora/crypto/simple-encrypted new file mode 100644 index 00000000..6869972d --- /dev/null +++ b/test/corpora/crypto/simple-encrypted @@ -0,0 +1,36 @@ +From: Daniel Kahn Gillmor <dkg@fifthhorseman.net> +To: dkg@fifthhorseman.net +Subject: encrypted message +Date: Mon, 22 Dec 2016 08:34:56 -0400 +Message-ID: <simple-encrypted@crypto.notmuchmail.org> +MIME-Version: 1.0 +Content-Type: multipart/encrypted; boundary="=-=-="; + protocol="application/pgp-encrypted" + +--=-=-= +Content-Type: application/pgp-encrypted + +Version: 1 + +--=-=-= +Content-Type: application/octet-stream + +-----BEGIN PGP MESSAGE----- + +hQIMAzt6p/AU5ptaAQ/+IDRx5dZWKjUz9qITP76w8OvtmTV9p871UoGWil1DSd3J +dHgf56rXDWS73dzJ5EigevxLVMD3Xv8QEJBgMWb6yC+uR8ZdJ8h7hlE2lYyEg3Ch +smqzcaYp2nKWw9JZQqubsMaeIgVu0exb4YE8g/qlUOL2mD64dXhnkJ68GGMmiEPJ ++d0H7fTMwstbxvKPKDmFJUztH43V2NSfxpeQUTi4iWmQtUGw6THYjjAWNFy7jVEE +ozloT9W3ER5cRaXyKE4GWMBlUAOB0YwwsVnBU2JGUtTBzNHxQAbeoKrG6myrzmnC +LhUNag0gMuNEbGR78XfWKpCbccEC1VLf9uUXze6yeuRXDuhfsvilKOH9MpaR9n+G +JuYVAAobDc5wGOt5VGMka50ToaALrNt3FrWqni/0jqwqshEVKM3Kqzq6cSjh1TPf +pfxE9aUDdvf+Nn16ZBGgyLox2NV4GkSQYq2ySzAk3XwLU80F0nCmtOV3EH+OMrv6 +sZI/Svwzaqzrs/w17cvpf0czXjE/N9V1MHdNtIkfb707WkO0l9/wtYvlrg/KyrU2 +FH5aecEO9VpMumgzBqP1MrrnzVlSM3kgRLIu06oshQYD+jjFn2YzvkwZ+pWoAxsQ +ninQxoF8Ck2D7s8uGzx+HSQQpRVBM5AGfVdEkmzW/sZrlz63ZGUFh0FYqLl30rfS +cQGqSoZz0ugTSxnTlg0nuzFmG7ylC1cx3dlSrnfv+l1azwLAr58ptoYZ0mO+D+Fy +bePpCGoFAPKi0cZ/4eFlLKL7uYPmGeEo5Ku2wXU/SXtPfl4vRxzvPXTJTvD06vIx +Dh1P0ChAJtxUjGGY6xkCHMY0 +=frmz +-----END PGP MESSAGE----- +--=-=-=-- diff --git a/test/corpora/default/01:2, b/test/corpora/default/01:2, new file mode 100644 index 00000000..7e9e3490 --- /dev/null +++ b/test/corpora/default/01:2, @@ -0,0 +1,34 @@ +From: "Mikhail Gusarov" <dottedmag@dottedmag.net> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 21:28:37 +0600 +Subject: [notmuch] [PATCH 1/2] Close message file after parsing message + headers +Message-ID: <1258471718-6781-1-git-send-email-dottedmag@dottedmag.net> + +Keeping unused files open helps to see "Too many open files" often. + +Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net> +--- + lib/message-file.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/lib/message-file.c b/lib/message-file.c +index 8a3f8ee..197ab01 100644 +--- a/lib/message-file.c ++++ b/lib/message-file.c +@@ -325,6 +325,11 @@ notmuch_message_file_get_header (notmuch_message_file_t *message, + return decoded_value; + } + ++ if (message->parsing_finished) { ++ fclose (message->file); ++ message->file = NULL; ++ } ++ + if (message->line) + free (message->line); + message->line = NULL; +-- +1.6.3.3 + + diff --git a/test/corpora/default/02:2, b/test/corpora/default/02:2, new file mode 100644 index 00000000..dadcdaac --- /dev/null +++ b/test/corpora/default/02:2, @@ -0,0 +1,32 @@ +From: "Mikhail Gusarov" <dottedmag@dottedmag.net> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 21:28:38 +0600 +Subject: [notmuch] [PATCH 2/2] Include <stdint.h> to get uint32_t in C++ + file with gcc 4.4 +In-Reply-To: <1258471718-6781-1-git-send-email-dottedmag@dottedmag.net> +References: <1258471718-6781-1-git-send-email-dottedmag@dottedmag.net> +Message-ID: <1258471718-6781-2-git-send-email-dottedmag@dottedmag.net> + + +Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net> +--- + lib/message.cc | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/lib/message.cc b/lib/message.cc +index 72c350f..a4b090b 100644 +--- a/lib/message.cc ++++ b/lib/message.cc +@@ -21,6 +21,8 @@ + #include "notmuch-private.h" + #include "database-private.h" + ++#include <stdint.h> ++ + #include <gmime/gmime.h> + + #include <xapian.h> +-- +1.6.3.3 + + diff --git a/test/corpora/default/bar/17:2, b/test/corpora/default/bar/17:2, new file mode 100644 index 00000000..d3b75685 --- /dev/null +++ b/test/corpora/default/bar/17:2, @@ -0,0 +1,23 @@ +From: "Israel Herraiz" <isra@herraiz.org> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 23:57:18 +0100 +Subject: [notmuch] New to the list +Message-ID: <1258498485-sup-142@elly> + +Hi all, + +I have subscribed to the list. As suggested by the welcome message, I +am introducing myself. My name is Israel Herraiz, and I have done a +couple of contributions to Sup, the probably well-known here e-mail +client. + +"Not much" sounds interesting, and I wonder whether it could be +integrated with the views of Sup (inbox, threads, etc). So I have +subscribed to the list to keep an eye on what's going on here. + +I have just heard of "Not much". I have not even tried to download the +code yet. + +Cheers, +Israel + diff --git a/test/corpora/default/bar/18:2, b/test/corpora/default/bar/18:2, new file mode 100644 index 00000000..f522f69e --- /dev/null +++ b/test/corpora/default/bar/18:2, @@ -0,0 +1,12 @@ +From: "Aron Griffis" <agriffis@n01se.net> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 18:21:38 -0500 +Subject: [notmuch] archive +Message-ID: <20091117232137.GA7669@griffis1.net> + +Just subscribed, I'd like to catch up on the previous postings, +but the archive link seems to be bogus? + +Thanks, +Aron + diff --git a/test/corpora/default/bar/baz/05:2, b/test/corpora/default/bar/baz/05:2, new file mode 100644 index 00000000..75b05fa4 --- /dev/null +++ b/test/corpora/default/bar/baz/05:2, @@ -0,0 +1,104 @@ +MIME-Version: 1.0 +Date: Tue, 17 Nov 2009 11:36:14 -0800 +Message-ID: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com> +From: Alex Botero-Lowry <alex.boterolowry@gmail.com> +To: notmuch@notmuchmail.org +Content-Type: multipart/mixed; boundary=0016e687869333b1570478963d35 +Subject: [notmuch] preliminary FreeBSD support +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +Sender: notmuch-bounces@notmuchmail.org +Errors-To: notmuch-bounces@notmuchmail.org + +--0016e687869333b1570478963d35 +Content-Type: multipart/alternative; boundary=0016e687869333b14e0478963d33 + +--0016e687869333b14e0478963d33 +Content-Type: text/plain; charset=ISO-8859-1 + +I saw the announcement this morning, and was very excited, as I had been +hoping sup would be turned into a library, +since I like the concept more than the UI (I'd rather an emacs interface). + +I did a preliminary compile which worked out fine, but +sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns -1 on +FreeBSD, so notmuch_config_open segfaulted. + +Attached is a patch that supplies a default buffer size of 64 in cases where +-1 is returned. + +http://www.opengroup.org/austin/docs/austin_328.txt - seems to indicate this +is acceptable behavior, +and http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.htmlspecifically +uses 64 as the +buffer size. + +--0016e687869333b14e0478963d33 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: quoted-printable + +I saw the announcement this morning, and was very excited, as I had been ho= +ping sup would be turned into a library,<br>since I like the concept more t= +han the UI (I'd rather an emacs interface).<br><br>I did a preliminary = +compile which worked out fine, but sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns= + -1 on<br> +FreeBSD, so notmuch_config_open segfaulted.<br><br>Attached is a patch that= + supplies a default buffer size of 64 in cases where -1 is returned.<br><br= +><a href=3D"http://www.opengroup.org/austin/docs/austin_328.txt">http://www= +.opengroup.org/austin/docs/austin_328.txt</a> - seems to indicate this is a= +cceptable behavior,<br> +and <a href=3D"http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg01680= +8.html">http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.html<= +/a> specifically uses 64 as the<br>buffer size.<br><br><br> + +--0016e687869333b14e0478963d33-- +--0016e687869333b1570478963d35 +Content-Type: application/octet-stream; + name="0001-Deal-with-situation-where-sysconf-_SC_GETPW_R_SIZE_M.patch" +Content-Disposition: attachment; + filename="0001-Deal-with-situation-where-sysconf-_SC_GETPW_R_SIZE_M.patch" +Content-Transfer-Encoding: base64 +X-Attachment-Id: f_g252e6gs0 + +RnJvbSBlM2JjNGJiZDdiOWQwZDA4NjgxNmFiNWY4ZjJkNmZmZWExZGQzZWE0IE1vbiBTZXAgMTcg +MDA6MDA6MDAgMjAwMQpGcm9tOiBBbGV4YW5kZXIgQm90ZXJvLUxvd3J5IDxhbGV4LmJvdGVyb2xv +d3J5QGdtYWlsLmNvbT4KRGF0ZTogVHVlLCAxNyBOb3YgMjAwOSAxMTozMDozOSAtMDgwMApTdWJq +ZWN0OiBbUEFUQ0hdIERlYWwgd2l0aCBzaXR1YXRpb24gd2hlcmUgc3lzY29uZihfU0NfR0VUUFdf +Ul9TSVpFX01BWCkgcmV0dXJucyAtMQoKLS0tCiBub3RtdWNoLWNvbmZpZy5jIHwgICAgMiArKwog +MSBmaWxlcyBjaGFuZ2VkLCAyIGluc2VydGlvbnMoKyksIDAgZGVsZXRpb25zKC0pCgpkaWZmIC0t +Z2l0IGEvbm90bXVjaC1jb25maWcuYyBiL25vdG11Y2gtY29uZmlnLmMKaW5kZXggMjQ4MTQ5Yy4u +ZTcyMjBkOCAxMDA2NDQKLS0tIGEvbm90bXVjaC1jb25maWcuYworKysgYi9ub3RtdWNoLWNvbmZp +Zy5jCkBAIC03Nyw2ICs3Nyw3IEBAIHN0YXRpYyBjaGFyICoKIGdldF9uYW1lX2Zyb21fcGFzc3dk +X2ZpbGUgKHZvaWQgKmN0eCkKIHsKICAgICBsb25nIHB3X2J1Zl9zaXplID0gc3lzY29uZihfU0Nf +R0VUUFdfUl9TSVpFX01BWCk7CisgICAgaWYgKHB3X2J1Zl9zaXplID09IC0xKSBwd19idWZfc2l6 +ZSA9IDY0OwogICAgIGNoYXIgKnB3X2J1ZiA9IHRhbGxvY196ZXJvX3NpemUgKGN0eCwgcHdfYnVm +X3NpemUpOwogICAgIHN0cnVjdCBwYXNzd2QgcGFzc3dkLCAqaWdub3JlZDsKICAgICBjaGFyICpu +YW1lOwpAQCAtMTAxLDYgKzEwMiw3IEBAIHN0YXRpYyBjaGFyICoKIGdldF91c2VybmFtZV9mcm9t +X3Bhc3N3ZF9maWxlICh2b2lkICpjdHgpCiB7CiAgICAgbG9uZyBwd19idWZfc2l6ZSA9IHN5c2Nv +bmYoX1NDX0dFVFBXX1JfU0laRV9NQVgpOworICAgIGlmIChwd19idWZfc2l6ZSA9PSAtMSkgcHdf +YnVmX3NpemUgPSA2NDsKICAgICBjaGFyICpwd19idWYgPSB0YWxsb2NfemVyb19zaXplIChjdHgs +IHB3X2J1Zl9zaXplKTsKICAgICBzdHJ1Y3QgcGFzc3dkIHBhc3N3ZCwgKmlnbm9yZWQ7CiAgICAg +Y2hhciAqbmFtZTsKLS0gCjEuNi41LjIKCg== +--0016e687869333b1570478963d35 +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch + +--0016e687869333b1570478963d35-- + diff --git a/test/corpora/default/bar/baz/23:2, b/test/corpora/default/bar/baz/23:2, new file mode 100644 index 00000000..9bb62d73 --- /dev/null +++ b/test/corpora/default/bar/baz/23:2, @@ -0,0 +1,145 @@ +Date: Tue, 17 Nov 2009 19:58:29 -0500 +From: Lars Kellogg-Stedman <lars@seas.harvard.edu> +To: notmuch <notmuch@notmuchmail.org> +Message-ID: <20091118005829.GB25380@dottiness.seas.harvard.edu> +MIME-Version: 1.0 +User-Agent: Mutt/1.5.19 (2009-01-05) +Subject: [notmuch] "notmuch help" outputs to stderr? +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +Content-Type: multipart/mixed; boundary="===============1359248349==" +Sender: notmuch-bounces@notmuchmail.org +Errors-To: notmuch-bounces@notmuchmail.org + + +--===============1359248349== +Content-Type: multipart/signed; micalg=pgp-sha256; + protocol="application/pgp-signature"; boundary="L6iaP+gRLNZHKoI4" +Content-Disposition: inline + + +--L6iaP+gRLNZHKoI4 +Content-Type: multipart/mixed; boundary="z6Eq5LdranGa6ru8" +Content-Disposition: inline + + +--z6Eq5LdranGa6ru8 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +I'm just noticing that 'notmuch help ...' outputs to stderr, which +isn't terribly intuitive. For example, the obvious invocation: + + notmuch help | less + +=2E..isn't terribly helpful. + +I've attached a patch that lets usage() take a FILE * argument so that +you can output to stderr in response to usage errors, and stdout in +response to an explicit request. + +--=20 +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Senior Technologist, Computing and Information Technology +Harvard University School of Engineering and Applied Sciences + + +--z6Eq5LdranGa6ru8 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: attachment; filename="notmuch-help.patch" +Content-Transfer-Encoding: quoted-printable + +diff --git a/notmuch.c b/notmuch.c +index c47e640..a35cb99 100644 +--- a/notmuch.c ++++ b/notmuch.c +@@ -157,23 +157,23 @@ command_t commands[] =3D { + }; +=20 + static void +-usage (void) ++usage (FILE *out) + { + command_t *command; + unsigned int i; +=20 +- fprintf (stderr, "Usage: notmuch <command> [args...]\n"); +- fprintf (stderr, "\n"); +- fprintf (stderr, "Where <command> and [args...] are as follows:\n"); +- fprintf (stderr, "\n"); ++ fprintf (out, "Usage: notmuch <command> [args...]\n"); ++ fprintf (out, "\n"); ++ fprintf (out, "Where <command> and [args...] are as follows:\n"); ++ fprintf (out, "\n"); +=20 + for (i =3D 0; i < ARRAY_SIZE (commands); i++) { + command =3D &commands[i]; +=20 +- fprintf (stderr, "\t%s\t%s\n\n", command->name, command->summary); ++ fprintf (out, "\t%s\t%s\n\n", command->name, command->summary); + } +=20 +- fprintf (stderr, "Use \"notmuch help <command>\" for more details on e= +ach command.\n\n"); ++ fprintf (out, "Use \"notmuch help <command>\" for more details on each= + command.\n\n"); + } +=20 + static int +@@ -183,8 +183,8 @@ notmuch_help_command (unused (void *ctx), int argc, cha= +r *argv[]) + unsigned int i; +=20 + if (argc =3D=3D 0) { +- fprintf (stderr, "The notmuch mail system.\n\n"); +- usage (); ++ fprintf (stdout, "The notmuch mail system.\n\n"); ++ usage (stdout); + return 0; + } +=20 + +--z6Eq5LdranGa6ru8-- + +--L6iaP+gRLNZHKoI4 +Content-Type: application/pgp-signature +Content-Disposition: inline + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQEcBAEBCAAGBQJLA0a1AAoJENdGlQYxQazYr78IAJtqTWIpBqSdOWqTzt/r4XNn +KJ5mWAoNfq4H+3kx3xoWOFYS7qAYeJoHQWCDbMdb+zEXvPX6hMFn9+OxRN+N5FdQ +uxGTugSG9xSsK28oGDCQUtr5uheo+tH0jygPjI+LTD97vjUYS4K2qzhLGFJmpLcj +1akMJXM0gSdPZT8dJyjxvC15pgboLspE4+b6jexXmd4UoFvXgqvjkYHeV4Wk+s0L +xu+HkCGXL9WHYc3t171fFAru4Zd1AUxFQl4BZ2Y+OqRZUrD28Mtz3zGQxbJQoifl +JFrgPAWioLN71SkVq/y+efjvGSl0osPpKU5dftMmyY1zV7k7mMlO08ZSJU+wANA= +=Iijt +-----END PGP SIGNATURE----- + +--L6iaP+gRLNZHKoI4-- + +--===============1359248349== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch + +--===============1359248349==-- + diff --git a/test/corpora/default/bar/baz/24:2, b/test/corpora/default/bar/baz/24:2, new file mode 100644 index 00000000..c8000207 --- /dev/null +++ b/test/corpora/default/bar/baz/24:2, @@ -0,0 +1,204 @@ +Return-path: <notmuch-bounces@notmuchmail.org> +Envelope-to: cworth@localhost +Delivery-date: Wed, 18 Nov 2009 01:43:47 -0800 +Received: from yoom.home.cworth.org ([127.0.0.1]) + by yoom.home.cworth.org with esmtp (Exim 4.69) + (envelope-from <notmuch-bounces@notmuchmail.org>) + id 1NAgpH-0005Ab-20 + for cworth@localhost; Wed, 18 Nov 2009 01:27:47 -0800 +X-Original-To: cworth@cworth.org +Delivered-To: cworth@cworth.org +Received: from olra.theworths.org [82.165.184.25] + by yoom.home.cworth.org with IMAP (fetchmail-6.3.9-rc2) + for <cworth@localhost> (single-drop); Wed, 18 Nov 2009 01:27:47 -0800 (PST) +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 12248431FC3 + for <cworth@cworth.org>; Tue, 17 Nov 2009 17:01:22 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -6.17 +X-Spam-Level: +X-Spam-Status: No, score=-6.17 tagged_above=-999 required=2 tests=[AWL=0.429, + BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4] autolearn=unavailable +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id TmBdVd1i-Wjb; Tue, 17 Nov 2009 17:01:20 -0800 (PST) +Received: from olra.theworths.org (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id AF876431FBC; + Tue, 17 Nov 2009 17:01:20 -0800 (PST) +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 75784431FBC + for <notmuch@notmuchmail.org>; Tue, 17 Nov 2009 17:01:19 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id IoYHzHoKBskU for <notmuch@notmuchmail.org>; + Tue, 17 Nov 2009 17:01:18 -0800 (PST) +Received: from smtp-outbound.seas.harvard.edu (smtp-outbound.seas.harvard.edu + [140.247.51.171]) + by olra.theworths.org (Postfix) with ESMTP id 7E033431FAE + for <notmuch@notmuchmail.org>; Tue, 17 Nov 2009 17:01:18 -0800 (PST) +Received: from dottiness.seas.harvard.edu (dottiness.seas.harvard.edu + [140.247.52.224]) + by smtp-outbound.seas.harvard.edu (8.13.8/8.13.8) with SMTP id + nAI11Gkj008772 + for <notmuch@notmuchmail.org>; Tue, 17 Nov 2009 20:01:16 -0500 +Received: by dottiness.seas.harvard.edu (sSMTP sendmail emulation); + Tue, 17 Nov 2009 20:01:16 -0500 +Date: Tue, 17 Nov 2009 20:01:16 -0500 +From: Lars Kellogg-Stedman <lars@seas.harvard.edu> +To: notmuch <notmuch@notmuchmail.org> +Message-ID: <20091118010116.GC25380@dottiness.seas.harvard.edu> +References: <20091118005829.GB25380@dottiness.seas.harvard.edu> +MIME-Version: 1.0 +In-Reply-To: <20091118005829.GB25380@dottiness.seas.harvard.edu> +User-Agent: Mutt/1.5.19 (2009-01-05) +Subject: Re: [notmuch] "notmuch help" outputs to stderr? +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +Content-Type: multipart/mixed; boundary="===============0848253760==" +Sender: notmuch-bounces@notmuchmail.org +Errors-To: notmuch-bounces@notmuchmail.org + + +--===============0848253760== +Content-Type: multipart/signed; micalg=pgp-sha256; + protocol="application/pgp-signature"; boundary="ZInfyf7laFu/Kiw7" +Content-Disposition: inline + + +--ZInfyf7laFu/Kiw7 +Content-Type: multipart/mixed; boundary="KdquIMZPjGJQvRdI" +Content-Disposition: inline + + +--KdquIMZPjGJQvRdI +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +> I've attached a patch that lets usage() take a FILE * argument so that +> you can output to stderr in response to usage errors, and stdout in +> response to an explicit request. + +Whoops, missed a couple of stderr's in that last patch. New one +attached. + +--=20 +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Senior Technologist, Computing and Information Technology +Harvard University School of Engineering and Applied Sciences + + +--KdquIMZPjGJQvRdI +Content-Type: text/plain; charset=us-ascii +Content-Disposition: attachment; filename="notmuch-help.patch" +Content-Transfer-Encoding: quoted-printable + +diff --git a/notmuch.c b/notmuch.c +index c47e640..446c810 100644 +--- a/notmuch.c ++++ b/notmuch.c +@@ -157,23 +157,23 @@ command_t commands[] =3D { + }; +=20 + static void +-usage (void) ++usage (FILE *out) + { + command_t *command; + unsigned int i; +=20 +- fprintf (stderr, "Usage: notmuch <command> [args...]\n"); +- fprintf (stderr, "\n"); +- fprintf (stderr, "Where <command> and [args...] are as follows:\n"); +- fprintf (stderr, "\n"); ++ fprintf (out, "Usage: notmuch <command> [args...]\n"); ++ fprintf (out, "\n"); ++ fprintf (out, "Where <command> and [args...] are as follows:\n"); ++ fprintf (out, "\n"); +=20 + for (i =3D 0; i < ARRAY_SIZE (commands); i++) { + command =3D &commands[i]; +=20 +- fprintf (stderr, "\t%s\t%s\n\n", command->name, command->summary); ++ fprintf (out, "\t%s\t%s\n\n", command->name, command->summary); + } +=20 +- fprintf (stderr, "Use \"notmuch help <command>\" for more details on e= +ach command.\n\n"); ++ fprintf (out, "Use \"notmuch help <command>\" for more details on each= + command.\n\n"); + } +=20 + static int +@@ -183,8 +183,8 @@ notmuch_help_command (unused (void *ctx), int argc, cha= +r *argv[]) + unsigned int i; +=20 + if (argc =3D=3D 0) { +- fprintf (stderr, "The notmuch mail system.\n\n"); +- usage (); ++ fprintf (stdout, "The notmuch mail system.\n\n"); ++ usage (stdout); + return 0; + } +=20 +@@ -192,8 +192,8 @@ notmuch_help_command (unused (void *ctx), int argc, cha= +r *argv[]) + command =3D &commands[i]; +=20 + if (strcmp (argv[0], command->name) =3D=3D 0) { +- fprintf (stderr, "Help for \"notmuch %s\":\n\n", argv[0]); +- fprintf (stderr, "\t%s\t%s\n\n%s\n\n", command->name, ++ fprintf (stdout, "Help for \"notmuch %s\":\n\n", argv[0]); ++ fprintf (stdout, "\t%s\t%s\n\n%s\n\n", command->name, + command->summary, command->documentation); + return 0; + } + +--KdquIMZPjGJQvRdI-- + +--ZInfyf7laFu/Kiw7 +Content-Type: application/pgp-signature +Content-Disposition: inline + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQEcBAEBCAAGBQJLA0dcAAoJENdGlQYxQazY4nIIAIBCds86/uTmnouvyoPruUUR +Bg5mXcnjuopz1Nwotl9s9U5sGeZuZngxyEvDz1Z1aTEjwab8ndNTf1xCwIoqBs+l +i/sc4nPYubLdy1Ab/84DKVtCSbj+v5rtqhegwUWV7S1BY7t8dKNPNv7YBg7P0Azs +6s3CUxDV5eJCcxCGxxWHH8JDKRf7rDs6vzDwyPWLxlg1Xb1lEM/sRgPCKiShPdO3 +Ak2hECusjskALhSDYX8/FLMd9HwLBC13sfWuSi/pHUAIOI2jru2p5sXrVSlTnFIJ +fiMbPhKWiEaJj2kmm4pRwAhbTWp/J8ZvXWp0AyosxXQhQUWqujiyxgfiXS70SdQ= +=t3Yc +-----END PGP SIGNATURE----- + +--ZInfyf7laFu/Kiw7-- + +--===============0848253760== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch + +--===============0848253760==-- + diff --git a/test/corpora/default/bar/baz/cur/25:2, b/test/corpora/default/bar/baz/cur/25:2, new file mode 100644 index 00000000..7378f820 --- /dev/null +++ b/test/corpora/default/bar/baz/cur/25:2, @@ -0,0 +1,32 @@ +From: "Stewart Smith" <stewart@flamingspork.com> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 12:05:53 +1100 +Subject: [notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ + libs. +Message-ID: <1258506353-20352-1-git-send-email-stewart@flamingspork.com> + +Previously, Ubuntu 9.10, gcc 4.4.1 was getting: + +ccache gcc `pkg-config --libs glib-2.0 gmime-2.4 talloc` `xapian-config --libs` notmuch.o notmuch-config.o notmuch-dump.o notmuch-new.o notmuch-reply.o notmuch-restore.o notmuch-search.o notmuch-setup.o notmuch-show.o notmuch-tag.o notmuch-time.o gmime-filter-reply.o query-string.o show-message.o lib/notmuch.a -o notmuch +/usr/bin/ld: lib/notmuch.a(database.o): in function global constructors keyed to BOOLEAN_PREFIX_INTERNAL:database.cc(.text+0x3a): error: undefined reference to 'std::ios_base::Init::Init()' +--- + Makefile.local | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/Makefile.local b/Makefile.local +index f824bed..dbd3e20 100644 +--- a/Makefile.local ++++ b/Makefile.local +@@ -18,7 +18,7 @@ notmuch_client_srcs = \ + + notmuch_client_modules = $(notmuch_client_srcs:.c=.o) + notmuch: $(notmuch_client_modules) lib/notmuch.a +- $(CC) $(LDFLAGS) $^ -o $@ ++ $(CXX) $(LDFLAGS) $^ -o $@ + + notmuch.1.gz: + gzip --stdout notmuch.1 > notmuch.1.gz +-- +1.6.3.3 + + diff --git a/test/corpora/default/bar/baz/cur/26:2, b/test/corpora/default/bar/baz/cur/26:2, new file mode 100644 index 00000000..f3c5f53d --- /dev/null +++ b/test/corpora/default/bar/baz/cur/26:2, @@ -0,0 +1,121 @@ +From: "Stewart Smith" <stewart@flamingspork.com> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 12:56:40 +1100 +Subject: [notmuch] [PATCH 2/2] Read mail directory in inode number order +Message-ID: <1258509400-32511-1-git-send-email-stewart@flamingspork.com> + +This gives a rather decent reduction in number of seeks required when +reading a Maildir that isn't in pagecache. + +Most filesystems give some locality on disk based on inode numbers. +In ext[234] this is the inode tables, in XFS groups of sequential inode +numbers are together on disk and the most significant bits indicate +allocation group (i.e inode 1,000,000 is always after inode 1,000). + +With this patch, we read in the whole directory, sort by inode number +before stat()ing the contents. + +Ideally, directory is sequential and then we make one scan through the +file system stat()ing. + +Since the universe is not ideal, we'll probably seek during reading the +directory and a fair bit while reading the inodes themselves. + +However... with readahead, and stat()ing in inode order, we should be +in the best place possible to hit the cache. + +In a (not very good) benchmark of "how long does it take to find the first +15,000 messages in my Maildir after 'echo 3 > /proc/sys/vm/drop_caches'", +this patch consistently cut at least 8 seconds off the scan time. + +Without patch: 50 seconds +With patch: 38-42 seconds. + +(I did this in a previous maildir reading project and saw large improvements too) +--- + notmuch-new.c | 32 +++++++++++++++----------------- + 1 files changed, 15 insertions(+), 17 deletions(-) + +diff --git a/notmuch-new.c b/notmuch-new.c +index 83a05ba..11fad8c 100644 +--- a/notmuch-new.c ++++ b/notmuch-new.c +@@ -73,6 +73,11 @@ add_files_print_progress (add_files_state_t *state) + fflush (stdout); + } + ++static int ino_cmp(const struct dirent **a, const struct dirent **b) ++{ ++ return ((*a)->d_ino < (*b)->d_ino)? -1: 1; ++} ++ + /* Examine 'path' recursively as follows: + * + * o Ask the filesystem for the mtime of 'path' (path_mtime) +@@ -100,13 +105,12 @@ add_files_recursive (notmuch_database_t *notmuch, + add_files_state_t *state) + { + DIR *dir = NULL; +- struct dirent *e, *entry = NULL; +- int entry_length; +- int err; ++ struct dirent *entry = NULL; + char *next = NULL; + time_t path_mtime, path_dbtime; + notmuch_status_t status, ret = NOTMUCH_STATUS_SUCCESS; + notmuch_message_t *message = NULL; ++ struct dirent **namelist = NULL; + + /* If we're told to, we bail out on encountering a read-only + * directory, (with this being a clear clue from the user to +@@ -122,31 +126,23 @@ add_files_recursive (notmuch_database_t *notmuch, + path_mtime = st->st_mtime; + + path_dbtime = notmuch_database_get_timestamp (notmuch, path); ++ int n_entries= scandir(path, &namelist, 0, ino_cmp); + +- dir = opendir (path); +- if (dir == NULL) { ++ if (n_entries == -1) { + fprintf (stderr, "Error opening directory %s: %s\n", + path, strerror (errno)); + ret = NOTMUCH_STATUS_FILE_ERROR; + goto DONE; + } + +- entry_length = offsetof (struct dirent, d_name) + +- pathconf (path, _PC_NAME_MAX) + 1; +- entry = malloc (entry_length); ++ int i=0; + + while (!interrupted) { +- err = readdir_r (dir, entry, &e); +- if (err) { +- fprintf (stderr, "Error reading directory: %s\n", +- strerror (errno)); +- ret = NOTMUCH_STATUS_FILE_ERROR; +- goto DONE; +- } +- +- if (e == NULL) ++ if (i == n_entries) + break; + ++ entry= namelist[i++]; ++ + /* If this directory hasn't been modified since the last + * add_files, then we only need to look further for + * sub-directories. */ +@@ -243,6 +239,8 @@ add_files_recursive (notmuch_database_t *notmuch, + free (entry); + if (dir) + closedir (dir); ++ if (namelist) ++ free (namelist); + + return ret; + } +-- +1.6.3.3 + + diff --git a/test/corpora/default/bar/baz/new/27:2, b/test/corpora/default/bar/baz/new/27:2, new file mode 100644 index 00000000..7f0f045b --- /dev/null +++ b/test/corpora/default/bar/baz/new/27:2, @@ -0,0 +1,21 @@ +From: "Keith Packard" <keithp@keithp.com> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 17:59:49 -0800 +Subject: [notmuch] New to the list +In-Reply-To: <1258498485-sup-142@elly> +References: <1258498485-sup-142@elly> +Message-ID: <yun3a4cegoa.fsf@aiko.keithp.com> + +On Tue, 17 Nov 2009 23:57:18 +0100, Israel Herraiz <isra at herraiz.org> wrote: + +> "Not much" sounds interesting, and I wonder whether it could be +> integrated with the views of Sup (inbox, threads, etc). So I have +> subscribed to the list to keep an eye on what's going on here. + +We've tried to clone much of the sup UI inside emacs, including the +inbox and threaded message presentation. Of course, we had to "improve" +it a bit, as much due to the differences between curses and emacs as due +to personal preferences... + +-keith + diff --git a/test/corpora/default/bar/baz/new/28:2, b/test/corpora/default/bar/baz/new/28:2, new file mode 100644 index 00000000..83ce01bd --- /dev/null +++ b/test/corpora/default/bar/baz/new/28:2, @@ -0,0 +1,38 @@ +From: "Keith Packard" <keithp@keithp.com> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 18:03:17 -0800 +Subject: [notmuch] Introducing myself +In-Reply-To: <20091118002059.067214ed@hikari> +References: <20091118002059.067214ed@hikari> +Message-ID: <yun1vjwegii.fsf@aiko.keithp.com> + +On Wed, 18 Nov 2009 00:20:59 +0100, Adrian Perez de Castro <aperez at igalia.com> wrote: + +> Some time ago I thought +> about doing something like Not Much and in fact I played a bit with the +> Python+Xapian and the Python+Whoosh combinations, because I find relaxing +> to code things in Python when I am not working and also it is installed +> by default on most distribution. I got to have some mailboxes indexed and +> basic searching working a couple of months ago. + +Sup certainly started a lot of people thinking... + +> Also, I would like to share one idea I had in mind, that you might find +> interesting: One thing I have found very annoying is having to re-tag my +> mail when the indexes get b0rked (it happened a couple of times to me while +> using Sup), so I was planning to mails as read/unread and adding the tags +> not just to the index, but to the mail text itself, e.g. by adding a +> "X-Tags" header field or by reusing the "Keywords" one. + +Easier than that, notmuch (and sup too), provide a 'dump' command which +just lists all of the message IDs and their associated tags. Makes +saving tags easy and doesn't involve rewriting messages. I do this once +a day just before my computer is backed up to an external drive. + +If the index is destroyed, you can reindex the messages and then reapply +all of the tags with 'notmuch restore'. + +-- +keith.packard at intel.com + + diff --git a/test/corpora/default/bar/cur/19:2, b/test/corpora/default/bar/cur/19:2, new file mode 100644 index 00000000..1b7872b0 --- /dev/null +++ b/test/corpora/default/bar/cur/19:2, @@ -0,0 +1,360 @@ +From: "Ingmar Vanhassel" <ingmar@exherbo.org> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 00:23:42 +0100 +Subject: [notmuch] [PATCH] Typsos +Message-ID: <1258500222-32066-1-git-send-email-ingmar@exherbo.org> + +--- + Makefile | 4 ++-- + README | 6 +++--- + gmime-filter-reply.h | 2 +- + lib/database.cc | 2 +- + lib/index.cc | 2 +- + lib/message.cc | 2 +- + lib/messages.c | 2 +- + lib/notmuch-private.h | 2 +- + lib/notmuch.h | 10 +++++----- + lib/sha1.c | 2 +- + lib/thread.cc | 2 +- + notmuch-completion.bash | 2 +- + notmuch-new.c | 4 ++-- + notmuch-search.c | 2 +- + notmuch.1 | 4 ++-- + notmuch.el | 10 +++++----- + show-message.c | 2 +- + 17 files changed, 30 insertions(+), 30 deletions(-) + +diff --git a/Makefile b/Makefile +index 436dacf..96aaa73 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,4 +1,4 @@ +-# Default FLAGS, (can be overriden by user such as "make CFLAGS=-O2") ++# Default FLAGS, (can be overridden by user such as "make CFLAGS=-O2") + WARN_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -Wswitch-enum + CFLAGS=-O2 + +@@ -14,7 +14,7 @@ override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags) + override LDFLAGS += `pkg-config --libs glib-2.0 gmime-2.4 talloc` \ + `xapian-config --libs` + +-# Include our local Makfile.local first so that its first target is default ++# Include our local Makefile.local first so that its first target is default + include Makefile.local + include lib/Makefile.local + +diff --git a/README b/README +index 40f05ab..27af77f 100644 +--- a/README ++++ b/README +@@ -3,7 +3,7 @@ Notmuch - thread-based email index, search and tagging. + Notmuch is a system for indexing, searching, reading, and tagging + large collections of email messages. It uses the Xapian library to + provide fast, full-text search of very large collection of email with +-a very convenient search syntas. ++a very convenient search syntax. + + Notmuch is free software, released under the GNU General Public + License version 3 (or later). +@@ -45,7 +45,7 @@ obtaining a more sophisticated interface: + notmuch.el file in this distribution. + + If someone were to write a curses-based interface, or similar, +- it might also be reasonable to buil on the "notmuch" ++ it might also be reasonable to build on the "notmuch" + command-line interface. + + 2. Build on top of the notmuch library interface. +@@ -67,4 +67,4 @@ still in development. We would appreciate any contributions to these + efforts. + + +- +\ No newline at end of file ++ +diff --git a/gmime-filter-reply.h b/gmime-filter-reply.h +index 41cbc13..b7cbc6b 100644 +--- a/gmime-filter-reply.h ++++ b/gmime-filter-reply.h +@@ -40,7 +40,7 @@ typedef struct _GMimeFilterReplyClass GMimeFilterReplyClass; + * @saw_nl: previous char was a \n + * @saw_angle: previous char was a > + * +- * A filter to insert/remove reply markers (lines begining with >) ++ * A filter to insert/remove reply markers (lines beginning with >) + **/ + struct _GMimeFilterReply { + GMimeFilter parent_object; +diff --git a/lib/database.cc b/lib/database.cc +index 3c8d626..27597cf 100644 +--- a/lib/database.cc ++++ b/lib/database.cc +@@ -180,7 +180,7 @@ notmuch_status_to_string (notmuch_status_t status) + case NOTMUCH_STATUS_TAG_TOO_LONG: + return "Tag value is too long (exceeds NOTMUCH_TAG_MAX)"; + case NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW: +- return "Unblanced number of calls to notmuch_message_freeze/thaw"; ++ return "Unbalanced number of calls to notmuch_message_freeze/thaw"; + default: + case NOTMUCH_STATUS_LAST_STATUS: + return "Unknown error status value"; +diff --git a/lib/index.cc b/lib/index.cc +index 65b83b3..80df64b 100644 +--- a/lib/index.cc ++++ b/lib/index.cc +@@ -198,7 +198,7 @@ _index_mime_part (notmuch_message_t *message, + if (i == 1) + continue; + if (i > 1) +- fprintf (stderr, "Warning: Unexpected extra parts of mutlipart/signed. Indexing anyway.\n"); ++ fprintf (stderr, "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n"); + } + _index_mime_part (message, + g_mime_multipart_get_part (multipart, i)); +diff --git a/lib/message.cc b/lib/message.cc +index a4b090b..1d6623f 100644 +--- a/lib/message.cc ++++ b/lib/message.cc +@@ -144,7 +144,7 @@ _notmuch_message_create (const void *talloc_owner, + } + + /* Create a new notmuch_message_t object for a specific message ID, +- * (which may or may not already exist in the databas). ++ * (which may or may not already exist in the database). + * + * Here, 'talloc owner' is an optional talloc context to which the new + * message will belong. This allows for the caller to not bother +diff --git a/lib/messages.c b/lib/messages.c +index a588f8f..2f7c283 100644 +--- a/lib/messages.c ++++ b/lib/messages.c +@@ -47,7 +47,7 @@ _notmuch_message_list_create (const void *ctx) + return list; + } + +-/* Append 'node' (which can of course point to an aribtrarily long ++/* Append 'node' (which can of course point to an arbitrarily long + * list of nodes) to the end of 'list'. + */ + void +diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h +index 6036ce4..af82e58 100644 +--- a/lib/notmuch-private.h ++++ b/lib/notmuch-private.h +@@ -235,7 +235,7 @@ notmuch_message_file_open (const char *filename); + notmuch_message_file_t * + _notmuch_message_file_open_ctx (void *ctx, const char *filename); + +-/* Close a notmuch message preivously opened with notmuch_message_open. */ ++/* Close a notmuch message previously opened with notmuch_message_open. */ + void + notmuch_message_file_close (notmuch_message_file_t *message); + +diff --git a/lib/notmuch.h b/lib/notmuch.h +index 32b5332..384c177 100644 +--- a/lib/notmuch.h ++++ b/lib/notmuch.h +@@ -222,7 +222,7 @@ notmuch_database_get_timestamp (notmuch_database_t *database, + + /* Add a new message to the given notmuch database. + * +- * Here,'filename' should be a path relative to the the path of ++ * Here,'filename' should be a path relative to the path of + * 'database' (see notmuch_database_get_path), or else should be an + * absolute filename with initial components that match the path of + * 'database'. +@@ -258,7 +258,7 @@ notmuch_database_add_message (notmuch_database_t *database, + const char *filename, + notmuch_message_t **message); + +-/* Find a message with the given messsage_id. ++/* Find a message with the given message_id. + * + * If the database contains a message with the given message_id, then + * a new notmuch_message_t object is returned. The caller should call +@@ -620,7 +620,7 @@ notmuch_messages_advance (notmuch_messages_t *messages); + /* Destroy a notmuch_messages_t object. + * + * It's not strictly necessary to call this function. All memory from +- * the notmuch_messages_t object will be reclaimed when the containg ++ * the notmuch_messages_t object will be reclaimed when the containing + * query object is destroyed. + */ + void +@@ -865,7 +865,7 @@ notmuch_tags_has_more (notmuch_tags_t *tags); + /* Get the current tag from 'tags' as a string. + * + * Note: The returned string belongs to 'tags' and has a lifetime +- * identical to it (and the query to which it utlimately belongs). ++ * identical to it (and the query to which it ultimately belongs). + * + * See the documentation of notmuch_message_get_tags for example code + * showing how to iterate over a notmuch_tags_t object. +@@ -884,7 +884,7 @@ notmuch_tags_advance (notmuch_tags_t *tags); + /* Destroy a notmuch_tags_t object. + * + * It's not strictly necessary to call this function. All memory from +- * the notmuch_tags_t object will be reclaimed when the containg ++ * the notmuch_tags_t object will be reclaimed when the containing + * message or query objects are destroyed. + */ + void +diff --git a/lib/sha1.c b/lib/sha1.c +index ff4dd16..cc48108 100644 +--- a/lib/sha1.c ++++ b/lib/sha1.c +@@ -43,7 +43,7 @@ _hex_of_sha1_digest (const unsigned char digest[SHA1_DIGEST_SIZE]) + return result; + } + +-/* Create a hexadcimal string version of the SHA-1 digest of 'str' ++/* Create a hexadecimal string version of the SHA-1 digest of 'str' + * (including its null terminating character). + * + * This function returns a newly allocated string which the caller +diff --git a/lib/thread.cc b/lib/thread.cc +index 4411d64..da58edc 100644 +--- a/lib/thread.cc ++++ b/lib/thread.cc +@@ -190,7 +190,7 @@ _resolve_thread_relationships (unused (notmuch_thread_t *thread)) + * subject line, the total count of messages, and all authors). The + * second search is for all messages that are in the thread and that + * also match the given query_string. This is to allow for a separate +- * count of matched messages, and to allow a viewer to diplay these ++ * count of matched messages, and to allow a viewer to display these + * messages differently. + * + * Here, 'ctx' is talloc context for the resulting thread object. +diff --git a/notmuch-completion.bash b/notmuch-completion.bash +index ad55f6d..cdad05d 100644 +--- a/notmuch-completion.bash ++++ b/notmuch-completion.bash +@@ -1,4 +1,4 @@ +-# Bash completion for notmutch ++# Bash completion for notmuch + # + # Copyright ?? 2009 Carl Worth + # +diff --git a/notmuch-new.c b/notmuch-new.c +index 83a05ba..5405a9f 100644 +--- a/notmuch-new.c ++++ b/notmuch-new.c +@@ -303,7 +303,7 @@ add_files (notmuch_database_t *notmuch, + + /* XXX: This should be merged with the add_files function since it + * shares a lot of logic with it. */ +-/* Recursively count all regular files in path and all sub-direcotries ++/* Recursively count all regular files in path and all sub-directories + * of path. The result is added to *count (which should be + * initialized to zero by the top-level caller before calling + * count_files). */ +@@ -469,7 +469,7 @@ notmuch_new_command (void *ctx, + + if (elapsed > 1 && ! add_files_state.saw_read_only_directory) { + printf ("\nTip: If you have any sub-directories that are archives (that is,\n" +- "they will never receive new mail), marking these directores as\n" ++ "they will never receive new mail), marking these directories as\n" + "read-only (chmod u-w /path/to/dir) will make \"notmuch new\"\n" + "much more efficient (it won't even look in those directories).\n"); + } +diff --git a/notmuch-search.c b/notmuch-search.c +index 8db09c7..ac81372 100644 +--- a/notmuch-search.c ++++ b/notmuch-search.c +@@ -76,7 +76,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[]) + + query_str = query_string_from_args (ctx, argc, argv); + if (query_str == NULL) { +- fprintf (stderr, "Out of moemory.\n"); ++ fprintf (stderr, "Out of memory.\n"); + return 1; + } + +diff --git a/notmuch.1 b/notmuch.1 +index 6c3d10f..86d5f59 100644 +--- a/notmuch.1 ++++ b/notmuch.1 +@@ -60,7 +60,7 @@ archives, and will then proceed to build a database that indexes the + mail to allow for fast search of the archive. + + This directory can contain any number of sub-directories and should +-primarily contain only files with indvidual email messages ++primarily contain only files with individual email messages + (eg. maildir or mh archives are perfect). If there are other, + non-email files (such as indexes maintained by other email programs) + then notmuch will do its best to detect those and ignore them. +@@ -173,7 +173,7 @@ Constructs a reply template for a set of messages. + + See the documentation of + .B search +-for deatils of the supported syntax of search terms. ++for details of the supported syntax of search terms. + + To make replying to email easier, + .B notmuch reply +diff --git a/notmuch.el b/notmuch.el +index 8894a8e..7e01ed6 100644 +--- a/notmuch.el ++++ b/notmuch.el +@@ -205,7 +205,7 @@ Unlike builtin `next-line' this version accepts no arguments." + (defun notmuch-show-mark-read-then-archive-thread () + "Remove \"unread\" tag from each message, then archive and show next thread. + +-Archive each message currrently shown by removing the \"unread\" ++Archive each message currently shown by removing the \"unread\" + and \"inbox\" tag from each. Then kill this buffer and show the + next thread from the search from which this thread was originally + shown. +@@ -220,7 +220,7 @@ buffer." + (defun notmuch-show-archive-thread () + "Archive each message in thread, and show next thread from search. + +-Archive each message currrently shown by removing the \"inbox\" ++Archive each message currently shown by removing the \"inbox\" + tag from each. Then kill this buffer and show the next thread + from the search from which this thread was originally shown. + +@@ -340,7 +340,7 @@ there are no more unread messages past the current point." + (notmuch-show-next-message))) + + (defun notmuch-show-next-open-message () +- "Advance to the the next message which is not hidden. ++ "Advance to the next message which is not hidden. + + If read messages are currently hidden, advance to the next unread + message. Otherwise, advance to the next message." +@@ -674,7 +674,7 @@ thread from that buffer can be show when done with this one)." + ))) + + (defvar notmuch-search-authors-width 40 +- "Number of columns to use to diplay authors in a notmuch-search buffer.") ++ "Number of columns to use to display authors in a notmuch-search buffer.") + + (defvar notmuch-search-mode-map + (let ((map (make-sparse-keymap))) +@@ -910,7 +910,7 @@ the beginning of the buffer). + + This command toggles the sort order for the current search. + +-Note that any fitlered searches created by ++Note that any filtered searches created by + `notmuch-search-filter' retain the search order of the parent + search." + (interactive) +diff --git a/show-message.c b/show-message.c +index 79b02e2..38f5897 100644 +--- a/show-message.c ++++ b/show-message.c +@@ -38,7 +38,7 @@ show_message_part (GMimeObject *part, int *part_count, + if (i == 1) + continue; + if (i > 1) +- fprintf (stderr, "Warning: Unexpected extra parts of mutlipart/signed. Continuing.\n"); ++ fprintf (stderr, "Warning: Unexpected extra parts of multipart/signed. Continuing.\n"); + } + show_message_part (g_mime_multipart_get_part (multipart, i), + part_count, show_part); +-- +1.6.5.2.433.g23cdb + + diff --git a/test/corpora/default/bar/cur/20:2, b/test/corpora/default/bar/cur/20:2, new file mode 100644 index 00000000..f08a3145 --- /dev/null +++ b/test/corpora/default/bar/cur/20:2, @@ -0,0 +1,101 @@ +Date: Wed, 18 Nov 2009 00:20:59 +0100 +From: Adrian Perez de Castro <aperez@igalia.com> +To: notmuch@notmuchmail.org +Message-ID: <20091118002059.067214ed@hikari> +Organization: Igalia +X-Mailer: Claws Mail 3.7.3 (GTK+ 2.18.3; x86_64-redhat-linux-gnu) +Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAAXNSR0IArs4c6QAAADBQTFRFBwcHFhYWKCgoNzc3SEhIV1dXaGhod3d3iIiIlpaWqKiouLi4x8fH2NjY5+fn/v7+rSjDkgAAAjVJREFUOE9l07tvE0EQwOHfrkV9O+eko7g701BBfECJsIigT2IpooIqaSiRUEB0REj00FBQgYSCkhry+gecUPJybJeIxLumTbilsH2PMNXufDOa3ZVW+1JkpbUmD/8+vXR3c7or4Gz93mH309Kz8/C9/RQge7VfhW/LW+PF8IkrQ7Z6OKmQr1tl+LU/yWP9mxJka9O88fZHPwf/7u0kLyCnX3I4fQhgjAgIfi+HHw5A1Y2ggIMcFKAEnRoL0M3BosI4TI2IATjuT8DvSNJoNNJgkIhxlr9TUHeSpDnfohlIrMBlU+BGmsZqfr69FMfGMw4NoG835+J62riWyjQ/uXlTQjNUIoYegMsBM0pCD8oDas7n4HQsBghXFxJTW42KDs+4XLfjsN0wOYgABqARjMKIHIaAQnmHjsI5Cvi9Cf6k03OoWBkpIP3Q7354+dEimFBKHbMP9oKjwfd9gbrxR5KDToczK4uPF8UgNomKU2GaENRi77zyDKICxKBS4xXYbONPMQMdYZTBwMiMWiUg9g6UJ3OBogzjV8E7sBVwyvfAOYdQhsABzuOxI1MGZbs98Q6Md5UOfbbR2R0eWOesrnRw5ajT6f60LrNhWIHZpBnUWv2s14ukArWWTqTes3YQxRXgFkcMu70TPYqqUBs0YwmO967OVIdTG4bY4a7WLaqgLm5vbHdH5np0Dri//fmg7y8scB4u3+zsuNlH0X+g19bby69b+TYH6isvns8VdQWgxj9tHP8AR5/hSdYqkwsAAAAASUVORK5CYII= +Mime-Version: 1.0 +Subject: [notmuch] Introducing myself +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +Content-Type: multipart/mixed; boundary="===============1167731900==" +Sender: notmuch-bounces@notmuchmail.org +Errors-To: notmuch-bounces@notmuchmail.org + +--===============1167731900== +Content-Type: multipart/signed; micalg=PGP-SHA1; + boundary="Sig_/ayZz9m37AOMROJCyUudvXvZ"; protocol="application/pgp-signature" + +--Sig_/ayZz9m37AOMROJCyUudvXvZ +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: quoted-printable + + +Hello to all, + +I have just heard about Not Much today in some random Linux-related news +site (LWN?), my name is Adrian Perez and I work as systems administrator +(although I can do some code as well :P). I have always thought that the +ideas behind Sup were great, but after some time using it, I got tired of +the oddities that it has. I also do not like doing things like having to +install Ruby just for reading and sorting mails. Some time ago I thought +about doing something like Not Much and in fact I played a bit with the +Python+Xapian and the Python+Whoosh combinations, because I find relaxing +to code things in Python when I am not working and also it is installed +by default on most distribution. I got to have some mailboxes indexed and +basic searching working a couple of months ago. Lately I have been very +busy and had no time for coding, and them... boom! Not Much appears -- and +it is almost exactly what I was trying to do, but faster. I have been +playing a bit with Not Much today, and I think it has potential. + +Also, I would like to share one idea I had in mind, that you might find +interesting: One thing I have found very annoying is having to re-tag my +mail when the indexes get b0rked (it happened a couple of times to me while +using Sup), so I was planning to mails as read/unread and adding the tags +not just to the index, but to the mail text itself, e.g. by adding a +"X-Tags" header field or by reusing the "Keywords" one. This way, the index +could be totally recreated by re-reading the mail directories, and this +would also allow to a tools like OfflineIMAP [1] to get the mails into a +local maildir, tagging and indexing the mails with the e-mail reader and +then syncing back the messages with the "X-Tags" header to the IMAP server. +This would allow to use the mail reader from a different computer and still +have everything tagged finely. + +Best regards, + + +--- +[1] http://software.complete.org/software/projects/show/offlineimap + +--=20 +Adrian Perez de Castro <aperez@igalia.com> +Igalia - Free Software Engineering + +--Sig_/ayZz9m37AOMROJCyUudvXvZ +Content-Type: application/pgp-signature; name=signature.asc +Content-Disposition: attachment; filename=signature.asc + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.13 (GNU/Linux) + +iEYEARECAAYFAksDL+AACgkQkcVZ2+TJEjtsuQCfXmilW8WpMQHCnwwJjRE1PWZy +oFAAn3MmXC5sW7MvCFjs7ks6U16zgMEg +=eL9p +-----END PGP SIGNATURE----- + +--Sig_/ayZz9m37AOMROJCyUudvXvZ-- + +--===============1167731900== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch + +--===============1167731900==-- + diff --git a/test/corpora/default/bar/new/21:2, b/test/corpora/default/bar/new/21:2, new file mode 100644 index 00000000..7ff55ccf --- /dev/null +++ b/test/corpora/default/bar/new/21:2, @@ -0,0 +1,102 @@ +MIME-Version: 1.0 +Date: Tue, 17 Nov 2009 16:23:53 -0800 +Message-ID: <cf0c4d610911171623q3e27a0adx802e47039b57604b@mail.gmail.com> +From: Alex Botero-Lowry <alex.boterolowry@gmail.com> +To: notmuch@notmuchmail.org +Content-Type: multipart/mixed; boundary=0016e64ca4d8f27a4804789a4139 +Subject: [notmuch] [PATCH] Error out if no query is supplied to search + instead of going into an infinite loop +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +Sender: notmuch-bounces@notmuchmail.org +Errors-To: notmuch-bounces@notmuchmail.org + +--0016e64ca4d8f27a4804789a4139 +Content-Type: multipart/alternative; boundary=0016e64ca4d8f27a3604789a4137 + +--0016e64ca4d8f27a3604789a4137 +Content-Type: text/plain; charset=ISO-8859-1 + +In this case error out when no query is supplied. There seems to be an +infinite-loop casued by i think notmuch_query_search_threads having +an exception: + +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> +A Xapian exception occurred: Syntax: <expression> AND <expression> + +I'll look into that bug specifically a bit later. + +It might be better to do a usage instead of just throwing an error here? + +alex + +--0016e64ca4d8f27a3604789a4137 +Content-Type: text/html; charset=ISO-8859-1 + +In this case error out when no query is supplied. There seems to be an infinite-loop casued by i think notmuch_query_search_threads having<br>an exception:<br><br>A Xapian exception occurred: Syntax: <expression> AND <expression><br> +A Xapian exception occurred: Syntax: <expression> AND <expression><br>A Xapian exception occurred: Syntax: <expression> AND <expression><br>A Xapian exception occurred: Syntax: <expression> AND <expression><br> +A Xapian exception occurred: Syntax: <expression> AND <expression><br>A Xapian exception occurred: Syntax: <expression> AND <expression><br>A Xapian exception occurred: Syntax: <expression> AND <expression><br> +A Xapian exception occurred: Syntax: <expression> AND <expression><br>A Xapian exception occurred: Syntax: <expression> AND <expression><br>A Xapian exception occurred: Syntax: <expression> AND <expression><br> +A Xapian exception occurred: Syntax: <expression> AND <expression><br>A Xapian exception occurred: Syntax: <expression> AND <expression><br>A Xapian exception occurred: Syntax: <expression> AND <expression><br> +A Xapian exception occurred: Syntax: <expression> AND <expression><br>A Xapian exception occurred: Syntax: <expression> AND <expression><br><br>I'll look into that bug specifically a bit later.<br> +<br>It might be better to do a usage instead of just throwing an error here?<br><br>alex<br> + +--0016e64ca4d8f27a3604789a4137-- +--0016e64ca4d8f27a4804789a4139 +Content-Type: application/octet-stream; + name="0001-Error-out-if-no-query-is-supplied-to-search-instead-.patch" +Content-Disposition: attachment; + filename="0001-Error-out-if-no-query-is-supplied-to-search-instead-.patch" +Content-Transfer-Encoding: base64 +X-Attachment-Id: f_g25cms190 + +RnJvbSAzZjk0MzFmNzRhNWZmNjZjODRjODY5YTNlMjZjMmJhZDQyYmVkMWIxIE1vbiBTZXAgMTcg +MDA6MDA6MDAgMjAwMQpGcm9tOiBBbGV4YW5kZXIgQm90ZXJvLUxvd3J5IDxhbGV4LmJvdGVyb2xv +d3J5QGdtYWlsLmNvbT4KRGF0ZTogVHVlLCAxNyBOb3YgMjAwOSAxNjoyMDoyOCAtMDgwMApTdWJq +ZWN0OiBbUEFUQ0hdIEVycm9yIG91dCBpZiBubyBxdWVyeSBpcyBzdXBwbGllZCB0byBzZWFyY2gg +aW5zdGVhZCBvZiBnb2luZyBpbnRvIGFuIGluZmluaXRlIGxvb3AKCi0tLQogbm90bXVjaC1zZWFy +Y2guYyB8ICAgIDUgKysrKysKIDEgZmlsZXMgY2hhbmdlZCwgNSBpbnNlcnRpb25zKCspLCAwIGRl +bGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL25vdG11Y2gtc2VhcmNoLmMgYi9ub3RtdWNoLXNlYXJj +aC5jCmluZGV4IDhkYjA5YzcuLmQ5NGZjY2QgMTAwNjQ0Ci0tLSBhL25vdG11Y2gtc2VhcmNoLmMK +KysrIGIvbm90bXVjaC1zZWFyY2guYwpAQCAtNjYsNiArNjYsMTEgQEAgbm90bXVjaF9zZWFyY2hf +Y29tbWFuZCAodm9pZCAqY3R4LCBpbnQgYXJnYywgY2hhciAqYXJndltdKQogICAgIGFyZ2MgLT0g +aTsKICAgICBhcmd2ICs9IGk7CiAKKyAgICBpZiAoYXJnYyA9PSAwKSB7CisgICAgICAgIGZwcmlu +dGYgKHN0ZGVyciwgIk5vIHF1ZXJ5IHByb3ZpZGVkXG4iKTsKKyAgICAgICAgcmV0dXJuIDE7Cisg +ICAgfQorCiAgICAgY29uZmlnID0gbm90bXVjaF9jb25maWdfb3BlbiAoY3R4LCBOVUxMLCBOVUxM +KTsKICAgICBpZiAoY29uZmlnID09IE5VTEwpCiAJcmV0dXJuIDE7Ci0tIAoxLjYuNS4yCgo= +--0016e64ca4d8f27a4804789a4139 +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch + +--0016e64ca4d8f27a4804789a4139-- + diff --git a/test/corpora/default/bar/new/22:2, b/test/corpora/default/bar/new/22:2, new file mode 100644 index 00000000..08adada6 --- /dev/null +++ b/test/corpora/default/bar/new/22:2, @@ -0,0 +1,84 @@ +Date: Tue, 17 Nov 2009 19:50:40 -0500 +From: Lars Kellogg-Stedman <lars@seas.harvard.edu> +To: Keith Packard <keithp@keithp.com> +Message-ID: <20091118005040.GA25380@dottiness.seas.harvard.edu> +References: <20091117190054.GU3165@dottiness.seas.harvard.edu> + <87iqd9rn3l.fsf@vertex.dottedmag> + <20091117203301.GV3165@dottiness.seas.harvard.edu> + <yunaayketfm.fsf@aiko.keithp.com> +MIME-Version: 1.0 +In-Reply-To: <yunaayketfm.fsf@aiko.keithp.com> +User-Agent: Mutt/1.5.19 (2009-01-05) +Cc: notmuch@notmuchmail.org +Subject: Re: [notmuch] Working with Maildir storage? +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +Content-Type: multipart/mixed; boundary="===============1483126515==" +Sender: notmuch-bounces@notmuchmail.org +Errors-To: notmuch-bounces@notmuchmail.org + + +--===============1483126515== +Content-Type: multipart/signed; micalg=pgp-sha256; + protocol="application/pgp-signature"; boundary="9amGYk9869ThD9tj" +Content-Disposition: inline + + +--9amGYk9869ThD9tj +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +> I've also pushed a slightly more complicated (and complete) fix to my +> private notmuch repository + +The version of lib/messages.cc in your repo doesn't build because it's +missing "#include <stdint.h>" (for the uint32_t on line 466). + +--=20 +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Senior Technologist, Computing and Information Technology +Harvard University School of Engineering and Applied Sciences + + +--9amGYk9869ThD9tj +Content-Type: application/pgp-signature +Content-Disposition: inline + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQEcBAEBCAAGBQJLA0TgAAoJENdGlQYxQazYsG0IAJ1t9h4Q3ma8z8ejeKR22Xh0 +WcuRX2x9yEXy/+aG9W7Mot0mqUQCiLdmHM/2h5N9BFHyJvfOUf8lmssrJ5OS/kp5 +j7FIx3GUELBmEZqFUPjRSQPk1hZURYdRsloKkrbQ2kAivjjb50zAAQ8Av4Cgj6cS +3HvNNmeVfJt1NS75vm+/wn48M8Vrcdv4gvNlSOhgFOixknvRoxSyNDOHYBKvHnSV +2HnO0GzhAQzDZAwdHBzJtb8vRmglrH33TVdrE7OW+sojYB3Wyz8r9+HIt8Q8ovzX +nQ8p0Nf5DlF7tye3JYo0EeNm5EQJ4q0YyVYInhmtpi3A5Cyu50GcB/GZ5Sd6ajo= +=WULe +-----END PGP SIGNATURE----- + +--9amGYk9869ThD9tj-- + +--===============1483126515== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch + +--===============1483126515==-- + diff --git a/test/corpora/default/cur/29:2, b/test/corpora/default/cur/29:2, new file mode 100644 index 00000000..c76eff33 --- /dev/null +++ b/test/corpora/default/cur/29:2, @@ -0,0 +1,21 @@ +From: "Keith Packard" <keithp@keithp.com> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 18:04:31 -0800 +Subject: [notmuch] archive +In-Reply-To: <20091117232137.GA7669@griffis1.net> +References: <20091117232137.GA7669@griffis1.net> +Message-ID: <yunzl6kd1w0.fsf@aiko.keithp.com> + +On Tue, 17 Nov 2009 18:21:38 -0500, Aron Griffis <agriffis at n01se.net> wrote: + +> Just subscribed, I'd like to catch up on the previous postings, +> but the archive link seems to be bogus? + +Yeah, the archive appears broken and will need to wait until Carl +arrives in Barcelona to get fixed. + +-- +keith.packard at intel.com + + + diff --git a/test/corpora/default/cur/30:2, b/test/corpora/default/cur/30:2, new file mode 100644 index 00000000..a5b94a0a --- /dev/null +++ b/test/corpora/default/cur/30:2, @@ -0,0 +1,75 @@ +From: "Stewart Smith" <stewart@flamingspork.com> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 13:22:20 +1100 +Subject: [notmuch] [PATCH] count_files: sort directory in inode order before + statting +Message-ID: <1258510940-7018-1-git-send-email-stewart@flamingspork.com> + +--- + notmuch-new.c | 30 ++++++++++-------------------- + 1 files changed, 10 insertions(+), 20 deletions(-) + +diff --git a/notmuch-new.c b/notmuch-new.c +index 11fad8c..c5f841a 100644 +--- a/notmuch-new.c ++++ b/notmuch-new.c +@@ -308,36 +308,26 @@ add_files (notmuch_database_t *notmuch, + static void + count_files (const char *path, int *count) + { +- DIR *dir; +- struct dirent *e, *entry = NULL; +- int entry_length; +- int err; ++ struct dirent *entry = NULL; + char *next; + struct stat st; ++ struct dirent **namelist = NULL; + +- dir = opendir (path); ++ int n_entries= scandir(path, &namelist, 0, ino_cmp); + +- if (dir == NULL) { ++ if (n_entries == -1) { + fprintf (stderr, "Warning: failed to open directory %s: %s\n", + path, strerror (errno)); + goto DONE; + } + +- entry_length = offsetof (struct dirent, d_name) + +- pathconf (path, _PC_NAME_MAX) + 1; +- entry = malloc (entry_length); ++ int i=0; + + while (!interrupted) { +- err = readdir_r (dir, entry, &e); +- if (err) { +- fprintf (stderr, "Error reading directory: %s\n", +- strerror (errno)); +- free (entry); +- goto DONE; +- } ++ if (i == n_entries) ++ break; + +- if (e == NULL) +- break; ++ entry= namelist[i++]; + + /* Ignore special directories to avoid infinite recursion. + * Also ignore the .notmuch directory. +@@ -376,8 +366,8 @@ count_files (const char *path, int *count) + DONE: + if (entry) + free (entry); +- +- closedir (dir); ++ if (namelist) ++ free (namelist); + } + + int +-- +1.6.3.3 + + diff --git a/test/corpora/default/cur/31:2, b/test/corpora/default/cur/31:2, new file mode 100644 index 00000000..88f17ca9 --- /dev/null +++ b/test/corpora/default/cur/31:2, @@ -0,0 +1,31 @@ +From: "Jjgod Jiang" <gzjjgod@gmail.com> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 11:50:17 +0800 +Subject: [notmuch] Mac OS X/Darwin compatibility issues +Message-ID: <ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com> + +Hi, + +When I tried to compile notmuch under Mac OS X 10.6, several issues +arisen: + +1. g++ reports 'warning: command line option "-Wmissing-declarations" +is valid for C/ObjC but not for C++' + +2. +notmuch-reply.c: In function ?address_is_users?: +notmuch-reply.c:87: warning: passing argument 2 of +?notmuch_config_get_user_other_email? from incompatible pointer type + +That's due to the size incompatibility of 'unsigned int' and 'size_t' +(size_t is uint64_t in Mac OS X). + +3. Several errors about missing GNU extensions like getline() and strndup(): + +warning: implicit declaration of function ?getline? +error: ?strndup? was not declared in this scope + +We can implement these with fgets() and strncpy() though. + +- Jiang + diff --git a/test/corpora/default/cur/32:2, b/test/corpora/default/cur/32:2, new file mode 100644 index 00000000..c1633cdd --- /dev/null +++ b/test/corpora/default/cur/32:2, @@ -0,0 +1,165 @@ +From: "Jan Janak" <jan@ryngle.com> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 05:57:03 +0100 +Subject: [notmuch] [PATCH] notmuch new: Support for conversion of spool + subdirectories into tags +Message-ID: <1258520223-15328-1-git-send-email-jan@ryngle.com> + +This patch makes it possible to convert subdirectory names inside the +spool directory into message tags. Messages stored in subdirectory +"foo" will be marked with tag "foo". Message duplicates found in several +subdirectories will be given one tag per subdirectory. + +This feature can be used to synchronize notmuch's tags with with gmail +tags, for example. Gmail IMAP servers convert tags to IMAP +subdirectories and those subdirectories can be converted back to tags +in notmuch. + +The patch modifies notmuch_database_add_message function to return a +pointer to the message even if a message duplicate was found in the +database. This is needed if we want to add a tag for each subdirectory +in which a message duplicate was found. + +In addition to that, it makes the pointer to notmuch_config_t global +(previously it was a local variable in notmuch_new_command). The +configuration data structure is used by the function which converts +subdirectory names to tags. + +Finally, there is a new function called subdir_to_tag. The function +extracts the name of the subdirectory inside the spool from the full +path of the message (also removing Maildir's cur,dir,and tmp +subdirectories) and adds it as a new tag to the message. + +Signed-off-by: Jan Janak <jan at ryngle.com> +--- + lib/database.cc | 3 +- + notmuch-new.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 74 insertions(+), 3 deletions(-) + +diff --git a/lib/database.cc b/lib/database.cc +index 3c8d626..f7799d2 100644 +--- a/lib/database.cc ++++ b/lib/database.cc +@@ -949,7 +949,8 @@ notmuch_database_add_message (notmuch_database_t *notmuch, + + DONE: + if (message) { +- if (ret == NOTMUCH_STATUS_SUCCESS && message_ret) ++ if ((ret == NOTMUCH_STATUS_SUCCESS || ++ ret == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) && message_ret) + *message_ret = message; + else + notmuch_message_destroy (message); +diff --git a/notmuch-new.c b/notmuch-new.c +index 83a05ba..d94ce16 100644 +--- a/notmuch-new.c ++++ b/notmuch-new.c +@@ -19,6 +19,9 @@ + */ + + #include "notmuch-client.h" ++#include <libgen.h> ++ ++static notmuch_config_t *config = 0; + + static volatile sig_atomic_t do_add_files_print_progress = 0; + +@@ -45,6 +48,69 @@ tag_inbox_and_unread (notmuch_message_t *message) + notmuch_message_add_tag (message, "unread"); + } + ++/* ++ * Extracts the sub-directory from the filename and adds it as a new tag to ++ * the message. The filename must begin with the database directory configured ++ * in the configuration file. This prefix is then removed. If the remaining ++ * sub-directory ends with one of the Maildir special directories (/tmp, /new, ++ * /cur) then they are removed as well. If there is anything left then the ++ * function adds it as a new tag to the message. ++ * ++ * The function does nothing if it cannot extract a sub-directory from ++ * filename. ++ */ ++static void ++subdir_to_tag (char* filename, notmuch_message_t *message) ++{ ++ const char* db_path; ++ char *msg_dir, *tmp; ++ int db_path_len, msg_dir_len; ++ ++ if (config == NULL) return; ++ db_path = notmuch_config_get_database_path (config); ++ if (db_path == NULL) return; ++ db_path_len = strlen(db_path); ++ ++ /* Make a copy of the string as dirname may need to modify it. */ ++ tmp = talloc_strdup(message, filename); ++ msg_dir = dirname(tmp); ++ msg_dir_len = strlen(msg_dir); ++ ++ /* If msg_dir starts with db_path, remove it, including the / which delimits ++ * it from the rest of the directory name. */ ++ if (db_path_len < msg_dir_len && ++ !strncmp(db_path, msg_dir, db_path_len)) { ++ msg_dir += db_path_len + 1; ++ msg_dir_len -= db_path_len + 1; ++ } else { ++ /* If we get here, either the message filename is not inside the ++ * database directory configured in the configuration file, or it is a ++ * file in the root directory of the database. Either way we just skip ++ * it because we do not know how to convert it to a meaningful ++ * subdirectory string that we could add as tag. */ ++ goto out; ++ } ++ ++ /* Special conditioning for Maildirs. If the remainder of the directory ++ * name ends with /new, /cur, or /tmp then remove it. */ ++ if ((msg_dir_len >= 4) && ++ (!strncmp(msg_dir + msg_dir_len - 4, "/new", 4) || ++ !strncmp(msg_dir + msg_dir_len - 4, "/cur", 4) || ++ !strncmp(msg_dir + msg_dir_len - 4, "/tmp", 4))) { ++ msg_dir[msg_dir_len - 4] = '\0'; ++ } ++ ++ /* If, after all the modifications, we still have a subdirectory, add it ++ * as tag. */ ++ if (strlen(msg_dir)) { ++ notmuch_message_add_tag (message, msg_dir); ++ } ++ ++out: ++ talloc_free(tmp); ++} ++ ++ + static void + add_files_print_progress (add_files_state_t *state) + { +@@ -186,10 +252,15 @@ add_files_recursive (notmuch_database_t *notmuch, + case NOTMUCH_STATUS_SUCCESS: + state->added_messages++; + tag_inbox_and_unread (message); ++ subdir_to_tag(next, message); + break; + /* Non-fatal issues (go on to next file) */ + case NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: +- /* Stay silent on this one. */ ++ /* Stay silent on this one. The message already exists in the ++ * database, that means we may have found a duplicate in ++ * another directory. If that's the case then we add another ++ * tag to the message with the sub-directory. */ ++ subdir_to_tag(next, message); + break; + case NOTMUCH_STATUS_FILE_NOT_EMAIL: + fprintf (stderr, "Note: Ignoring non-mail file: %s\n", +@@ -386,7 +457,6 @@ int + notmuch_new_command (void *ctx, + unused (int argc), unused (char *argv[])) + { +- notmuch_config_t *config; + notmuch_database_t *notmuch; + add_files_state_t add_files_state; + double elapsed; +-- +1.6.3.3 + + diff --git a/test/corpora/default/cur/33:2, b/test/corpora/default/cur/33:2, new file mode 100644 index 00000000..a9b32524 --- /dev/null +++ b/test/corpora/default/cur/33:2, @@ -0,0 +1,13 @@ +From: "Rolland Santimano" <rollandsantimano@yahoo.com> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 21:12:23 -0800 (PST) +Subject: [notmuch] Link to mailing list archives ? +Message-ID: <736613.51770.qm@web113505.mail.gq1.yahoo.com> + +The link[1] provided on the list page[2] is broken: +[1] http://notmuchmail.org/pipermail/notmuch/ +[2] http://notmuchmail.org/mailman/listinfo/notmuch + + + + diff --git a/test/corpora/default/cur/34:2, b/test/corpora/default/cur/34:2, new file mode 100644 index 00000000..b94dd069 --- /dev/null +++ b/test/corpora/default/cur/34:2, @@ -0,0 +1,46 @@ +From: "Alexander Botero-Lowry" <alex.boterolowry@gmail.com> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 21:45:36 -0800 +Subject: [notmuch] Mac OS X/Darwin compatibility issues +In-Reply-To: <ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com> +References: <ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com> +Message-ID: <86einw2xof.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me> + +On Wed, 18 Nov 2009 11:50:17 +0800, Jjgod Jiang <gzjjgod at gmail.com> wrote: +> Hi, +> +> When I tried to compile notmuch under Mac OS X 10.6, several issues +> arisen: +> +> 1. g++ reports 'warning: command line option "-Wmissing-declarations" +> is valid for C/ObjC but not for C++' +> +I got that too. I presume it's newly supported in GCC4.4? + +> 3. Several errors about missing GNU extensions like getline() and strndup(): +> +strndup from V8: + +char* strndup(char* str, size_t n) { + // Stupid implementation of strndup since macos isn't born with + // one. + size_t len = strlen(str); + if (len <= n) + return StrDup(str); + char* result = new char[n+1]; + size_t i; + for (i = 0; i <= n; i++) + result[i] = str[i]; + result[i] = '\0'; + return result; +} + +> warning: implicit declaration of function ?getline? +> error: ?strndup? was not declared in this scope +> +for getline do you mind trying #define _GNU_SOURCE 1 +before #include <stdio.h> in the offending files? The FreeBSD man pages +mentions that as a way of enabling the GNU version of getline(). + +Alex + diff --git a/test/corpora/default/cur/35:2, b/test/corpora/default/cur/35:2, new file mode 100644 index 00000000..d7276705 --- /dev/null +++ b/test/corpora/default/cur/35:2, @@ -0,0 +1,24 @@ +From: "Jjgod Jiang" <gzjjgod@gmail.com> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 14:14:27 +0800 +Subject: [notmuch] Mac OS X/Darwin compatibility issues +In-Reply-To: <86einw2xof.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me> +References: <ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com> + <86einw2xof.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me> +Message-ID: <ddd65cda0911172214t60d22b63hcfeb5a19ab54a39b@mail.gmail.com> + +Hi, + +On Wed, Nov 18, 2009 at 1:45 PM, Alexander Botero-Lowry +<alex.boterolowry at gmail.com> wrote: +> for getline do you mind trying #define _GNU_SOURCE 1 +> before #include <stdio.h> in the offending files? The FreeBSD man pages +> mentions that as a way of enabling the GNU version of getline(). + +It seems even _GNU_SOURCE is defined, getline is still not present. +the C lib in Mac OS X simply doesn't have it. See also [1]. + +- Jiang + +[1] http://stackoverflow.com/questions/1117108/compiling-c-code-using-gnu-c-getline-on-mac-osx + diff --git a/test/corpora/default/cur/36:2, b/test/corpora/default/cur/36:2, new file mode 100644 index 00000000..4cd0d200 --- /dev/null +++ b/test/corpora/default/cur/36:2, @@ -0,0 +1,25 @@ +From: "Alexander Botero-Lowry" <alex.boterolowry@gmail.com> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 22:19:29 -0800 +Subject: [notmuch] Mac OS X/Darwin compatibility issues +In-Reply-To: <ddd65cda0911172214t60d22b63hcfeb5a19ab54a39b@mail.gmail.com> +References: <ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com> + <86einw2xof.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me> + <ddd65cda0911172214t60d22b63hcfeb5a19ab54a39b@mail.gmail.com> +Message-ID: <86d43g2w3y.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me> + +On Wed, 18 Nov 2009 14:14:27 +0800, Jjgod Jiang <gzjjgod at gmail.com> wrote: +> Hi, +> +> On Wed, Nov 18, 2009 at 1:45 PM, Alexander Botero-Lowry +> <alex.boterolowry at gmail.com> wrote: +> > for getline do you mind trying #define _GNU_SOURCE 1 +> > before #include <stdio.h> in the offending files? The FreeBSD man pages +> > mentions that as a way of enabling the GNU version of getline(). +> +> It seems even _GNU_SOURCE is defined, getline is still not present. +> the C lib in Mac OS X simply doesn't have it. See also [1]. +> +Alas. Since it's ostensibly based on the FreeBSD one, I figured there +was a chance that would fix the problem. :/ + diff --git a/test/corpora/default/cur/37:2, b/test/corpora/default/cur/37:2, new file mode 100644 index 00000000..4e17e82b --- /dev/null +++ b/test/corpora/default/cur/37:2, @@ -0,0 +1,22 @@ +From: "Alexander Botero-Lowry" <alex.boterolowry@gmail.com> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 00:02:56 -0800 +Subject: [notmuch] request for pull +Message-ID: <86aayk2rbj.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me> + +The following changes since commit e8c9c3e6a534fc6c2919c2c1de63cea7250eb488: + Ingmar Vanhassel (1): + Makefile: Manual pages shouldn't be executable + +are available in the git repository at: + + git://alexbl.net/notmuch.git master + +Alexander Botero-Lowry (2): + Error out if no query is supplied to search instead of going into an infinite loop + set a local truncate-line variable in notmuch-search-mode, so that subjects don't wrap and make the output look weird + + notmuch-search.c | 5 +++++ + notmuch.el | 1 + + 2 files changed, 6 insertions(+), 0 deletions(-) + diff --git a/test/corpora/default/cur/38:2, b/test/corpora/default/cur/38:2, new file mode 100644 index 00000000..f5537ffe --- /dev/null +++ b/test/corpora/default/cur/38:2, @@ -0,0 +1,40 @@ +From: "Keith Packard" <keithp@keithp.com> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 00:29:59 -0800 +Subject: [notmuch] [PATCH] Create a default notmuch-show-hook that + highlights URLs and uses word-wrap +Message-ID: <1258532999-9316-1-git-send-email-keithp@keithp.com> + +I created the notmuch-show-hook precisely so I could add these two +options, but I suspect most people will want them, so I just made them +the default. If you don't want them, you can use remove-hook to get +rid of this. + +Signed-off-by: Keith Packard <keithp at keithp.com> +--- + notmuch.el | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/notmuch.el b/notmuch.el +index 1bb1294..c95cb43 100644 +--- a/notmuch.el ++++ b/notmuch.el +@@ -698,6 +698,14 @@ view, (remove the \"inbox\" tag from each), with either + :options '(goto-address) + :group 'notmuch) + ++; Make show mode a bit prettier, highlighting URLs and using word wrap ++ ++(defun notmuch-show-pretty-hook () ++ (goto-address-mode 1) ++ (visual-line-mode)) ++ ++(add-hook 'notmuch-show-hook 'notmuch-show-pretty-hook) ++ + (defun notmuch-show (thread-id &optional parent-buffer) + "Run \"notmuch show\" with the given thread ID and display results. + +-- +1.6.5.2 + + diff --git a/test/corpora/default/cur/39:2, b/test/corpora/default/cur/39:2, new file mode 100644 index 00000000..637b3c74 --- /dev/null +++ b/test/corpora/default/cur/39:2, @@ -0,0 +1,32 @@ +From: "Alexander Botero-Lowry" <alex.boterolowry@gmail.com> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 00:52:34 -0800 +Subject: [notmuch] [PATCH] Create a default notmuch-show-hook that + highlights URLs and uses word-wrap +In-Reply-To: <1258532999-9316-1-git-send-email-keithp@keithp.com> +References: <1258532999-9316-1-git-send-email-keithp@keithp.com> +Message-ID: <867hto2p0t.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me> + +On Wed, 18 Nov 2009 00:29:59 -0800, Keith Packard <keithp at keithp.com> wrote: +> I created the notmuch-show-hook precisely so I could add these two +> options, but I suspect most people will want them, so I just made them +> the default. If you don't want them, you can use remove-hook to get +> rid of this. +> +Yes, hooks should be added for search as well. :) + +> +; Make show mode a bit prettier, highlighting URLs and using word wrap +> + +> +(defun notmuch-show-pretty-hook () +> + (goto-address-mode 1) +> + (visual-line-mode)) +> + +visual-line-mode turns out to make subject look pretty ugly if there is a +continuation. It doesn't do much good for the citation headers +either. We probably need to do our own intelligent wrapping rather then +use visual-line-mode to make this actually look right. + +goto-address-mode is important though. :) + +alex + diff --git a/test/corpora/default/cur/40:2, b/test/corpora/default/cur/40:2, new file mode 100644 index 00000000..91a15a8d --- /dev/null +++ b/test/corpora/default/cur/40:2, @@ -0,0 +1,31 @@ +From: "Carl Worth" <cworth@cworth.org> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 01:42:02 -0800 +Subject: [notmuch] [PATCH 1/2] Close message file after parsing message + headers +In-Reply-To: <yunbpj0etua.fsf@aiko.keithp.com> +References: <1258471718-6781-1-git-send-email-dottedmag@dottedmag.net> + <87lji5cbwo.fsf@yoom.home.cworth.org> <yunbpj0etua.fsf@aiko.keithp.com> +Message-ID: <87pr7gqidx.fsf@yoom.home.cworth.org> + +On Tue, 17 Nov 2009 13:15:25 -0800, Keith Packard <keithp at keithp.com> wrote: +> Threading the message also involves displaying the from and to contents, +> which requires opening the message file. The alternative to the fix I +> provided is to just parse all of the message headers when first opening +> the message; it could then be immediately closed and the hash referred +> to for all header data. Given the choice, just having the caller say +> when it has finished with a message is probably a reasonable option... + +Hi Keith, + +Once I finally got back on the ground again, I pushed out a revised +version of your patch, (didn't need the reply-to stuff anymore since I +had fixed that differently in the meantime). + +I'm pretty happy with the state of this portion of the code now. + +Thanks Keith and Mikhail for your input on and code to fix this bug. + +-Carl + + diff --git a/test/corpora/default/cur/41:2, b/test/corpora/default/cur/41:2, new file mode 100644 index 00000000..da22cc02 --- /dev/null +++ b/test/corpora/default/cur/41:2, @@ -0,0 +1,37 @@ +From: "Carl Worth" <cworth@cworth.org> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 02:08:10 -0800 +Subject: [notmuch] Working with Maildir storage? +In-Reply-To: <20091117190054.GU3165@dottiness.seas.harvard.edu> +References: <20091117190054.GU3165@dottiness.seas.harvard.edu> +Message-ID: <87ocn0qh6d.fsf@yoom.home.cworth.org> + +On Tue, 17 Nov 2009 14:00:54 -0500, Lars Kellogg-Stedman <lars at seas.harvard.edu> wrote: +> I saw the LWN article and decided to take a look at notmuch. I'm +> currently using mutt and mairix to index and read a collection of +> Maildir mail folders (around 40,000 messages total). + +Welcome, Lars! + +I hadn't even seen that Keith's blog post had been picked up by lwn.net. +That's very interesting. So, thanks for coming and trying out notmuch. + +> Error opening +> /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: +> Too many open files + +Sadly, the lwn article coincided with me having just introduced this +bug, and then getting on a Trans-Atlantic flight. So I fixed the bug +fairly quickly, but there was quite a bit of latency before I could push +the fix out. It should be fixed now. + +> I'm curious if this is expected behavior (i.e., notmuch does not work +> with Maildir) or if something else is going on. + +Notmuch works just fine with maildir---it's one of the things that it +likes the best. + +Happy hacking, + +-Carl + diff --git a/test/corpora/default/cur/42:2, b/test/corpora/default/cur/42:2, new file mode 100644 index 00000000..98fa75fa --- /dev/null +++ b/test/corpora/default/cur/42:2, @@ -0,0 +1,30 @@ +From: "Carl Worth" <cworth@cworth.org> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 02:19:26 -0800 +Subject: [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands + remove inbox (and unread) tags +In-Reply-To: <1258493565-13508-1-git-send-email-keithp@keithp.com> +References: <1258493565-13508-1-git-send-email-keithp@keithp.com> +Message-ID: <87k4xoqgnl.fsf@yoom.home.cworth.org> + +On Tue, 17 Nov 2009 13:32:45 -0800, Keith Packard <keithp at keithp.com> wrote: +> When closing a thread view, mark the thread as archived by removing +> the "inbox" tag, and for the 'x' variant, the "unread" tag as well, +> then kill the buffer and update the search window view as well. +> +> This makes 'x' much the same as 'a', but instead of taking you to the +> next message, it takes you back to the search window instead. + +I don't like this---but that's because I use 'x' precisely *because* it +preserves these tags. + +Otherwise, you might as well just remove inbox and unread as soon as the +message is presented to the user. And that's a bug in a lot of other +email programs that I'm unwilling to replicate. + +We may run into a need to define different ways that people like to work +with their email here. (I know that so far I've just been coding up the +way I want my mail to work.) + +-Carl + diff --git a/test/corpora/default/cur/43:2, b/test/corpora/default/cur/43:2, new file mode 100644 index 00000000..2f6c8bc8 --- /dev/null +++ b/test/corpora/default/cur/43:2, @@ -0,0 +1,26 @@ +From: "Carl Worth" <cworth@cworth.org> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 02:22:12 -0800 +Subject: [notmuch] archive +In-Reply-To: <yunzl6kd1w0.fsf@aiko.keithp.com> +References: <20091117232137.GA7669@griffis1.net> + <yunzl6kd1w0.fsf@aiko.keithp.com> +Message-ID: <87iqd8qgiz.fsf@yoom.home.cworth.org> + +On Tue, 17 Nov 2009 18:04:31 -0800, Keith Packard <keithp at keithp.com> wrote: +> On Tue, 17 Nov 2009 18:21:38 -0500, Aron Griffis <agriffis at n01se.net> wrote: +> +> > Just subscribed, I'd like to catch up on the previous postings, +> > but the archive link seems to be bogus? +> +> Yeah, the archive appears broken and will need to wait until Carl +> arrives in Barcelona to get fixed. + +Fixed it in transit in Frankfurt---with only moments to spare on my +battery and no outlets in sight. + +Thanks for the report, Aron. And welcome to notmuch! + +-Carl (who wants to reply to a lot more mail, but will have to wait + until later for that) + diff --git a/test/corpora/default/cur/44:2, b/test/corpora/default/cur/44:2, new file mode 100644 index 00000000..c896c189 --- /dev/null +++ b/test/corpora/default/cur/44:2, @@ -0,0 +1,29 @@ +From: "Carl Worth" <cworth@cworth.org> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 02:43:50 -0800 +Subject: [notmuch] [PATCH] Older versions of install do not support -C. +In-Reply-To: <1258496327-12086-1-git-send-email-jan@ryngle.com> +References: <1258496327-12086-1-git-send-email-jan@ryngle.com> +Message-ID: <87hbssqfix.fsf@yoom.home.cworth.org> + +On Tue, 17 Nov 2009 23:18:47 +0100, Jan Janak <jan at ryngle.com> wrote: +> Do not use -C cmdline option of install, older versions, commonly found in +> distributions like Debian, do not seem to support it. Running make install +> on such systems (tested on Debian Lenny) fails. +> +> Signed-off-by: Jan Janak <jan at ryngle.com> + +Thanks, Jan. This is pushed now. + +And did I say welcome to notmuch yet? (It's easy to lose track with all +the newcomers---which I'm not complaining about---especially since so +many are sharing code.) + +-Carl + +PS. I actually really like the behavior of -C (especially when +installing a low-level library to avoid big waterfalls of needless +recompiles). But since we're *not* actually installing a library (yet) +I'm happy with this patch rather than writing code in configure to check +if "install -C" works or not. + diff --git a/test/corpora/default/cur/45:2, b/test/corpora/default/cur/45:2, new file mode 100644 index 00000000..806b0e89 --- /dev/null +++ b/test/corpora/default/cur/45:2, @@ -0,0 +1,41 @@ +From: "Carl Worth" <cworth@cworth.org> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 02:49:52 -0800 +Subject: [notmuch] What a great idea! +In-Reply-To: <f35dbb950911171435ieecd458o853c873e35f4be95@mail.gmail.com> +References: <f35dbb950911171435ieecd458o853c873e35f4be95@mail.gmail.com> +Message-ID: <87fx8cqf8v.fsf@yoom.home.cworth.org> + +On Tue, 17 Nov 2009 23:35:30 +0100, Jan Janak <jan at ryngle.com> wrote: +> First of all, notmuch is a wonderful idea, both the cmdline tool and +> the emacs interface! Thanks a lot for writing it, I was really excited +> when I read the announcement today. + +Ah, here's where I planned a nice welcome. So welcome (again), Jan! :-) + +I've been having a lot of fun with notmuch already, (though there have +been some days of pain before it was functional enough and my +email-reply latency went way up). But regardless---I got through that, +and I'm able to work more efficiently with notmuch now than I could with +sup before. So I'm happy. + +And I'm delighted when other people find this interesting as well. + +> Have you considered sending an announcement to the org-mode mailing list? +> http://orgmode.org + +Thanks for the idea. I think I may have looked into org-mode years ago, +(when I was investigating planner-mode and various emacs "personal wiki" +systems for keeping random notes and what-not). + +> Various ways of searching/referencing emails from emacs were discussed +> there several times and none of them were as elegant as notmuch (not +> even close). Maybe notmuch would attract some of the developers +> there.. + +Yeah. I'll drop them a mail. Having a real emacs wizard on board would +be nice. (I'm afraid the elisp I've written so far for this project is +fairly grim.) + +-Carl + diff --git a/test/corpora/default/cur/46:2, b/test/corpora/default/cur/46:2, new file mode 100644 index 00000000..bbd1b37f --- /dev/null +++ b/test/corpora/default/cur/46:2, @@ -0,0 +1,57 @@ +From: "Carl Worth" <cworth@cworth.org> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 03:02:43 -0800 +Subject: [notmuch] New to the list +In-Reply-To: <1258498485-sup-142@elly> +References: <1258498485-sup-142@elly> +Message-ID: <87bpj0qeng.fsf@yoom.home.cworth.org> + +On Tue, 17 Nov 2009 23:57:18 +0100, Israel Herraiz <isra at herraiz.org> wrote: +> I have subscribed to the list. As suggested by the welcome message, I +> am introducing myself. My name is Israel Herraiz, and I have done a +> couple of contributions to Sup, the probably well-known here e-mail +> client. + +Welcome, Israel! + +I'm glad people read that little bit of text in the welcome email and +are introducing themselves. I like to think of our new notmuch community +as a very personable place. + +> "Not much" sounds interesting, and I wonder whether it could be +> integrated with the views of Sup (inbox, threads, etc). So I have +> subscribed to the list to keep an eye on what's going on here. +> +> I have just heard of "Not much". I have not even tried to download the +> code yet. + +Yes, take a look. If you're already an emacs user, then you'll find the +interface of notmuch very comfortable, (looks a lot like sup, but lives +inside of emacs). Even outside of emacs, the command line interface of +notmuch gives view *fairly* similar to those of sup: + + notmuch search tag:inbox # Very much like sup's inbox + + notmuch show thread:some-thread-id # A lot like sup's thread -view + +The command-line output right now isn't nearly as neat as sup's, (it +doesn't elide comments--it doesn't do the indenting of threads, etc.), +even though the command-line interface has all the information it needs +to do that. The reason for that is to let the emacs code own most of the +formatting, (so that it can be more flexible--such as making hidden +things visible, changing column widths, etc.). + +But one thing I wonder is if there would be situations where it would +make sense to get the cleaner output directly out of the command-line +tool. + +For example, for someone who isn't an emacs user, the command-line +interface might be their only introduction to what the "notmuch +experience" is like. So maybe "notmuch show" should give nice clean +output by default and then the emacs code could call "notmuch show +--format=emacs-friendly" or something to get the current output. + +That's an idea anyway. + +-Carl + diff --git a/test/corpora/default/cur/47:2, b/test/corpora/default/cur/47:2, new file mode 100644 index 00000000..9de5532c --- /dev/null +++ b/test/corpora/default/cur/47:2, @@ -0,0 +1,84 @@ +From: "Carl Worth" <cworth@cworth.org> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 03:15:31 -0800 +Subject: [notmuch] Introducing myself +In-Reply-To: <20091118002059.067214ed@hikari> +References: <20091118002059.067214ed@hikari> +Message-ID: <87aaykqe24.fsf@yoom.home.cworth.org> + +On Wed, 18 Nov 2009 00:20:59 +0100, Adrian Perez de Castro <aperez at igalia.com> wrote: +> I have just heard about Not Much today in some random Linux-related news +> site (LWN?), my name is Adrian Perez and I work as systems administrator + +Welcome to notmuch, Adrian! We're glad to have you here. + +> by default on most distribution. I got to have some mailboxes indexed and +> basic searching working a couple of months ago. Lately I have been very +> busy and had no time for coding, and them... boom! Not Much appears -- and +> it is almost exactly what I was trying to do, but faster. I have been +> playing a bit with Not Much today, and I think it has potential. + +It's funny, because I had the exact same experience with sup a couple of +months ago. I had been frustrated for years with email programs, and had +been thinking about how I'd like things to work n the back of my mind +for a long time, (but never *quite* getting to the point where I would +commit to writing an email system myself). + +And then... boom! I found sup and was instantly hooked. It had so much +of what I had imagined, (and much of what I hadn't yet imagined) that I +was quite delighted. + +It was really quite by accident that I ended up inventing a different +system. I had started out just trying to speedup index creation for sup. +If I hadn't run into the problem that it was very difficult[*] to create a +sup-compatible index from C code, I might have stopped there. + +So I'd written a bunch of functional code, only to find myself stuck at +the very last step, (hooking it up to the existing sup interface). Then +Keith suggested emacs and it all seemed pretty easy since I'd already +done all the Xapian work. So it's funny, I was only willing to commit to +this project because I wasn't consciously aware I was working on it. +Otherwise it would have seemed to overwhelming to start. :-) + +Anyway, that's a lot of off-topic rambling off of your introduction. But +I'm glad that notmuch can now give that same "boom!" to others, and I'm +glad you see potential in it. + +> Also, I would like to share one idea I had in mind, that you might find +> interesting: One thing I have found very annoying is having to re-tag my +> mail when the indexes get b0rked (it happened a couple of times to me while +> using Sup), so I was planning to mails as read/unread and adding the tags +> not just to the index, but to the mail text itself, e.g. by adding a +> "X-Tags" header field or by reusing the "Keywords" one. This way, the index +> could be totally recreated by re-reading the mail directories, and this +> would also allow to a tools like OfflineIMAP [1] to get the mails into a +> local maildir, tagging and indexing the mails with the e-mail reader and +> then syncing back the messages with the "X-Tags" header to the IMAP server. +> This would allow to use the mail reader from a different computer and still +> have everything tagged finely. + +It is an interesting idea. But there's also something really comforting +about the email indexed never modifying the mail files. If you're +reading the notmuch commit logs closely you'll see that I'm not actually +careful enough to be trusted with your mail (but I try). So I like that +I don't even have to trust myself---the worst that happens is that I +have to recreate my index. + +And as Keith mentioned, we've got the "notmuch dump; notmuch restore" +idea working exactly as it did in sup. (Though I am thinking of also +adding thread IDs to that now---more on that later.) + +The big annoyance I had with sup index creation, (I ended up having to +do it more than once too), was that it takes *forever*. Right now, +notmuch is a little bit faster, but not a lot faster. And I've got some +ideas to fix that. It would be really nice if index creation were pain +free. (And maybe it is for some user with small amounts of mail---oh, to +have only 40000 messages to have to index!). + +-Carl + +[*] The problem here is that sup puts serialized ruby data structures +into the data field of its Xapian documents. So being compatible with +sup means being able to recreate serialized data structures for a +particular version of ruby. + diff --git a/test/corpora/default/cur/48:2, b/test/corpora/default/cur/48:2, new file mode 100644 index 00000000..419e21db --- /dev/null +++ b/test/corpora/default/cur/48:2, @@ -0,0 +1,17 @@ +From: "Carl Worth" <cworth@cworth.org> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 03:22:32 -0800 +Subject: [notmuch] [PATCH] Typsos +In-Reply-To: <1258500222-32066-1-git-send-email-ingmar@exherbo.org> +References: <1258500222-32066-1-git-send-email-ingmar@exherbo.org> +Message-ID: <878we4qdqf.fsf@yoom.home.cworth.org> + +On Wed, 18 Nov 2009 00:23:42 +0100, Ingmar Vanhassel <ingmar at exherbo.org> wrote: +> 17 files changed, 30 insertions(+), 30 deletions(-) + +Yikes. That's a lot of typos. + +Thanks Ingmar, for cleaning up after my sloppy keyboarding. Pushed. + +-Carl + diff --git a/test/corpora/default/cur/49:2, b/test/corpora/default/cur/49:2, new file mode 100644 index 00000000..b244f8ce --- /dev/null +++ b/test/corpora/default/cur/49:2, @@ -0,0 +1,33 @@ +From: "Carl Worth" <cworth@cworth.org> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 03:31:23 -0800 +Subject: [notmuch] [PATCH] Error out if no query is supplied to search + instead of going into an infinite loop +In-Reply-To: <cf0c4d610911171623q3e27a0adx802e47039b57604b@mail.gmail.com> +References: <cf0c4d610911171623q3e27a0adx802e47039b57604b@mail.gmail.com> +Message-ID: <877htoqdbo.fsf@yoom.home.cworth.org> + +On Tue, 17 Nov 2009 16:23:53 -0800, Alex Botero-Lowry <alex.boterolowry at gmail.com> wrote: +> In this case error out when no query is supplied. There seems to be an +> infinite-loop casued by i think notmuch_query_search_threads having +> an exception: +> A Xapian exception occurred: Syntax: <expression> AND <expression> +> A Xapian exception occurred: Syntax: <expression> AND <expression> +> A Xapian exception occurred: Syntax: <expression> AND <expression> +> +> I'll look into that bug specifically a bit later. +> +> It might be better to do a usage instead of just throwing an error here? + +Definitely. + +Priit Laes reported the same thing in IRC and I've just committed a +patch to give a nice error message: + +$ ./notmuch search +Error: notmuch search requires at least one search term. + +Thanks for the report! + +-Carl + diff --git a/test/corpora/default/cur/50:2, b/test/corpora/default/cur/50:2, new file mode 100644 index 00000000..44e8be5d --- /dev/null +++ b/test/corpora/default/cur/50:2, @@ -0,0 +1,39 @@ +From: "Chris Wilson" <chris@chris-wilson.co.uk> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 11:34:54 +0000 +Subject: [notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once +Message-ID: <1258544095-16616-1-git-send-email-chris@chris-wilson.co.uk> + +Currently the same `pkg-config ...` is executed for every target, so +just store the results in a variable. +--- + Makefile | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 96aaa73..023b2ec 100644 +--- a/Makefile ++++ b/Makefile +@@ -4,15 +4,16 @@ CFLAGS=-O2 + + # Additional flags that we will append to whatever the user set. + # These aren't intended for the user to manipulate. +-extra_cflags = `pkg-config --cflags glib-2.0 gmime-2.4 talloc` +-extra_cxxflags = `xapian-config --cxxflags` ++extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc) ++extra_cxxflags := $(shell xapian-config --cxxflags) + + # Now smash together user's values with our extra values + override CFLAGS += $(WARN_FLAGS) $(extra_cflags) + override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags) + +-override LDFLAGS += `pkg-config --libs glib-2.0 gmime-2.4 talloc` \ +- `xapian-config --libs` ++override LDFLAGS += \ ++ $(shell pkg-config --libs glib-2.0 gmime-2.4 talloc) \ ++ $(shell xapian-config --libs) + + # Include our local Makefile.local first so that its first target is default + include Makefile.local +-- +1.6.5.2 diff --git a/test/corpora/default/cur/51:2, b/test/corpora/default/cur/51:2, new file mode 100644 index 00000000..f522f69e --- /dev/null +++ b/test/corpora/default/cur/51:2, @@ -0,0 +1,12 @@ +From: "Aron Griffis" <agriffis@n01se.net> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 18:21:38 -0500 +Subject: [notmuch] archive +Message-ID: <20091117232137.GA7669@griffis1.net> + +Just subscribed, I'd like to catch up on the previous postings, +but the archive link seems to be bogus? + +Thanks, +Aron + diff --git a/test/corpora/default/cur/52:2, b/test/corpora/default/cur/52:2, new file mode 100644 index 00000000..60283404 --- /dev/null +++ b/test/corpora/default/cur/52:2, @@ -0,0 +1,39 @@ +Message-ID: <4EFC743A.3060609@april.org> +Date: Thu, 29 Dec 2010 15:07:54 +0100 +From: "=?ISO-8859-1?Q?Fran=E7ois_Boulogne?=" <boulogne.f@gmail.com> +User-Agent: Mozilla/5.0 (X11; Linux i686; + rv:9.0) Gecko/20111224 Thunderbird/9.0.1 +MIME-Version: 1.0 +To: Allan McRae <allan@archlinux.org>, + "Discussion about the Arch User Repository (AUR)" <aur-general@archlinux.org> +References: <4EFC3931.6030007@april.org> <4EFC3D62.4030202@archlinux.org> +In-Reply-To: <4EFC3D62.4030202@archlinux.org> +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: 8bit +Subject: Re: [aur-general] Guidelines: cp, mkdir vs install + +Le 29/12/2011 11:13, Allan McRae a écrit : +> On 29/12/11 19:56, François Boulogne wrote: +>> Hi, +>> +>> Looking to improve the quality of my packages, I read again the guidelines. +>> https://wiki.archlinux.org/index.php/Arch_Packaging_Standards +>> +>> However, it don't see anything about the install command like +>> install -d $pkgdir/usr/{bin,share/man/man1,share/locale} +>> +>> Some contributors on AUR use cp or mkdir to install files/dir (when no +>> makefile is provided) and others use install command. +>> +>> What's the opinion of TU on this point? +>> +> +> Use install with -m specifying the correct permissions +> + +Thank you Allan + + +-- +François Boulogne. +https://www.sciunto.org diff --git a/test/corpora/default/cur/53:2, b/test/corpora/default/cur/53:2, new file mode 100644 index 00000000..7a1e2e58 --- /dev/null +++ b/test/corpora/default/cur/53:2, @@ -0,0 +1,20 @@ +From: Olivier Berger <olivier.berger@it-sudparis.eu> +To: olivier.berger@it-sudparis.eu +Subject: Essai =?iso-8859-1?Q?accentu=E9?= +User-Agent: Notmuch/0.10.1 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) +X-Draft-From: ("nnimap+localdovecot:INBOX" 44228) +Date: Fri, 16 Dec 2010 16:49:59 +0100 +Message-ID: <877h1wv7mg.fsf@inf-8657.int-evry.fr> +MIME-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: quoted-printable + +Du texte accentu=E9 pour =E7a ... + +=E0 la bonne heure ! +--=20 +Olivier BERGER=20 +http://www-public.it-sudparis.eu/~berger_o/ - OpenPGP-Id: 2048R/5819D7E8 +Ingenieur Recherche - Dept INF +Institut TELECOM, SudParis (http://www.it-sudparis.eu/), Evry (France) + diff --git a/test/corpora/default/foo/06:2, b/test/corpora/default/foo/06:2, new file mode 100644 index 00000000..3baad491 --- /dev/null +++ b/test/corpora/default/foo/06:2, @@ -0,0 +1,36 @@ +From: "Carl Worth" <cworth@cworth.org> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 12:19:24 -0800 +Subject: [notmuch] preliminary FreeBSD support +In-Reply-To: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com> +References: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com> +Message-ID: <87lji4lx9v.fsf@yoom.home.cworth.org> + +On Tue, 17 Nov 2009 11:36:14 -0800, Alex Botero-Lowry <alex.boterolowry at gmail.com> wrote: +> I saw the announcement this morning, and was very excited, as I had been +> hoping sup would be turned into a library, +> since I like the concept more than the UI (I'd rather an emacs interface). + +Hi Alex, + +That's great! It's good to hear that there are like-minded people out +there. I hope that Notmuch will be useful for you. + +> I did a preliminary compile which worked out fine, but +> sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns -1 on +> FreeBSD, so notmuch_config_open segfaulted. +> +> Attached is a patch that supplies a default buffer size of 64 in cases where +> -1 is returned. + +Thanks for the patch. As we discussed in IRC[*], we should probably +do the correct thing and check for ERANGE and loop as necessary (even if +sysconf returns a positive value). Example code here: + +http://www.opengroup.org/austin/docs/austin_328.txt + +-Carl + +[*] #notmuch on irc.freenode.net for those who didn't just guess that +already, (and I'll add that to the website soon). + diff --git a/test/corpora/default/foo/baz/11:2, b/test/corpora/default/foo/baz/11:2, new file mode 100644 index 00000000..c0701def --- /dev/null +++ b/test/corpora/default/foo/baz/11:2, @@ -0,0 +1,27 @@ +From: "Keith Packard" <keithp@keithp.com> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 13:15:25 -0800 +Subject: [notmuch] [PATCH 1/2] Close message file after parsing message + headers +In-Reply-To: <87lji5cbwo.fsf@yoom.home.cworth.org> +References: <1258471718-6781-1-git-send-email-dottedmag@dottedmag.net> + <87lji5cbwo.fsf@yoom.home.cworth.org> +Message-ID: <yunbpj0etua.fsf@aiko.keithp.com> + +On Tue, 17 Nov 2009 09:13:27 -0800, Carl Worth <cworth at cworth.org> wrote: + +> I didn't apply Keith's fix yet, because I think I'd rather just fix the +> indexer to store the In-Reply-To header in a separate term prefix from +> the term used for the References header[*]. That will then let us lookup +> the in-reply-to value later for thread constructions without having to +> open the original email file at all. + +Threading the message also involves displaying the from and to contents, +which requires opening the message file. The alternative to the fix I +provided is to just parse all of the message headers when first opening +the message; it could then be immediately closed and the hash referred +to for all header data. Given the choice, just having the caller say +when it has finished with a message is probably a reasonable option... + +-keith + diff --git a/test/corpora/default/foo/baz/12:2, b/test/corpora/default/foo/baz/12:2, new file mode 100644 index 00000000..fbc604c0 --- /dev/null +++ b/test/corpora/default/foo/baz/12:2, @@ -0,0 +1,27 @@ +From: "Keith Packard" <keithp@keithp.com> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 13:24:13 -0800 +Subject: [notmuch] Working with Maildir storage? +In-Reply-To: <20091117203301.GV3165@dottiness.seas.harvard.edu> +References: <20091117190054.GU3165@dottiness.seas.harvard.edu> + <87iqd9rn3l.fsf@vertex.dottedmag> + <20091117203301.GV3165@dottiness.seas.harvard.edu> +Message-ID: <yunaayketfm.fsf@aiko.keithp.com> + +On Tue, 17 Nov 2009 15:33:01 -0500, Lars Kellogg-Stedman <lars at seas.harvard.edu> wrote: +> > See the patch just posted here. + +I've also pushed a slightly more complicated (and complete) fix to my +private notmuch repository + +git://keithp.com/git/notmuch + +> Is the list archived anywhere? + +Oops. Looks like Carl's mail server is broken. He's traveling to +Barcelona today and so it won't get fixed for a while. + +Thanks to everyone for trying out notmuch! + +-keith + diff --git a/test/corpora/default/foo/baz/cur/13:2, b/test/corpora/default/foo/baz/cur/13:2, new file mode 100644 index 00000000..03cb3744 --- /dev/null +++ b/test/corpora/default/foo/baz/cur/13:2, @@ -0,0 +1,178 @@ +From: "Keith Packard" <keithp@keithp.com> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 13:32:45 -0800 +Subject: [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove + inbox (and unread) tags +Message-ID: <1258493565-13508-1-git-send-email-keithp@keithp.com> + +When closing a thread view, mark the thread as archived by removing +the "inbox" tag, and for the 'x' variant, the "unread" tag as well, +then kill the buffer and update the search window view as well. + +This makes 'x' much the same as 'a', but instead of taking you to the +next message, it takes you back to the search window instead. + +Signed-off-by: Keith Packard <keithp at keithp.com> +--- + notmuch.el | 86 ++++++++++++++++++++++++++++++++++++++++++++++------------- + 1 files changed, 67 insertions(+), 19 deletions(-) + +diff --git a/notmuch.el b/notmuch.el +index 638d49d..7b0d72c 100644 +--- a/notmuch.el ++++ b/notmuch.el +@@ -31,8 +31,8 @@ + ; Will be much preferable to switch to direct manipulation for + ; toggling visibility of these components. Probably using + ; overlays-at to query and manipulate the current overlay. +- (define-key map "a" 'notmuch-show-archive-thread) +- (define-key map "A" 'notmuch-show-mark-read-then-archive-thread) ++ (define-key map "a" 'notmuch-show-mark-read-archive-thread-next-thread) ++ (define-key map "A" 'notmuch-show-archive-thread-next-thread) + (define-key map "b" 'notmuch-show-toggle-body-read-visible) + (define-key map "c" 'notmuch-show-toggle-citations-visible) + (define-key map "h" 'notmuch-show-toggle-headers-visible) +@@ -47,7 +47,8 @@ + (define-key map "s" 'notmuch-show-toggle-signatures-visible) + (define-key map "v" 'notmuch-show-view-all-mime-parts) + (define-key map "w" 'notmuch-show-view-raw-message) +- (define-key map "x" 'kill-this-buffer) ++ (define-key map "x" 'notmuch-show-mark-read-archive-thread-kill-buffer) ++ (define-key map "X" 'notmuch-show-archive-thread-kill-buffer) + (define-key map "+" 'notmuch-show-add-tag) + (define-key map "-" 'notmuch-show-remove-tag) + (define-key map (kbd "DEL") 'notmuch-show-rewind) +@@ -183,7 +184,33 @@ Unlike builtin `next-line' this version accepts no arguments." + (cons (notmuch-show-get-message-id) nil))) + (notmuch-show-set-tags (sort (set-difference tags toremove :test 'string=) 'string<)))))) + +-(defun notmuch-show-archive-thread-maybe-mark-read (markread) ++(defun notmuch-show-next-thread (markread) ++ (let ((parent-buffer notmuch-show-parent-buffer)) ++ (kill-this-buffer) ++ (if parent-buffer ++ (progn ++ (switch-to-buffer parent-buffer) ++ (forward-line) ++ (notmuch-search-show-thread))))) ++ ++(defun notmuch-delete-tags (to-remove from) ++ (if to-remove ++ (delete (car to-remove) (notmuch-delete-tags (cdr to-remove) from)) ++ from)) ++ ++(defun notmuch-kill-message-buffer (markread) ++ (let ((parent-buffer notmuch-show-parent-buffer)) ++ (kill-this-buffer) ++ (if parent-buffer ++ (progn ++ (switch-to-buffer parent-buffer) ++ (let ((tags (notmuch-search-get-tags))) ++ (setq tags (delete "inbox" tags)) ++ (if markread (setq tags (delete "unread" tags))) ++ (notmuch-search-set-tags tags)) ++ (forward-line))))) ++ ++(defun notmuch-show-archive-thread-maybe-mark-read (markread shownext) + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) +@@ -194,15 +221,9 @@ Unlike builtin `next-line' this version accepts no arguments." + (forward-char)) + (if (not (re-search-forward notmuch-show-message-begin-regexp nil t)) + (goto-char (point-max))))) +- (let ((parent-buffer notmuch-show-parent-buffer)) +- (kill-this-buffer) +- (if parent-buffer +- (progn +- (switch-to-buffer parent-buffer) +- (forward-line) +- (notmuch-search-show-thread))))) ++ (if shownext (notmuch-show-next-thread markread) (notmuch-kill-message-buffer markread))) + +-(defun notmuch-show-mark-read-then-archive-thread () ++(defun notmuch-show-mark-read-archive-thread-next-thread () + "Remove \"unread\" tag from each message, then archive and show next thread. + + Archive each message currrently shown by removing the \"unread\" +@@ -215,9 +236,22 @@ being delivered to the same thread. It does not archive the + entire thread, but only the messages shown in the current + buffer." + (interactive) +- (notmuch-show-archive-thread-maybe-mark-read t)) ++ (notmuch-show-archive-thread-maybe-mark-read t t)) ++ ++(defun notmuch-show-mark-read-archive-thread-kill-buffer () ++ "Remove \"unread\" tag from each message, then archive and kill the buffer. ++ ++Archive each message currrently shown by removing the \"unread\" ++and \"inbox\" tag from each. Then kill this buffer. ++ ++Note: This command is safe from any race condition of new messages ++being delivered to the same thread. It does not archive the ++entire thread, but only the messages shown in the current ++buffer." ++ (interactive) ++ (notmuch-show-archive-thread-maybe-mark-read t nil)) + +-(defun notmuch-show-archive-thread () ++(defun notmuch-show-archive-thread-next-thread () + "Archive each message in thread, and show next thread from search. + + Archive each message currrently shown by removing the \"inbox\" +@@ -229,7 +263,20 @@ being delivered to the same thread. It does not archive the + entire thread, but only the messages shown in the current + buffer." + (interactive) +- (notmuch-show-archive-thread-maybe-mark-read nil)) ++ (notmuch-show-archive-thread-maybe-mark-read nil t)) ++ ++(defun notmuch-show-archive-thread-kill-buffer () ++ "Archive each message in thread, and kill the thread buffer. ++ ++Archive each message currrently shown by removing the \"inbox\" ++tag from each. Then kill this buffer. ++ ++Note: This command is safe from any race condition of new messages ++being delivered to the same thread. It does not archive the ++entire thread, but only the messages shown in the current ++buffer." ++ (interactive) ++ (notmuch-show-archive-thread-maybe-mark-read nil t)) + + (defun notmuch-show-view-raw-message () + "View the raw email of the current message." +@@ -297,7 +344,7 @@ by searching backward)." + (not (re-search-forward notmuch-show-message-begin-regexp nil t))))) + + (defun notmuch-show-message-unread-p () +- "Preficate testing whether current message is unread." ++ "Predicate testing whether current message is unread." + (member "unread" (notmuch-show-get-tags))) + + (defun notmuch-show-next-message () +@@ -434,7 +481,7 @@ which this thread was originally shown." + (let ((last (notmuch-show-last-message-p))) + (notmuch-show-mark-read-then-next-open-message) + (if last +- (notmuch-show-archive-thread)))))) ++ (notmuch-show-archive-thread-next-thread)))))) + + (defun notmuch-show-markup-citations-region (beg end depth) + (goto-char beg) +@@ -618,8 +665,9 @@ messages. Each time you navigate away from a message with + + You can add or remove tags from the current message with '+' and + '-'. You can also archive all messages in the current +-view, (remove the \"inbox\" tag from each), with +-`notmuch-show-archive-thread' (bound to 'a' by default). ++view, (remove the \"inbox\" tag from each), with either ++`notmuch-show-archive-thread-next-thread' (bound to 'a' by default) or ++`notmuch-show-archive-thread-kill-buffer' (bound to 'x' by default). + + \\{notmuch-show-mode-map}" + (interactive) +-- +1.6.5.2 + + diff --git a/test/corpora/default/foo/baz/cur/14:2, b/test/corpora/default/foo/baz/cur/14:2, new file mode 100644 index 00000000..d3fe78db --- /dev/null +++ b/test/corpora/default/foo/baz/cur/14:2, @@ -0,0 +1,39 @@ +From: "Jan Janak" <jan@ryngle.com> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 23:18:47 +0100 +Subject: [notmuch] [PATCH] Older versions of install do not support -C. +Message-ID: <1258496327-12086-1-git-send-email-jan@ryngle.com> + +Do not use -C cmdline option of install, older versions, commonly found in +distributions like Debian, do not seem to support it. Running make install +on such systems (tested on Debian Lenny) fails. + +Signed-off-by: Jan Janak <jan at ryngle.com> +--- + Makefile.local | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Makefile.local b/Makefile.local +index f824bed..f51f1d1 100644 +--- a/Makefile.local ++++ b/Makefile.local +@@ -27,11 +27,11 @@ install: all notmuch.1.gz + for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \ + $(DESTDIR)/etc/bash_completion.d/ ; \ + do \ +- install -C -d $$d ; \ ++ install -d $$d ; \ + done ; +- install -C notmuch $(DESTDIR)$(prefix)/bin/ +- install -C -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/ +- install -C notmuch-completion.bash \ ++ install notmuch $(DESTDIR)$(prefix)/bin/ ++ install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/ ++ install notmuch-completion.bash \ + $(DESTDIR)/etc/bash_completion.d/notmuch + + SRCS := $(SRCS) $(notmuch_client_srcs) +-- +1.6.3.3 + + diff --git a/test/corpora/default/foo/baz/new/15:2, b/test/corpora/default/foo/baz/new/15:2, new file mode 100644 index 00000000..6824d5ea --- /dev/null +++ b/test/corpora/default/foo/baz/new/15:2, @@ -0,0 +1,22 @@ +From: "Jan Janak" <jan@ryngle.com> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 23:35:30 +0100 +Subject: [notmuch] What a great idea! +Message-ID: <f35dbb950911171435ieecd458o853c873e35f4be95@mail.gmail.com> + +Hello, + +First of all, notmuch is a wonderful idea, both the cmdline tool and +the emacs interface! Thanks a lot for writing it, I was really excited +when I read the announcement today. + +Have you considered sending an announcement to the org-mode mailing list? +http://org-mode.org + +Various ways of searching/referencing emails from emacs were discussed +there several times and none of them were as elegant as notmuch (not +even close). Maybe notmuch would attract some of the developers +there.. + + -- Jan + diff --git a/test/corpora/default/foo/baz/new/16:2, b/test/corpora/default/foo/baz/new/16:2, new file mode 100644 index 00000000..f531eb93 --- /dev/null +++ b/test/corpora/default/foo/baz/new/16:2, @@ -0,0 +1,27 @@ +From: "Jan Janak" <jan@ryngle.com> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 23:38:47 +0100 +Subject: [notmuch] What a great idea! +In-Reply-To: <f35dbb950911171435ieecd458o853c873e35f4be95@mail.gmail.com> +References: <f35dbb950911171435ieecd458o853c873e35f4be95@mail.gmail.com> +Message-ID: <f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com> + +On Tue, Nov 17, 2009 at 11:35 PM, Jan Janak <jan at ryngle.com> wrote: +> Hello, +> +> First of all, notmuch is a wonderful idea, both the cmdline tool and +> the emacs interface! Thanks a lot for writing it, I was really excited +> when I read the announcement today. +> +> Have you considered sending an announcement to the org-mode mailing list? +> http://org-mode.org + +Sorry, wrong URL, the correct one is: http://orgmode.org + +> Various ways of searching/referencing emails from emacs were discussed +> there several times and none of them were as elegant as notmuch (not +> even close). Maybe notmuch would attract some of the developers +> there.. + + -- Jan + diff --git a/test/corpora/default/foo/cur/07:2, b/test/corpora/default/foo/cur/07:2, new file mode 100644 index 00000000..7b1e2bbe --- /dev/null +++ b/test/corpora/default/foo/cur/07:2, @@ -0,0 +1,57 @@ +From: "Carl Worth" <cworth@cworth.org> +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 09:13:27 -0800 +Subject: [notmuch] [PATCH 1/2] Close message file after parsing message + headers +In-Reply-To: <1258471718-6781-1-git-send-email-dottedmag@dottedmag.net> +References: <1258471718-6781-1-git-send-email-dottedmag@dottedmag.net> +Message-ID: <87lji5cbwo.fsf@yoom.home.cworth.org> + +On Tue, 17 Nov 2009 21:28:37 +0600, Mikhail Gusarov <dottedmag at dottedmag.net> wrote: +> Keeping unused files open helps to see "Too many open files" often. +> +> Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net> +... +On Tue, 17 Nov 2009 21:28:38 +0600, Mikhail Gusarov <dottedmag at dottedmag.net> wrote: +> +> Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net> +> --- +> lib/message.cc | 2 ++ +> 1 files changed, 2 insertions(+), 0 deletions(-) + +Hi Mikhail, + +Welcome to notmuch, and thanks for these patches! I've pushed both of +them out now. + +Keith ran into the same problem of "too many open files" and wrote a +more complex fix, (which included what you did here). His code can be +seen at: + + git://keithp.com/git/notmuch + +I didn't apply Keith's fix yet, because I think I'd rather just fix the +indexer to store the In-Reply-To header in a separate term prefix from +the term used for the References header[*]. That will then let us lookup +the in-reply-to value later for thread constructions without having to +open the original email file at all. + +-Carl + +[*] Yes, this is my first post to our new mailing list and I'm already +spouting off about "terms" and "prefixes" without any definitions. I +apologize for that. I hope that people will ask questions freely here on +the list whenever anything is not clear, and I'll be glad to explain +things as needed. (Then when can shove answers into a HACKING document.) + +PS. This reply is a great example of a feature that notmuch *almost* +supports already---repling to multiple messages at once. The "notmuch +reply" command line does everything necessary to make this work, but we +haven't yet hooked up any keybindings for this in the emacs client yet. +Obviously, 'r' from the search view could reply to the entire thread. +But when viewing a thread, anyone have a good keybinding suggestion? +(There's obviously 'R' as opposed to 'r', but I think we'll probably +want to distinguish "reply to sender" from "reply to all" before trying +to distinguish "reply to message" from "reply to thread" (which I +imagine is more rare of an operation). + diff --git a/test/corpora/default/foo/cur/08:2, b/test/corpora/default/foo/cur/08:2, new file mode 100644 index 00000000..baf34d1f --- /dev/null +++ b/test/corpora/default/foo/cur/08:2, @@ -0,0 +1,87 @@ +Date: Tue, 17 Nov 2009 15:33:01 -0500 +From: Lars Kellogg-Stedman <lars@seas.harvard.edu> +To: Mikhail Gusarov <dottedmag@dottedmag.net> +Message-ID: <20091117203301.GV3165@dottiness.seas.harvard.edu> +References: <20091117190054.GU3165@dottiness.seas.harvard.edu> + <87iqd9rn3l.fsf@vertex.dottedmag> +MIME-Version: 1.0 +In-Reply-To: <87iqd9rn3l.fsf@vertex.dottedmag> +User-Agent: Mutt/1.5.19 (2009-01-05) +Cc: notmuch@notmuchmail.org +Subject: Re: [notmuch] Working with Maildir storage? +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +Content-Type: multipart/mixed; boundary="===============0063752545==" +Sender: notmuch-bounces@notmuchmail.org +Errors-To: notmuch-bounces@notmuchmail.org + + +--===============0063752545== +Content-Type: multipart/signed; micalg=pgp-sha256; + protocol="application/pgp-signature"; boundary="GGxZz/e2pmGePzrA" +Content-Disposition: inline + + +--GGxZz/e2pmGePzrA +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +> See the patch just posted here. + +Is the list archived anywhere? The obvious archives +(http://notmuchmail.org/pipermail/notmuch/) aren't available, and I +think I subscribed too late to get the patch (I only just saw the +discussion about it). + +It doesn't look like the patch is in git yet. + +-- Lars + +--=20 +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Senior Technologist, Computing and Information Technology +Harvard University School of Engineering and Applied Sciences + + +--GGxZz/e2pmGePzrA +Content-Type: application/pgp-signature +Content-Disposition: inline + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQEcBAEBCAAGBQJLAwh9AAoJENdGlQYxQazYHJMIAI+XTPOyBTZIxEGTdgVKd2fR +k27ucKs6lXozfMIIGchNUDXQho+KmiuTfX1XFJeBkqOlhrd9zlGjBGoBM0YBq/Gs +aStPdonREzsHORjmyQCCpjg4AcqCRTXFbDXzAeXlxMPOrZ3P0XNPzTEM1mVksbmg +mBBDLdHncy4sSCfFgXwRGGgLv9z5Acqm8xGYr68c9PIXY939ozIKV9LVUhxiNz9g +We2a9rLDhfwxUqDlGdiNwZZimiKvD/fsYSrBZMDb5HgIYkeNZ4SD8Xu+OgB550wN +OFfwGi3o8WFK2AyDe5QJDh9Ub+euPNlVzePoGpkltZEHuCcLFJqCHv5XYpbxcjA= +=GO2Q +-----END PGP SIGNATURE----- + +--GGxZz/e2pmGePzrA-- + +--===============0063752545== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch + +--===============0063752545==-- + diff --git a/test/corpora/default/foo/new/03:2, b/test/corpora/default/foo/new/03:2, new file mode 100644 index 00000000..c154ac5e --- /dev/null +++ b/test/corpora/default/foo/new/03:2, @@ -0,0 +1,93 @@ +Date: Tue, 17 Nov 2009 14:00:54 -0500 +From: Lars Kellogg-Stedman <lars@seas.harvard.edu> +To: notmuch@notmuchmail.org +Message-ID: <20091117190054.GU3165@dottiness.seas.harvard.edu> +MIME-Version: 1.0 +User-Agent: Mutt/1.5.19 (2009-01-05) +Subject: [notmuch] Working with Maildir storage? +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +Content-Type: multipart/mixed; boundary="===============1685355122==" +Sender: notmuch-bounces@notmuchmail.org +Errors-To: notmuch-bounces@notmuchmail.org + + +--===============1685355122== +Content-Type: multipart/signed; micalg=pgp-sha256; + protocol="application/pgp-signature"; boundary="5Dr6Wqe9hdyl7LAI" +Content-Disposition: inline + + +--5Dr6Wqe9hdyl7LAI +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +I saw the LWN article and decided to take a look at notmuch. I'm +currently using mutt and mairix to index and read a collection of +Maildir mail folders (around 40,000 messages total). + +notmuch indexed the messages without complaint, but my attempt at +searching bombed out. Running, for example: + + notmuch search storage + +Resulted in 4604 lines of errors along the lines of: + + Error opening + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U= +=3D3026:2,S: + Too many open files + +I'm curious if this is expected behavior (i.e., notmuch does not work +with Maildir) or if something else is going on. + +Cheers, + +--=20 +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Senior Technologist, Computing and Information Technology +Harvard University School of Engineering and Applied Sciences + + +--5Dr6Wqe9hdyl7LAI +Content-Type: application/pgp-signature +Content-Disposition: inline + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQEcBAEBCAAGBQJLAvLmAAoJENdGlQYxQazYRtcH/0usClQ1Z+EoTsA+URwIK6hD +FsZUxFxRjMuOQRn2idZ/zhhg5jJj11ZaHjqxSkDvi2ywkTKUf1vX9LLzVy5hSR9M +E6XQUd5QWAQXo1VsTeKkukIL0YqsPjdgrT8+Yt+OS2NvhEncql23oxnL2/pHkIFq +r0NdTmVV5Jcar7w9J6X1Mi9m229a/9jV5FImsWISkIhIWznXU5SiU6zIw8xhP4E0 +xhvVSNJnFryjVHtva870aSQduhHfeLPzpYhqbkMPvlq+bcz6Q/Q2SwxJcGLNMPHa +os9s9FGhCvFKUhVzezHWPgXNCcNT8qK89rcUldb5Oq4jaJb8RCZCYABplfoyaFs= +=vO4s +-----END PGP SIGNATURE----- + +--5Dr6Wqe9hdyl7LAI-- + +--===============1685355122== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch + +--===============1685355122==-- + diff --git a/test/corpora/default/foo/new/09:2, b/test/corpora/default/foo/new/09:2, new file mode 100644 index 00000000..26b51b1f --- /dev/null +++ b/test/corpora/default/foo/new/09:2, @@ -0,0 +1,33 @@ +From: "Mikhail Gusarov" <dottedmag@dottedmag.net> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 02:50:48 +0600 +Subject: [notmuch] Working with Maildir storage? +In-Reply-To: <20091117203301.GV3165@dottiness.seas.harvard.edu> (Lars + Kellogg-Stedman's message of "Tue, 17 Nov 2009 15:33:01 -0500") +References: <20091117190054.GU3165@dottiness.seas.harvard.edu> + <87iqd9rn3l.fsf@vertex.dottedmag> + <20091117203301.GV3165@dottiness.seas.harvard.edu> +Message-ID: <87fx8can9z.fsf@vertex.dottedmag> + + +Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at seas.harvard.edu did gyre and gimble: + + LK> Is the list archived anywhere? The obvious archives + LK> (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I + LK> think I subscribed too late to get the patch (I only just saw the + LK> discussion about it). + + LK> It doesn't look like the patch is in git yet. + +Just has been pushed + +-- + http://fossarchy.blogspot.com/ +-------------- next part -------------- +A non-text attachment was scrubbed... +Name: not available +Type: application/pgp-signature +Size: 834 bytes +Desc: not available +URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091118/0e33d964/attachment.pgp> + diff --git a/test/corpora/default/foo/new/10:2, b/test/corpora/default/foo/new/10:2, new file mode 100644 index 00000000..4211d734 --- /dev/null +++ b/test/corpora/default/foo/new/10:2, @@ -0,0 +1,54 @@ +From: "Mikhail Gusarov" <dottedmag@dottedmag.net> +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 02:51:18 +0600 +Subject: [notmuch] [PATCH] Handle rename of message file +Message-ID: <1258491078-29658-1-git-send-email-dottedmag@dottedmag.net> + +If message file has been renamed, just update filename in the DB. + +Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net> +--- + lib/database.cc | 21 ++++++++++++--------- + 1 files changed, 12 insertions(+), 9 deletions(-) + +diff --git a/lib/database.cc b/lib/database.cc +index 3c8d626..c4eb8b6 100644 +--- a/lib/database.cc ++++ b/lib/database.cc +@@ -925,20 +925,23 @@ notmuch_database_add_message (notmuch_database_t *notmuch, + if (private_status == NOTMUCH_PRIVATE_STATUS_NO_DOCUMENT_FOUND) { + _notmuch_message_set_filename (message, filename); + _notmuch_message_add_term (message, "type", "mail"); ++ ++ ret = _notmuch_database_link_message (notmuch, message, message_file); ++ if (ret) ++ goto DONE; ++ ++ date = notmuch_message_file_get_header (message_file, "date"); ++ _notmuch_message_set_date (message, date); ++ ++ _notmuch_message_index_file (message, filename); ++ } else if (strcmp(notmuch_message_get_filename(message), filename)) { ++ /* Message file has been moved/renamed */ ++ _notmuch_message_set_filename (message, filename); + } else { + ret = NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID; + goto DONE; + } + +- ret = _notmuch_database_link_message (notmuch, message, message_file); +- if (ret) +- goto DONE; +- +- date = notmuch_message_file_get_header (message_file, "date"); +- _notmuch_message_set_date (message, date); +- +- _notmuch_message_index_file (message, filename); +- + _notmuch_message_sync (message); + } catch (const Xapian::Error &error) { + fprintf (stderr, "A Xapian exception occurred: %s.\n", +-- +1.6.3.3 + + diff --git a/test/corpora/default/new/04:2, b/test/corpora/default/new/04:2, new file mode 100644 index 00000000..0ce678bf --- /dev/null +++ b/test/corpora/default/new/04:2, @@ -0,0 +1,84 @@ +From: Mikhail Gusarov <dottedmag@dottedmag.net> +To: notmuch@notmuchmail.org +References: <20091117190054.GU3165@dottiness.seas.harvard.edu> +Date: Wed, 18 Nov 2009 01:02:38 +0600 +In-Reply-To: <20091117190054.GU3165@dottiness.seas.harvard.edu> (Lars + Kellogg-Stedman's message of "Tue, 17 Nov 2009 14:00:54 -0500") +Message-ID: <87iqd9rn3l.fsf@vertex.dottedmag> +User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) +MIME-Version: 1.0 +Subject: Re: [notmuch] Working with Maildir storage? +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +Content-Type: multipart/mixed; boundary="===============1958295626==" +Sender: notmuch-bounces@notmuchmail.org +Errors-To: notmuch-bounces@notmuchmail.org + +--===============1958295626== +Content-Type: multipart/signed; boundary="=-=-="; + micalg=pgp-sha1; protocol="application/pgp-signature" + +--=-=-= +Content-Transfer-Encoding: quoted-printable + + +Twas brillig at 14:00:54 17.11.2009 UTC-05 when lars@seas.harvard.edu did g= +yre and gimble: + + LK> Resulted in 4604 lines of errors along the lines of: + + LK> Error opening + LK> /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostna= +me,U=3D3026:2,S: + LK> Too many open files + +See the patch just posted here. + +=2D-=20 + http://fossarchy.blogspot.com/ + +--=-=-= +Content-Type: application/pgp-signature + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBAgAGBQJLAvNOAAoJEJ0g9lA+M4iIjLYQAKp0PXEgl3JMOEBisH52AsIK +CzzfP4Fzd41K9VH/c1EdQWDYR6FCAA4IUSNICnJhITsYUb0eC5AKJiey3JP0+rmd +s4qEFBKH2iuphv8Llltcv2Q8DyPuJBkVa3mO9XCCeABZ6v4UvnTSWRVG12csSEih +ScgienU8sMrM9LwvvVI1ZB2flm2TzsH2hWi30jIgmtBntIKJaTgbFXB50FYFwULa +gGL/oH3u+YpumedWzPZdCJrw2q7nMvYx8aQ29EDCNLZibAZe+6oDTa6Fv6/0ldpQ +U+DptR0nJGbJTWa26OTSvmyeIORjAfM+TEI68n7KO9VHYPmVh6awcf0MNKYh2xWk +eRQNBcKyQNWxeKyCCpT/rrTlpxBWahpvg+V8lkDH2W09wjRp6CUKvifK3Sz3am9m +5ZUMpvXbwkZD6Ci6l/QytbYK50e8UpvFSu5DBaxBz59ykoypuNg2ayO5Kdi6IF5d +T+Sw6wo8UKn9a33+vheIc0fkhZXbeSotEmDm7huazm6CgM3dcWXUpTuJvik1cSWp +4buv98gY6IKWKoUTXODWUr+7VR4gei8du8qOsKem+QDfNX7tmaIRjhrbB24B91Wy +td3MTJD7GjMNid0INqRY1CRMLo8YlPaq6NBZfcYtYgwa6gpJijz1/MAn8+GMrfhF +9LI8b9jopNP+pMYBohLA +=/ksP +-----END PGP SIGNATURE----- +--=-=-=-- + +--===============1958295626== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch + +--===============1958295626==-- + diff --git a/test/corpora/html/attribute-text b/test/corpora/html/attribute-text new file mode 100644 index 00000000..6dae8194 --- /dev/null +++ b/test/corpora/html/attribute-text @@ -0,0 +1,15 @@ +From: David Bremner <david@example.net> +To: David Bremner <david@example.net> +Subject: test html attachment +Date: Tue, 17 Nov 2009 21:28:38 +0600 +Message-ID: <87d1dajhgf.fsf@example.net> +MIME-Version: 1.0 +Content-Type: text/html +Content-Disposition: inline; filename=test.html + +<html> + <body> + <input value="a>swordfish"> + </body> + hunter2 +</html> diff --git a/test/corpora/html/embedded-image b/test/corpora/html/embedded-image new file mode 100644 index 00000000..40851530 --- /dev/null +++ b/test/corpora/html/embedded-image @@ -0,0 +1,69 @@ +From: =?utf-8?b?bWFsbW9ib3Jn?= <daemon@lublin.se> +To: =?utf-8?b?Ym9lbmRlLm1hbG1vYm9yZw==?= <daemon@lublin.se> +Date: Tue, 19 Jul 2016 11:54:24 +0200 +X-Feed2Imap-Version: 1.2.5 +Message-Id: <boendemalmoborg-1834@eltanin.uberspace.de> +Subject: =?utf-8?b?VGFjayBhbGxhIHRyYWZpa2FudGVyIG9jaCBmb3Rnw6RuZ2FyZSE=?= +Content-Type: multipart/alternative; boundary="=-1468922508-176605-12427-9500-21-=" +MIME-Version: 1.0 + + +--=-1468922508-176605-12427-9500-21-= +Content-Type: text/plain; charset=utf-8; format=flowed +Content-Transfer-Encoding: 8bit + +<http://malmoborg.se/2016/07/tack-alla-trafikanter-och-fotgangare/> + +Malmö 2016-07-09 + +I skrivande stund är vi i färd med att avetablera vÃ¥r entreprenad pÃ¥ +Tigern 3, Regementsgatan 6 i Malmö. Fastigheten har genomgÃ¥tt ett större +dräneringsarbete som i sin tur har inneburit vissa +trafikbegränsningar pÃ¥ Regementsgatan samt Davidshallsgatan under nÃ¥gra +veckors tid. Fastighetsägaren är mycket nöjd med vÃ¥r arbetsinsats och vi +kan glatt meddela att bÃ¥da vägfilerna kommer att öppnas inom kort. Nu +kommer den vackra fastigheten att klara sig torrskodd under mÃ¥nga Ã¥r +framöver [A] + + + +[A] http://malmoborg.se/wp-includes/images/smilies/icon_smile.gif +-- +Feed: Förvaltnings AB Malmöborg +<http://malmoborg.se> +Item: Tack alla trafikanter och fotgängare! +<http://malmoborg.se/2016/07/tack-alla-trafikanter-och-fotgangare/> +Date: 2016-07-19 11:54:24 +0200 +Author: malmoborg +Filed under: Nyheter + +--=-1468922508-176605-12427-9500-21-= +Content-Type: text/html; charset=utf-8 +Content-Transfer-Encoding: 8bit + +<table border="1" width="100%" cellpadding="0" cellspacing="0" borderspacing="0"><tr><td> +<table width="100%" bgcolor="#EDEDED" cellpadding="4" cellspacing="2"> +<tr><td align="right"><b>Feed:</b></td> +<td width="100%"><a href="http://malmoborg.se"> +<b>Förvaltnings AB Malmöborg</b> +</a> +</td></tr><tr><td align="right"><b>Item:</b></td> +<td width="100%"><a href="http://malmoborg.se/2016/07/tack-alla-trafikanter-och-fotgangare/"><b>Tack alla trafikanter och fotgängare!</b> +</a> +</td></tr></table></td></tr></table> + +<p>Malmö 2016-07-09</p> +<p>I skrivande stund är vi i färd med att avetablera vÃ¥r entreprenad pÃ¥ Tigern 3, Regementsgatan 6 i Malmö. Fastigheten har genomgÃ¥tt ett större dräneringsarbete som i sin tur har inneburit vissa trafikbegränsningar pÃ¥ Regementsgatan samt Davidshallsgatan under nÃ¥gra veckors tid. Fastighetsägaren är mycket nöjd med vÃ¥r arbetsinsats och vi kan glatt meddela att bÃ¥da vägfilerna kommer att öppnas inom kort. Nu kommer den vackra fastigheten att klara sig torrskodd under mÃ¥nga Ã¥r framöver <img src="data:image/gif;base64,R0lGODlhDwAPALMOAP/qAEVFRQAAAP/OAP/JAP+0AP6dAP/+k//9E/////// +xzMzM///6//lAAAAAAAAACH5BAEAAA4ALAAAAAAPAA8AAARb0EkZap3YVabO +GRcWcAgCnIMRTEEnCCfwpqt2mHEOagoOnz+CKnADxoKFyiHHBBCSAdOiCVg8 +KwPZa7sVrgJZQWI8FhB2msGgwTXTWGqCXP4WBQr4wjDDstQmEQA7 +" alt=":-)" class="wp-smiley" /> </p> +<p> </p> +<hr width="100%"/> +<table width="100%" cellpadding="0" cellspacing="0"> +<tr><td align="right"><font color="#ababab">Date:</font> </td><td><font color="#ababab">2016-07-19 11:54:24 +0200</font></td></tr> +<tr><td align="right"><font color="#ababab">Author:</font> </td><td><font color="#ababab">malmoborg</font></td></tr> +<tr><td align="right"><font color="#ababab">Filed under:</font> </td><td><font color="#ababab">Nyheter</font></td></tr> +</table> + +--=-1468922508-176605-12427-9500-21-=-- diff --git a/test/corpora/lkml/cur/1354585346.000260:2, b/test/corpora/lkml/cur/1354585346.000260:2, new file mode 100644 index 00000000..04664e52 --- /dev/null +++ b/test/corpora/lkml/cur/1354585346.000260:2, @@ -0,0 +1,99 @@ +Return-Path: <stefan@datenfreihafen.org> +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 055BC431FBF + for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 16:11:31 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id Vz+mNzdau2Gh for <notmuch@notmuchmail.org>; + Sat, 21 Nov 2009 16:11:30 -0800 (PST) +Received: from sirius.lasnet.de (sirius.lasnet.de [78.47.116.19]) + by olra.theworths.org (Postfix) with ESMTP id CFD61431FAE + for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 16:11:29 -0800 (PST) +Received: from p5b034af6.dip.t-dialin.net ([91.3.74.246] helo=excalibur) + by sirius.lasnet.de with esmtpsa + (Cipher TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63 #1) + id 1NC032-0000td-2v by authid <stefan@sostec.de> with cram_md5; + Sun, 22 Nov 2009 01:11:28 +0100 +Received: from stefan by excalibur with local (Exim 4.69) + (envelope-from <stefan@excalibur.local>) + id 1NC031-0001Dm-H7; Sun, 22 Nov 2009 01:11:23 +0100 +From: Stefan Schmidt <stefan@datenfreihafen.org> +To: notmuch@notmuchmail.org +Date: Sun, 22 Nov 2009 01:11:01 +0100 +Message-Id: <1258848661-4660-2-git-send-email-stefan@datenfreihafen.org> +X-Mailer: git-send-email 1.6.5.3 +In-Reply-To: <1258848661-4660-1-git-send-email-stefan@datenfreihafen.org> +References: <yes> <1258848661-4660-1-git-send-email-stefan@datenfreihafen.org> +Subject: [notmuch] [PATCH 2/2] notmuch-new: Tag mails not as unread when the + seen flag in the maildir is set. +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +X-List-Received-Date: Sun, 22 Nov 2009 00:11:31 -0000 + +With the new notmuch_message_get_flags() function we can get the information if +a message was already flagged as seen in maildir by another mailer or tool. This +gives a more realistic picture instead of flagging all as unread. + +Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org> +--- + Makefile | 2 +- + notmuch-new.c | 16 +++++++++++++++- + 2 files changed, 16 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 3fedcf1..dfcfc70 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + # Default FLAGS, (can be overridden by user such as "make CFLAGS=-O2") + WARN_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -Wswitch-enum +-CFLAGS=-O2 ++CFLAGS=-O0 -ggdb3 + + # Additional flags that we will append to whatever the user set. + # These aren't intended for the user to manipulate. +diff --git a/notmuch-new.c b/notmuch-new.c +index bc35b4e..ef4429d 100644 +--- a/notmuch-new.c ++++ b/notmuch-new.c +@@ -41,8 +41,22 @@ handle_sigint (unused (int sig)) + static void + tag_inbox_and_unread (notmuch_message_t *message) + { +- notmuch_message_add_tag (message, "inbox"); ++ char *buf; ++ int i; ++ ++ buf = notmuch_message_get_flags (message); ++ for (i = 0; i < strlen (buf); i++) { ++ /* If the S flag is set the message can be tagged as read */ ++ if (buf[i] == 'S') { ++ notmuch_message_add_tag (message, "read"); ++ goto inbox; ++ } ++ } ++ + notmuch_message_add_tag (message, "unread"); ++ ++inbox: ++ notmuch_message_add_tag (message, "inbox"); + } + + static void +-- +1.6.5.3 + + diff --git a/test/corpora/lkml/cur/1354585346.000261:2, b/test/corpora/lkml/cur/1354585346.000261:2, new file mode 100644 index 00000000..5ca81323 --- /dev/null +++ b/test/corpora/lkml/cur/1354585346.000261:2, @@ -0,0 +1,131 @@ +Return-Path: <stefan@datenfreihafen.org> +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id E4203431FBF + for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 16:11:31 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id k6PahtnYXl0O for <notmuch@notmuchmail.org>; + Sat, 21 Nov 2009 16:11:30 -0800 (PST) +Received: from sirius.lasnet.de (sirius.lasnet.de [78.47.116.19]) + by olra.theworths.org (Postfix) with ESMTP id 1BAB6431FBC + for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 16:11:30 -0800 (PST) +Received: from p5b034af6.dip.t-dialin.net ([91.3.74.246] helo=excalibur) + by sirius.lasnet.de with esmtpsa + (Cipher TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63 #1) + id 1NC02v-0000t5-LF by authid <stefan@sostec.de> with cram_md5; + Sun, 22 Nov 2009 01:11:29 +0100 +Received: from stefan by excalibur with local (Exim 4.69) + (envelope-from <stefan@excalibur.local>) + id 1NC02u-0001Dj-V9; Sun, 22 Nov 2009 01:11:16 +0100 +From: Stefan Schmidt <stefan@datenfreihafen.org> +To: notmuch@notmuchmail.org +Date: Sun, 22 Nov 2009 01:11:00 +0100 +Message-Id: <1258848661-4660-1-git-send-email-stefan@datenfreihafen.org> +X-Mailer: git-send-email 1.6.5.3 +In-Reply-To: <yes> +References: <yes> +Subject: [notmuch] [PATCH 1/2] lib/message: Add function to get maildir + flags. +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +X-List-Received-Date: Sun, 22 Nov 2009 00:11:32 -0000 + +With notmuch_message_get_flags() we gain the information if the message was +flagged as read, draft, trashed, etc. Handy for big mail spooles that were used +with another mailer. + +Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org> +--- + lib/message.cc | 26 ++++++++++++++++++++++++++ + lib/notmuch.h | 10 ++++++++++ + 2 files changed, 36 insertions(+), 0 deletions(-) + +diff --git a/lib/message.cc b/lib/message.cc +index 069cedb..9bec61e 100644 +--- a/lib/message.cc ++++ b/lib/message.cc +@@ -35,6 +35,7 @@ struct _notmuch_message { + char *thread_id; + char *in_reply_to; + char *filename; ++ char *flags; + notmuch_message_file_t *message_file; + notmuch_message_list_t *replies; + +@@ -114,6 +115,7 @@ _notmuch_message_create (const void *talloc_owner, + message->thread_id = NULL; + message->in_reply_to = NULL; + message->filename = NULL; ++ message->flags = NULL; + message->message_file = NULL; + + message->replies = _notmuch_message_list_create (message); +@@ -438,6 +440,30 @@ notmuch_message_get_filename (notmuch_message_t *message) + return message->filename; + } + ++const char * ++notmuch_message_get_flags (notmuch_message_t *message) ++{ ++ std::string filename_str, flags; ++ size_t position; ++ const char *db_path; ++ ++ if (message->flags) ++ return message->flags; ++ ++ filename_str = message->doc.get_data (); ++ db_path = notmuch_database_get_path (message->notmuch); ++ ++ if (filename_str[0] != '/') ++ filename_str.insert (0, db_path); ++ ++ /* Flags are everything behind ":" */ ++ position = filename_str.find (":"); ++ flags = filename_str.substr (position + 3); /* We don't want :2, */ ++ message->flags = talloc_strdup (message, flags.c_str ()); ++ ++ return message->flags; ++} ++ + time_t + notmuch_message_get_date (notmuch_message_t *message) + { +diff --git a/lib/notmuch.h b/lib/notmuch.h +index a61cd02..1da5dfd 100644 +--- a/lib/notmuch.h ++++ b/lib/notmuch.h +@@ -694,6 +694,16 @@ notmuch_message_get_replies (notmuch_message_t *message); + const char * + notmuch_message_get_filename (notmuch_message_t *message); + ++/* Get the maildir flags for the email corresponding to 'message'. ++ * ++ * The returned flags will be a string of ascii format flags. ++ * ++ * The returned string belongs to the message so should not be ++ * modified or freed by the caller (nor should it be referenced after ++ * the message is destroyed). */ ++const char * ++notmuch_message_get_flags (notmuch_message_t *message); ++ + /* Get the date of 'message' as a time_t value. + * + * For the original textual representation of the Date header from the +-- +1.6.5.3 + + diff --git a/test/corpora/lkml/cur/1354585346.000265:2, b/test/corpora/lkml/cur/1354585346.000265:2, new file mode 100644 index 00000000..7f3acd48 --- /dev/null +++ b/test/corpora/lkml/cur/1354585346.000265:2, @@ -0,0 +1,85 @@ +Return-Path: <keithp@keithp.com> +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 5656D431FBC + for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 16:28:35 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id Dam69vzNZiE1 for <notmuch@notmuchmail.org>; + Sat, 21 Nov 2009 16:28:34 -0800 (PST) +Received: from keithp.com (home.keithp.com [63.227.221.253]) + by olra.theworths.org (Postfix) with ESMTP id AA991431FAE + for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 16:28:34 -0800 (PST) +Received: from localhost (localhost [127.0.0.1]) + by keithp.com (Postfix) with ESMTP id 18FC076012A; + Sat, 21 Nov 2009 16:28:34 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at keithp.com +Received: from keithp.com ([127.0.0.1]) + by localhost (keithp.com [127.0.0.1]) (amavisd-new, port 10024) + with LMTP id tw1iDvWYNGRC; Sat, 21 Nov 2009 16:28:31 -0800 (PST) +Received: by keithp.com (Postfix, from userid 1033) + id 60F3176012B; Sat, 21 Nov 2009 16:28:31 -0800 (PST) +Received: from keithp.com (localhost [127.0.0.1]) + by keithp.com (Postfix) with ESMTP id 5330D76012A; + Sat, 21 Nov 2009 16:28:31 -0800 (PST) +From: Keith Packard <keithp@keithp.com> +To: Stefan Schmidt <stefan@datenfreihafen.org>, notmuch@notmuchmail.org +In-Reply-To: <1258848661-4660-1-git-send-email-stefan@datenfreihafen.org> +References: <yes> <1258848661-4660-1-git-send-email-stefan@datenfreihafen.org> +Date: Sat, 21 Nov 2009 16:28:30 -0800 +Message-ID: <yunvdh3pfm9.fsf@aiko.keithp.com> +MIME-Version: 1.0 +Content-Type: multipart/signed; boundary="=-=-="; + micalg=pgp-sha1; protocol="application/pgp-signature" +Subject: Re: [notmuch] [PATCH 1/2] lib/message: Add function to get maildir + flags. +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +X-List-Received-Date: Sun, 22 Nov 2009 00:28:35 -0000 + +--=-=-= +Content-Transfer-Encoding: quoted-printable + +On Sun, 22 Nov 2009 01:11:00 +0100, Stefan Schmidt <stefan@datenfreihafen.o= +rg> wrote: + +> +const char * +> +notmuch_message_get_flags (notmuch_message_t *message) + +This function should interpret the flags that it finds and return a +suitable set of notmuch tags. I'd suggest that 'unread' messages get +both 'unread' and 'inbox' tags, as Maildir doesn't distinguish between +'don't show this to be by default again please' and 'I've read this +message'. It seems best to hide the maildir-specific details inside the +library instead of exposing them. + +Also, we have only the 'unread' tag; we don't have a 'read' tag, which +would simply be the inverse of 'unread'. + +=2D-=20 +keith.packard@intel.com + +--=-=-= +Content-Type: application/pgp-signature + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iD8DBQFLCIWuQp8BWwlsTdMRAvcTAKDXHYc6MTuuZFMzHvZFs1omBbr9CACdEY/b +jqyT/QmmgoA/GtIcs/DfLMY= +=LVlh +-----END PGP SIGNATURE----- +--=-=-=-- + diff --git a/test/corpora/lkml/cur/1354585346.000323:2, b/test/corpora/lkml/cur/1354585346.000323:2, new file mode 100644 index 00000000..b7fc28fb --- /dev/null +++ b/test/corpora/lkml/cur/1354585346.000323:2, @@ -0,0 +1,105 @@ +Return-Path: <stefan@datenfreihafen.org> +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 912FF431FBF + for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 10:33:44 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 9T+Abdbhab0i for <notmuch@notmuchmail.org>; + Sun, 22 Nov 2009 10:33:43 -0800 (PST) +Received: from sirius.lasnet.de (sirius.lasnet.de [78.47.116.19]) + by olra.theworths.org (Postfix) with ESMTP id 39D1C431FAE + for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 10:33:43 -0800 (PST) +Received: from p5b0353d3.dip.t-dialin.net ([91.3.83.211] helo=excalibur) + by sirius.lasnet.de with esmtpsa + (Cipher TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63 #1) + id 1NCHFh-0000dR-It by authid <stefan@sostec.de> with cram_md5; + Sun, 22 Nov 2009 19:33:40 +0100 +Received: from stefan by excalibur with local (Exim 4.69) + (envelope-from <stefan@excalibur.local>) + id 1NCHFi-0002ot-2C; Sun, 22 Nov 2009 19:33:38 +0100 +Date: Sun, 22 Nov 2009 19:33:38 +0100 +From: Stefan Schmidt <stefan@datenfreihafen.org> +To: Keith Packard <keithp@keithp.com> +Message-ID: <20091122183338.GB5735@excalibur.local> +References: <yes> <1258848661-4660-1-git-send-email-stefan@datenfreihafen.org> + <yunvdh3pfm9.fsf@aiko.keithp.com> +MIME-Version: 1.0 +Content-Type: multipart/signed; micalg=pgp-sha1; + protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" +Content-Disposition: inline +In-Reply-To: <yunvdh3pfm9.fsf@aiko.keithp.com> +X-Mailer: Mutt http://www.mutt.org/ +X-KeyID: 0xDDF51665 +X-Website: http://www.datenfreihafen.org/ +User-Agent: Mutt/1.5.20 (2009-06-14) +Cc: notmuch@notmuchmail.org +Subject: Re: [notmuch] [PATCH 1/2] lib/message: Add function to get maildir + flags. +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +X-List-Received-Date: Sun, 22 Nov 2009 18:33:44 -0000 + + +--C7zPtVaVf+AK4Oqc +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +Hello. + +On Sat, 2009-11-21 at 16:28, Keith Packard wrote: +> On Sun, 22 Nov 2009 01:11:00 +0100, Stefan Schmidt <stefan@datenfreihafen= +=2Eorg> wrote: +>=20 +> > +const char * +> > +notmuch_message_get_flags (notmuch_message_t *message) +>=20 +> This function should interpret the flags that it finds and return a +> suitable set of notmuch tags. I'd suggest that 'unread' messages get +> both 'unread' and 'inbox' tags, as Maildir doesn't distinguish between +> 'don't show this to be by default again please' and 'I've read this +> message'. It seems best to hide the maildir-specific details inside the +> library instead of exposing them. + +Thanks for the review. On a second thought the interface was really a bit u= +gly. +:) + +I'm just back to my box and going through the outstanding mails shows me th= +at +Michiel Buddingh has a more complete patch on the +convert-maildir-flags-into-tags issue which Carl has tagged for review. Will +wait what comes out of it and if anything is left for me to. :) + +regards +Stefan Schmidt + +--C7zPtVaVf+AK4Oqc +Content-Type: application/pgp-signature; name="signature.asc" +Content-Description: Digital signature +Content-Disposition: inline + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) +Comment: http://www.datenfreihafen.org/contact.html + +iEYEARECAAYFAksJhAIACgkQbNSsvd31FmWDDgCgswbE3BE2XeExPzBBJf86efDw +aFwAoMc3vaBmTjB2kG5ORUmk1E/ICBXK +=k8v5 +-----END PGP SIGNATURE----- + +--C7zPtVaVf+AK4Oqc-- + diff --git a/test/corpora/lkml/cur/1354585346.000324:2, b/test/corpora/lkml/cur/1354585346.000324:2, new file mode 100644 index 00000000..a72ef9a7 --- /dev/null +++ b/test/corpora/lkml/cur/1354585346.000324:2, @@ -0,0 +1,71 @@ +Return-Path: <michiel@michielbuddingh.net> +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id B580E431FBC + for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 10:55:27 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id JHZeV0d6+Q8a for <notmuch@notmuchmail.org>; + Sun, 22 Nov 2009 10:55:26 -0800 (PST) +Received: from aegir.org.uk (aegir.org.uk [87.238.170.13]) + by olra.theworths.org (Postfix) with ESMTP id C6AAC431FAE + for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 10:55:26 -0800 (PST) +Received: from localhost.localdomain (109-9-ftth.onsnetstudenten.nl + [145.120.9.109]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by aegir.org.uk (Postfix) with ESMTPSA id 48CE72E02A; + Sun, 22 Nov 2009 19:55:26 +0100 (CET) +Date: Sun, 22 Nov 2009 19:55:26 +0100 +From: Michiel Buddingh' <michiel@michielbuddingh.net> +To: notmuch@notmuchmail.org, stefan@datenfreihafen.org, + keithp@keithp.com +Message-ID: <4b09891e.YhJ/aJZOBwneOaFr%michiel@michielbuddingh.net> +References: <yes> <1258848661-4660-1-git-send-email-stefan@datenfreihafen.org> + <yunvdh3pfm9.fsf@aiko.keithp.com> + <20091122183338.GB5735@excalibur.local> +In-Reply-To: <20091122183338.GB5735@excalibur.local> +User-Agent: Heirloom mailx 12.4 7/29/08 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Subject: Re: [notmuch] [PATCH 1/2] lib/message: Add function to get maildir + flags. +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +X-List-Received-Date: Sun, 22 Nov 2009 18:55:27 -0000 + +Stefan Schmidt <stefan@datenfreihafen.org> wrote: +> > This function should interpret the flags that it finds and return a +> > suitable set of notmuch tags. I'd suggest that 'unread' messages get +> > both 'unread' and 'inbox' tags, as Maildir doesn't distinguish between +> > 'don't show this to be by default again please' and 'I've read this +> > message'. It seems best to hide the maildir-specific details inside the +> > library instead of exposing them. +> +> Thanks for the review. On a second thought the interface was really a bit ugly. +> :) +> +> I'm just back to my box and going through the outstanding mails shows me that +> Michiel Buddingh has a more complete patch on the +> convert-maildir-flags-into-tags issue which Carl has tagged for review. Will +> wait what comes out of it and if anything is left for me to. :) + +Apologies. In my haste to cover up my appalling and incorrect first patch, I +neglected to review the archives to see if someone had already done this. Sorry +for stealing your thunder. + +Michiel + diff --git a/test/corpora/lkml/cur/1354585346.000325:2, b/test/corpora/lkml/cur/1354585346.000325:2, new file mode 100644 index 00000000..fc2da165 --- /dev/null +++ b/test/corpora/lkml/cur/1354585346.000325:2, @@ -0,0 +1,86 @@ +Return-Path: <stefan@datenfreihafen.org> +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id B2DE3431FBC + for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 11:52:54 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id TrLH7uZhkvFU for <notmuch@notmuchmail.org>; + Sun, 22 Nov 2009 11:52:53 -0800 (PST) +Received: from sirius.lasnet.de (sirius.lasnet.de [78.47.116.19]) + by olra.theworths.org (Postfix) with ESMTP id 7024B431FAE + for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 11:52:53 -0800 (PST) +Received: from p5b0353d3.dip.t-dialin.net ([91.3.83.211] helo=excalibur) + by sirius.lasnet.de with esmtpsa + (Cipher TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63 #1) + id 1NCIUJ-0002QO-OM by authid <stefan@sostec.de> with cram_md5; + Sun, 22 Nov 2009 20:52:50 +0100 +Received: from stefan by excalibur with local (Exim 4.69) + (envelope-from <stefan@excalibur.local>) + id 1NCIUI-0003ON-Sr; Sun, 22 Nov 2009 20:52:46 +0100 +Date: Sun, 22 Nov 2009 20:52:46 +0100 +From: Stefan Schmidt <stefan@datenfreihafen.org> +To: Michiel Buddingh' <michiel@michielbuddingh.net> +Message-ID: <20091122195246.GC5735@excalibur.local> +References: <yes> <1258848661-4660-1-git-send-email-stefan@datenfreihafen.org> + <yunvdh3pfm9.fsf@aiko.keithp.com> + <20091122183338.GB5735@excalibur.local> + <4b09891e.YhJ/aJZOBwneOaFr%michiel@michielbuddingh.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <4b09891e.YhJ/aJZOBwneOaFr%michiel@michielbuddingh.net> +X-Mailer: Mutt http://www.mutt.org/ +X-KeyID: 0xDDF51665 +X-Website: http://www.datenfreihafen.org/ +User-Agent: Mutt/1.5.20 (2009-06-14) +Cc: notmuch@notmuchmail.org +Subject: Re: [notmuch] [PATCH 1/2] lib/message: Add function to get maildir + flags. +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +X-List-Received-Date: Sun, 22 Nov 2009 19:52:54 -0000 + +Hello. + +On Sun, 2009-11-22 at 19:55, Michiel Buddingh' wrote: +> Stefan Schmidt <stefan@datenfreihafen.org> wrote: +> > > This function should interpret the flags that it finds and return a +> > > suitable set of notmuch tags. I'd suggest that 'unread' messages get +> > > both 'unread' and 'inbox' tags, as Maildir doesn't distinguish between +> > > 'don't show this to be by default again please' and 'I've read this +> > > message'. It seems best to hide the maildir-specific details inside the +> > > library instead of exposing them. +> > +> > Thanks for the review. On a second thought the interface was really a bit ugly. +> > :) +> > +> > I'm just back to my box and going through the outstanding mails shows me that +> > Michiel Buddingh has a more complete patch on the +> > convert-maildir-flags-into-tags issue which Carl has tagged for review. Will +> > wait what comes out of it and if anything is left for me to. :) +> +> Apologies. In my haste to cover up my appalling and incorrect first patch, I +> neglected to review the archives to see if someone had already done this. Sorry +> for stealing your thunder. + +No need to be sorry. I'm interestecd in having this itch scratched, but don't +care who is doing it. :) + +Just go ahead and get it in after Carl's review. + +regards +Stefan Schmidt + diff --git a/test/corpora/lkml/cur/1354585346.000539:2, b/test/corpora/lkml/cur/1354585346.000539:2, new file mode 100644 index 00000000..daa5673f --- /dev/null +++ b/test/corpora/lkml/cur/1354585346.000539:2, @@ -0,0 +1,81 @@ +Return-Path: <ingmar@exherbo.org> +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id BAA52431FBC + for <notmuch@notmuchmail.org>; Thu, 26 Nov 2009 00:43:44 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 0U+OLchDCS5T for <notmuch@notmuchmail.org>; + Thu, 26 Nov 2009 00:43:44 -0800 (PST) +Received: from bach.exherbo.org (bach.exherbo.org [78.47.197.147]) + by olra.theworths.org (Postfix) with ESMTP id 05223431FAE + for <notmuch@notmuchmail.org>; Thu, 26 Nov 2009 00:43:43 -0800 (PST) +Received: from [83.101.72.69] (helo=localhost) + by bach.exherbo.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) + (envelope-from <ingmar@exherbo.org>) id 1NDZx1-0000VV-3u + for notmuch@notmuchmail.org; Thu, 26 Nov 2009 08:43:43 +0000 +Content-Type: text/plain; charset=utf8 +From: Ingmar Vanhassel <ingmar@exherbo.org> +To: notmuch <notmuch@notmuchmail.org> +In-reply-to: <1259223435-29656-1-git-send-email-stefan@datenfreihafen.org> +References: <yes> <1259223435-29656-1-git-send-email-stefan@datenfreihafen.org> +Date: Thu, 26 Nov 2009 09:43:42 +0100 +Message-Id: <1259224970-sup-5259@cannonball> +User-Agent: Sup/git +Content-Transfer-Encoding: 8bit +Subject: Re: [notmuch] [PATCH] Makefile: Enable backslash escapes for echo. +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +X-List-Received-Date: Thu, 26 Nov 2009 08:43:44 -0000 + +Excerpts from Stefan Schmidt's message of Thu Nov 26 09:17:15 +0100 2009: +> This fixes a visual glitch during a silent compile. +> Before: +> Use "make V=1" to see the verbose compile lines.\n CC debugger.o +> CC gmime-filter-reply.o +> +> After: +> Use "make V=1" to see the verbose compile lines. +> CC debugger.o +> CC gmime-filter-reply.o +> +> Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org> + +Looks right, works here with bash, dash & zsh, so: + +Reviewed-by: Ingmar Vanhassel <ingmar@exherbo.org> + +Thanks! + +> --- +> Makefile | 2 +- +> 1 files changed, 1 insertions(+), 1 deletions(-) +> +> diff --git a/Makefile b/Makefile +> index 2cd1b1b..2d19a6e 100644 +> --- a/Makefile +> +++ b/Makefile +> @@ -41,7 +41,7 @@ include Makefile.config +> # user how to enable verbose compiles. +> ifeq ($(V),) +> quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n" +> -quiet = @echo $(quiet_DOC)$(eval quiet_DOC:=)" $1 $@"; $($1) +> +quiet = @echo -e $(quiet_DOC)$(eval quiet_DOC:=)" $1 $@"; $($1) +> endif +> # The user has explicitly enabled quiet compilation. +> ifeq ($(V),0) +-- +Exherbo KDE, X.org maintainer + diff --git a/test/corpora/lkml/cur/1354585346.000541:2, b/test/corpora/lkml/cur/1354585346.000541:2, new file mode 100644 index 00000000..3e70055f --- /dev/null +++ b/test/corpora/lkml/cur/1354585346.000541:2, @@ -0,0 +1,64 @@ +Return-Path: <kha@treskal.com> +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 54307431FBC + for <notmuch@notmuchmail.org>; Thu, 26 Nov 2009 03:41:18 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id TBdvxm5kBScu for <notmuch@notmuchmail.org>; + Thu, 26 Nov 2009 03:41:13 -0800 (PST) +Received: from mail1.space2u.com (mail1.space2u.com [62.20.1.135]) + by olra.theworths.org (Postfix) with ESMTP id 80538431FAE + for <notmuch@notmuchmail.org>; Thu, 26 Nov 2009 03:41:13 -0800 (PST) +Received: from mail-bw0-f224.google.com (mail-bw0-f224.google.com + [209.85.218.224]) (authenticated bits=0) + by mail1.space2u.com (8.14.3/8.14.3) with ESMTP id nAQBf0Ar018995 + (version=TLSv1/SSLv3 cipher=DES-CBC3-SHA bits=168 verify=NOT) + for <notmuch@notmuchmail.org>; Thu, 26 Nov 2009 12:41:01 +0100 +Received: by bwz24 with SMTP id 24so480173bwz.30 + for <notmuch@notmuchmail.org>; Thu, 26 Nov 2009 03:41:11 -0800 (PST) +MIME-Version: 1.0 +Received: by 10.204.153.3 with SMTP id i3mr2263267bkw.26.1259235670122; Thu, + 26 Nov 2009 03:41:10 -0800 (PST) +In-Reply-To: <20091126110505.GI25119@ryngle.com> +References: <1259223435-29656-1-git-send-email-stefan@datenfreihafen.org> + <20091126110505.GI25119@ryngle.com> +Date: Thu, 26 Nov 2009 12:41:10 +0100 +Message-ID: <b8197bcb0911260341o480edc2bof8a30f0b724dd96@mail.gmail.com> +From: Karl Wiberg <kha@treskal.com> +To: Jan Janak <jan@ryngle.com> +Content-Type: text/plain; charset=UTF-8 +Cc: notmuch@notmuchmail.org +Subject: Re: [notmuch] [PATCH] Makefile: Enable backslash escapes for echo. +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +X-List-Received-Date: Thu, 26 Nov 2009 11:41:18 -0000 + +On Thu, Nov 26, 2009 at 12:05 PM, Jan Janak <jan@ryngle.com> wrote: + +> I sent exactly the same patch a couple of days ago and it was +> rejected because it does not work everywhere, see: +> +> http://notmuchmail.org/pipermail/notmuch/2009/000370.html + +And as I said in that thread, I believe you should use printf instead. +(http://www.in-ulm.de/~mascheck/various/echo+printf/ seems like a good +reference in this matter.) + +-- +Karl Wiberg, kha@treskal.com + subrabbit.wordpress.com + www.treskal.com/kalle + diff --git a/test/corpora/lkml/cur/1382298587.001724:2, b/test/corpora/lkml/cur/1382298587.001724:2, new file mode 100644 index 00000000..69c794c7 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001724:2, @@ -0,0 +1,104 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: [RFC][PATCH 10/10] cifs: add mount option to enable local caching +Date: Tue, 22 Jun 2010 20:55:09 +0530 +Lines: 66 +Message-ID: <1277220309-3757-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 17:25:29 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OR5Ls-0004PS-BM + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 17:25:28 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1755015Ab0FVPZ1 (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 11:25:27 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:48639 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1754070Ab0FVPZ1 (ORCPT + <rfc822;groupwise-SJayaraman-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org:0:0>); + Tue, 22 Jun 2010 11:25:27 -0400 +X-Greylist: delayed 316 seconds by postgrey-1.27 at vger.kernel.org; Tue, 22 Jun 2010 11:25:26 EDT +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:25:11 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001750> + +Add a mount option 'fsc' to enable local caching on CIFS. + +As the cifs-utils (userspace) changes are not done yet, this patch enables +'fsc' by default to assist testing. + +Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +--- + fs/cifs/cifs_fs_sb.h | 1 + + fs/cifs/connect.c | 8 ++++++++ + 2 files changed, 9 insertions(+), 0 deletions(-) + +diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h +index 246a167..9e77145 100644 +--- a/fs/cifs/cifs_fs_sb.h ++++ b/fs/cifs/cifs_fs_sb.h +@@ -35,6 +35,7 @@ + #define CIFS_MOUNT_DYNPERM 0x1000 /* allow in-memory only mode setting */ + #define CIFS_MOUNT_NOPOSIXBRL 0x2000 /* mandatory not posix byte range lock */ + #define CIFS_MOUNT_NOSSYNC 0x4000 /* don't do slow SMBflush on every sync*/ ++#define CIFS_MOUNT_FSCACHE 0x8000 /* local caching enabled */ + + struct cifs_sb_info { + struct cifsTconInfo *tcon; /* primary mount */ +diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c +index 4844dbd..6c6ff3c 100644 +--- a/fs/cifs/connect.c ++++ b/fs/cifs/connect.c +@@ -98,6 +98,7 @@ struct smb_vol { + bool noblocksnd:1; + bool noautotune:1; + bool nostrictsync:1; /* do not force expensive SMBflush on every sync */ ++ bool fsc:1; /* enable fscache */ + unsigned int rsize; + unsigned int wsize; + bool sockopt_tcp_nodelay:1; +@@ -843,6 +844,9 @@ cifs_parse_mount_options(char *options, const char *devname, + /* default to using server inode numbers where available */ + vol->server_ino = 1; + ++ /* XXX: default to fsc for testing until mount.cifs pieces are done */ ++ vol->fsc = 1; ++ + if (!options) + return 1; + +@@ -1332,6 +1336,8 @@ cifs_parse_mount_options(char *options, const char *devname, + printk(KERN_WARNING "CIFS: Mount option noac not " + "supported. Instead set " + "/proc/fs/cifs/LookupCacheEnabled to 0\n"); ++ } else if (strnicmp(data, "fsc", 3) == 0) { ++ vol->fsc = true; + } else + printk(KERN_WARNING "CIFS: Unknown mount option %s\n", + data); +@@ -2405,6 +2411,8 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info, + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_GID; + if (pvolume_info->dynperm) + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM; ++ if (pvolume_info->fsc) ++ cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_FSCACHE; + if (pvolume_info->direct_io) { + cFYI(1, "mounting share using direct i/o"); + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; +-- +1.6.4.2 + + + diff --git a/test/corpora/lkml/cur/1382298587.001730:2, b/test/corpora/lkml/cur/1382298587.001730:2, new file mode 100644 index 00000000..840be2ee --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001730:2, @@ -0,0 +1,103 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: [RFC][PATCH 00/10] cifs: local caching support using FS-Cache +Date: Tue, 22 Jun 2010 20:50:05 +0530 +Lines: 66 +Message-ID: <1277220005-3322-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 17:40:38 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OR5aY-00055O-BD + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 17:40:38 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1751889Ab0FVPkf (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 11:40:35 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:50040 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751554Ab0FVPkf (ORCPT + <rfc822;groupwise-SJayaraman-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org:0:0>); + Tue, 22 Jun 2010 11:40:35 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:20:07 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001756> + +This patchset is a first stab at adding persistent, local caching facility for +CIFS using the FS-Cache interface. + +The index hierarchy which is mainly used to locate a file object or discard +a certain subset of the files cached, currently has three levels: + - Server + - Share + - File + +The server index object is keyed by hostname of the server. The superblock +index object is keyed by the sharename and the inode object is keyed by the +UniqueId. The cache coherency is ensured by checking the 'LastWriteTime' and +size of file. + +To use this, apply this patchset in order, mount the share with rsize=4096 and +try copying a huge file (say few hundred MBs) from mount point to local +filesystem. During the first time, the cache will be initialized. When you copy +the second time, it should read from the local cache. + +To reduce the impact of page cache and see the local caching in action +readily, try doing a sync and drop the caches by doing: + sync; echo 3 > /proc/sys/vm/drop_caches + +Known issues +------------- + - the cache coherency check may not be reliable always as some + CIFS servers are known not to update mtime until the filehandle is + closed. + - not all the Servers under all circumstances provide a unique + 'UniqueId'. + +Todo's +------- + - improvements to avoid potential key collisions + - address the above known issues + +This set is lightly tested and all the bugs seen during my testing have been +fixed. However, this can be considered as an RFC for now. + +Any Comments or Suggestions are welcome. + +Suresh Jayaraman (10) + cifs: add kernel config option for CIFS Client caching support + cifs: guard cifsglob.h against multiple inclusion + cifs: register CIFS for caching + cifs: define server-level cache index objects and register them with FS-Cache + cifs: define superblock-level cache index objects and register them + cifs: define inode-level cache object and register them + cifs: FS-Cache page management + cifs: store pages into local cache + cifs: read pages from FS-Cache + cifs: add mount option to enable local caching + + Kconfig | 9 ++ + Makefile | 2 + cache.c | 251 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + cifs_fs_sb.h | 1 + cifsfs.c | 15 +++ + cifsglob.h | 14 +++ + connect.c | 16 +++ + file.c | 51 +++++++++++ + fscache.c | 244 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + fscache.h | 135 +++++++++++++++++++++++++++++++ + inode.c | 4 + 11 files changed, 742 insertions(+) + + + diff --git a/test/corpora/lkml/cur/1382298587.001731:2, b/test/corpora/lkml/cur/1382298587.001731:2, new file mode 100644 index 00000000..d8b3168c --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001731:2, @@ -0,0 +1,67 @@ +From: Suresh Jayaraman <sjayaraman@suse.de> +Subject: [RFC][PATCH 01/10] cifs: add kernel config option for CIFS Client caching support +Date: Tue, 22 Jun 2010 20:52:38 +0530 +Lines: 30 +Message-ID: <1277220158-3405-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com> +To: Steve French <smfrench@gmail.com> +X-From: linux-kernel-owner@vger.kernel.org Tue Jun 22 17:43:27 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OR5dG-0007m9-Ij + for glk-linux-kernel-3@lo.gmane.org; Tue, 22 Jun 2010 17:43:26 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1751536Ab0FVPnS (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 22 Jun 2010 11:43:18 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:51303 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1750800Ab0FVPnR (ORCPT + <rfc822;groupwise-SJayaraman@novell.com:0:0>); + Tue, 22 Jun 2010 11:43:17 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:22:40 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001757> + +Add a kernel config option to enable local caching for CIFS. + +Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> +--- + fs/cifs/Kconfig | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +diff --git a/fs/cifs/Kconfig b/fs/cifs/Kconfig +index 80f3525..5739fd7 100644 +--- a/fs/cifs/Kconfig ++++ b/fs/cifs/Kconfig +@@ -131,6 +131,15 @@ config CIFS_DFS_UPCALL + IP addresses) which is needed for implicit mounts of DFS junction + points. If unsure, say N. + ++config CIFS_FSCACHE ++ bool "Provide CIFS client caching support (EXPERIMENTAL)" ++ depends on EXPERIMENTAL ++ depends on CIFS=m && FSCACHE || CIFS=y && FSCACHE=y ++ help ++ Makes CIFS FS-Cache capable. Say Y here if you want your CIFS data ++ to be cached locally on disk through the general filesystem cache ++ manager. If unsure, say N. ++ + config CIFS_EXPERIMENTAL + bool "CIFS Experimental Features (EXPERIMENTAL)" + depends on CIFS && EXPERIMENTAL +-- +1.6.4.2 + + + diff --git a/test/corpora/lkml/cur/1382298587.001732:2, b/test/corpora/lkml/cur/1382298587.001732:2, new file mode 100644 index 00000000..8850953a --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001732:2, @@ -0,0 +1,73 @@ +From: Suresh Jayaraman <sjayaraman@suse.de> +Subject: [RFC][PATCH 02/10] cifs: guard cifsglob.h against multiple inclusion +Date: Tue, 22 Jun 2010 20:52:50 +0530 +Lines: 36 +Message-ID: <1277220170-3442-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com> +To: Steve French <smfrench@gmail.com> +X-From: linux-fsdevel-owner@vger.kernel.org Tue Jun 22 17:43:39 2010 +Return-path: <linux-fsdevel-owner@vger.kernel.org> +Envelope-to: lnx-linux-fsdevel@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-fsdevel-owner@vger.kernel.org>) + id 1OR5dT-0007sB-18 + for lnx-linux-fsdevel@lo.gmane.org; Tue, 22 Jun 2010 17:43:39 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1752441Ab0FVPn3 (ORCPT <rfc822;lnx-linux-fsdevel@m.gmane.org>); + Tue, 22 Jun 2010 11:43:29 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:41538 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751889Ab0FVPn2 (ORCPT + <rfc822;groupwise-SJayaraman@novell.com:0:0>); + Tue, 22 Jun 2010 11:43:28 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:22:52 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-fsdevel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-fsdevel.vger.kernel.org> +X-Mailing-List: linux-fsdevel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001758> + +Add conditional compile macros to guard the header file against multiple +inclusion. + +Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> +--- + fs/cifs/cifsglob.h | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h +index a88479c..6b2c39d 100644 +--- a/fs/cifs/cifsglob.h ++++ b/fs/cifs/cifsglob.h +@@ -16,6 +16,9 @@ + * the GNU Lesser General Public License for more details. + * + */ ++#ifndef _CIFS_GLOB_H ++#define _CIFS_GLOB_H ++ + #include <linux/in.h> + #include <linux/in6.h> + #include <linux/slab.h> +@@ -733,3 +736,5 @@ GLOBAL_EXTERN unsigned int cifs_min_small; /* min size of small buf pool */ + GLOBAL_EXTERN unsigned int cifs_max_pending; /* MAX requests at once to server*/ + + extern const struct slow_work_ops cifs_oplock_break_ops; ++ ++#endif /* _CIFS_GLOB_H */ +-- +1.6.4.2 + +-- +To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298587.001733:2, b/test/corpora/lkml/cur/1382298587.001733:2, new file mode 100644 index 00000000..d782f90e --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001733:2, @@ -0,0 +1,211 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: [RFC][PATCH 03/10] cifs: register CIFS for caching +Date: Tue, 22 Jun 2010 20:53:09 +0530 +Lines: 174 +Message-ID: <1277220189-3485-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 17:43:52 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OR5de-0007xC-Ov + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 17:43:51 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1753125Ab0FVPnt (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 11:43:49 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:55866 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751261Ab0FVPnt (ORCPT + <rfc822;groupwise-SJayaraman-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org:0:0>); + Tue, 22 Jun 2010 11:43:49 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:23:11 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001759> + +Define CIFS for FS-Cache and register for caching. Upon registration the +top-level index object cookie will be stuck to the netfs definition by +FS-Cache. + +Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +--- + fs/cifs/Makefile | 2 ++ + fs/cifs/cache.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + fs/cifs/cifsfs.c | 8 ++++++++ + fs/cifs/fscache.h | 40 ++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 103 insertions(+), 0 deletions(-) + create mode 100644 fs/cifs/cache.c + create mode 100644 fs/cifs/fscache.h + +diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile +index 9948c00..e2de709 100644 +--- a/fs/cifs/Makefile ++++ b/fs/cifs/Makefile +@@ -11,3 +11,5 @@ cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \ + cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o + + cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o ++ ++cifs-$(CONFIG_CIFS_FSCACHE) += cache.o +diff --git a/fs/cifs/cache.c b/fs/cifs/cache.c +new file mode 100644 +index 0000000..1080b96 +--- /dev/null ++++ b/fs/cifs/cache.c +@@ -0,0 +1,53 @@ ++/* ++ * fs/cifs/cache.c - CIFS filesystem cache index structure definitions ++ * ++ * Copyright (c) 2010 Novell, Inc. ++ * Authors(s): Suresh Jayaraman (sjayaraman-l3A5Bk7waGM@public.gmane.org> ++ * ++ * This library is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as published ++ * by the Free Software Foundation; either version 2.1 of the License, or ++ * (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ++ * the GNU Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++#include <linux/init.h> ++#include <linux/kernel.h> ++#include <linux/sched.h> ++#include <linux/mm.h> ++ ++#include "fscache.h" ++#include "cifsglob.h" ++#include "cifs_debug.h" ++ ++/* ++ * CIFS filesystem definition for FS-Cache ++ */ ++struct fscache_netfs cifs_fscache_netfs = { ++ .name = "cifs", ++ .version = 0, ++}; ++ ++/* ++ * Register CIFS for caching with FS-Cache ++ */ ++int cifs_fscache_register(void) ++{ ++ return fscache_register_netfs(&cifs_fscache_netfs); ++} ++ ++/* ++ * Unregister CIFS for caching ++ */ ++void cifs_fscache_unregister(void) ++{ ++ fscache_unregister_netfs(&cifs_fscache_netfs); ++} ++ +diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c +index 484e52b..c2a7aa9 100644 +--- a/fs/cifs/cifsfs.c ++++ b/fs/cifs/cifsfs.c +@@ -47,6 +47,7 @@ + #include <linux/key-type.h> + #include "dns_resolve.h" + #include "cifs_spnego.h" ++#include "fscache.h" + #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ + + int cifsFYI = 0; +@@ -902,6 +903,10 @@ init_cifs(void) + cFYI(1, "cifs_max_pending set to max of 256"); + } + ++ rc = cifs_fscache_register(); ++ if (rc) ++ goto out; ++ + rc = cifs_init_inodecache(); + if (rc) + goto out_clean_proc; +@@ -949,8 +954,10 @@ init_cifs(void) + cifs_destroy_mids(); + out_destroy_inodecache: + cifs_destroy_inodecache(); ++ cifs_fscache_unregister(); + out_clean_proc: + cifs_proc_clean(); ++ out: + return rc; + } + +@@ -959,6 +966,7 @@ exit_cifs(void) + { + cFYI(DBG2, "exit_cifs"); + cifs_proc_clean(); ++ cifs_fscache_unregister(); + #ifdef CONFIG_CIFS_DFS_UPCALL + cifs_dfs_release_automount_timer(); + unregister_key_type(&key_type_dns_resolver); +diff --git a/fs/cifs/fscache.h b/fs/cifs/fscache.h +new file mode 100644 +index 0000000..cec9e2b +--- /dev/null ++++ b/fs/cifs/fscache.h +@@ -0,0 +1,40 @@ ++/* ++ * fs/cifs/fscache.h - CIFS filesystem cache interface definitions ++ * ++ * Copyright (c) 2010 Novell, Inc. ++ * Authors(s): Suresh Jayaraman (sjayaraman-l3A5Bk7waGM@public.gmane.org> ++ * ++ * This library is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as published ++ * by the Free Software Foundation; either version 2.1 of the License, or ++ * (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ++ * the GNU Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++#ifndef _CIFS_FSCACHE_H ++#define _CIFS_FSCACHE_H ++ ++#include <linux/fscache.h> ++#include "cifsglob.h" ++ ++#ifdef CONFIG_CIFS_FSCACHE ++ ++extern struct fscache_netfs cifs_fscache_netfs; ++ ++extern int cifs_fscache_register(void); ++extern void cifs_fscache_unregister(void); ++ ++#else /* CONFIG_CIFS_FSCACHE */ ++static inline int cifs_fscache_register(void) { return 0; } ++static inline void cifs_fscache_unregister(void) {} ++ ++#endif /* CONFIG_CIFS_FSCACHE */ ++ ++#endif /* _CIFS_FSCACHE_H */ +-- +1.6.4.2 + + + diff --git a/test/corpora/lkml/cur/1382298587.001734:2, b/test/corpora/lkml/cur/1382298587.001734:2, new file mode 100644 index 00000000..4b64bc3b --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001734:2, @@ -0,0 +1,223 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: [RFC][PATCH 04/10] cifs: define server-level cache index objects and register them with FS-Cache +Date: Tue, 22 Jun 2010 20:53:18 +0530 +Lines: 186 +Message-ID: <1277220198-3522-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 17:44:26 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OR5eD-0008G7-KP + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 17:44:26 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1753942Ab0FVPoC (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 11:44:02 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:58783 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751265Ab0FVPoA (ORCPT + <rfc822;groupwise-SJayaraman-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org:0:0>); + Tue, 22 Jun 2010 11:44:00 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:23:20 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001760> + +Define server-level cache index objects (as managed by TCP_ServerInfo structs). +Each server object is created in the CIFS top-level index object and is itself +an index into which superblock-level objects are inserted. + +Currently, the server objects are keyed by hostname. + +Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +--- + fs/cifs/Makefile | 2 +- + fs/cifs/cache.c | 25 +++++++++++++++++++++++++ + fs/cifs/cifsglob.h | 3 +++ + fs/cifs/connect.c | 4 ++++ + fs/cifs/fscache.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ + fs/cifs/fscache.h | 12 ++++++++++++ + 6 files changed, 92 insertions(+), 1 deletion(-) + create mode 100644 fs/cifs/fscache.c + +Index: cifs-2.6/fs/cifs/Makefile +=================================================================== +--- cifs-2.6.orig/fs/cifs/Makefile ++++ cifs-2.6/fs/cifs/Makefile +@@ -12,4 +12,4 @@ cifs-$(CONFIG_CIFS_UPCALL) += cifs_spneg + + cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o + +-cifs-$(CONFIG_CIFS_FSCACHE) += cache.o ++cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cache.o +Index: cifs-2.6/fs/cifs/cache.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/cache.c ++++ cifs-2.6/fs/cifs/cache.c +@@ -51,3 +51,28 @@ void cifs_fscache_unregister(void) + fscache_unregister_netfs(&cifs_fscache_netfs); + } + ++/* ++ * Server object currently keyed by hostname ++ */ ++static uint16_t cifs_server_get_key(const void *cookie_netfs_data, ++ void *buffer, uint16_t maxbuf) ++{ ++ const struct TCP_Server_Info *server = cookie_netfs_data; ++ uint16_t len = strnlen(server->hostname, sizeof(server->hostname)); ++ ++ if (len > maxbuf) ++ return 0; ++ ++ memcpy(buffer, server->hostname, len); ++ ++ return len; ++} ++ ++/* ++ * Server object for FS-Cache ++ */ ++const struct fscache_cookie_def cifs_fscache_server_index_def = { ++ .name = "CIFS.server", ++ .type = FSCACHE_COOKIE_TYPE_INDEX, ++ .get_key = cifs_server_get_key, ++}; +Index: cifs-2.6/fs/cifs/cifsglob.h +=================================================================== +--- cifs-2.6.orig/fs/cifs/cifsglob.h ++++ cifs-2.6/fs/cifs/cifsglob.h +@@ -193,6 +193,9 @@ struct TCP_Server_Info { + bool sec_mskerberos; /* supports legacy MS Kerberos */ + bool sec_kerberosu2u; /* supports U2U Kerberos */ + bool sec_ntlmssp; /* supports NTLMSSP */ ++#ifdef CONFIG_CIFS_FSCACHE ++ struct fscache_cookie *fscache; /* client index cache cookie */ ++#endif + }; + + /* +Index: cifs-2.6/fs/cifs/connect.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/connect.c ++++ cifs-2.6/fs/cifs/connect.c +@@ -48,6 +48,7 @@ + #include "nterr.h" + #include "rfc1002pdu.h" + #include "cn_cifs.h" ++#include "fscache.h" + + #define CIFS_PORT 445 + #define RFC1001_PORT 139 +@@ -1453,6 +1454,8 @@ cifs_put_tcp_session(struct TCP_Server_I + return; + } + ++ cifs_fscache_release_client_cookie(server); ++ + list_del_init(&server->tcp_ses_list); + write_unlock(&cifs_tcp_ses_lock); + +@@ -1572,6 +1575,7 @@ cifs_get_tcp_session(struct smb_vol *vol + goto out_err; + } + ++ cifs_fscache_get_client_cookie(tcp_ses); + /* thread spawned, put it on the list */ + write_lock(&cifs_tcp_ses_lock); + list_add(&tcp_ses->tcp_ses_list, &cifs_tcp_ses_list); +Index: cifs-2.6/fs/cifs/fscache.c +=================================================================== +--- /dev/null ++++ cifs-2.6/fs/cifs/fscache.c +@@ -0,0 +1,47 @@ ++/* ++ * fs/cifs/fscache.c - CIFS filesystem cache interface ++ * ++ * Copyright (c) 2010 Novell, Inc. ++ * Authors(s): Suresh Jayaraman (sjayaraman-l3A5Bk7waGM@public.gmane.org> ++ * ++ * This library is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as published ++ * by the Free Software Foundation; either version 2.1 of the License, or ++ * (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ++ * the GNU Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++#include <linux/init.h> ++#include <linux/kernel.h> ++#include <linux/sched.h> ++#include <linux/mm.h> ++#include <linux/in6.h> ++ ++#include "fscache.h" ++#include "cifsglob.h" ++#include "cifs_debug.h" ++ ++void cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) ++{ ++ server->fscache = ++ fscache_acquire_cookie(cifs_fscache_netfs.primary_index, ++ &cifs_fscache_server_index_def, server); ++ cFYI(1, "CIFS: get client cookie (0x%p/0x%p)\n", ++ server, server->fscache); ++} ++ ++void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server) ++{ ++ cFYI(1, "CIFS: release client cookie (0x%p/0x%p)\n", ++ server, server->fscache); ++ fscache_relinquish_cookie(server->fscache, 0); ++ server->fscache = NULL; ++} ++ +Index: cifs-2.6/fs/cifs/fscache.h +=================================================================== +--- cifs-2.6.orig/fs/cifs/fscache.h ++++ cifs-2.6/fs/cifs/fscache.h +@@ -27,14 +27,26 @@ + #ifdef CONFIG_CIFS_FSCACHE + + extern struct fscache_netfs cifs_fscache_netfs; ++extern const struct fscache_cookie_def cifs_fscache_server_index_def; + + extern int cifs_fscache_register(void); + extern void cifs_fscache_unregister(void); + ++/* ++ * fscache.c ++ */ ++extern void cifs_fscache_get_client_cookie(struct TCP_Server_Info *); ++extern void cifs_fscache_release_client_cookie(struct TCP_Server_Info *); ++ + #else /* CONFIG_CIFS_FSCACHE */ + static inline int cifs_fscache_register(void) { return 0; } + static inline void cifs_fscache_unregister(void) {} + ++static inline void ++cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) {} ++static inline void ++cifs_fscache_get_client_cookie(struct TCP_Server_Info *server); {} ++ + #endif /* CONFIG_CIFS_FSCACHE */ + + #endif /* _CIFS_FSCACHE_H */ + + diff --git a/test/corpora/lkml/cur/1382298587.001735:2, b/test/corpora/lkml/cur/1382298587.001735:2, new file mode 100644 index 00000000..d76da353 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001735:2, @@ -0,0 +1,212 @@ +From: Suresh Jayaraman <sjayaraman@suse.de> +Subject: [RFC][PATCH 07/10] cifs: FS-Cache page management +Date: Tue, 22 Jun 2010 20:53:48 +0530 +Lines: 175 +Message-ID: <1277220228-3635-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com> +To: Steve French <smfrench@gmail.com> +X-From: linux-kernel-owner@vger.kernel.org Tue Jun 22 17:44:27 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OR5eF-0008G7-BK + for glk-linux-kernel-3@lo.gmane.org; Tue, 22 Jun 2010 17:44:27 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1754757Ab0FVPoS (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 22 Jun 2010 11:44:18 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:54214 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752542Ab0FVPoB (ORCPT + <rfc822;groupwise-SJayaraman@novell.com:0:0>); + Tue, 22 Jun 2010 11:44:01 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:23:50 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001761> + +Takes care of invalidation and release of FS-Cache marked pages and also +invalidation of the FsCache page flag when the inode is removed. + +Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> +--- + fs/cifs/cache.c | 31 +++++++++++++++++++++++++++++++ + fs/cifs/file.c | 20 ++++++++++++++++++++ + fs/cifs/fscache.c | 26 ++++++++++++++++++++++++++ + fs/cifs/fscache.h | 16 ++++++++++++++++ + 4 files changed, 93 insertions(+), 0 deletions(-) + +diff --git a/fs/cifs/cache.c b/fs/cifs/cache.c +index b205424..3a733c1 100644 +--- a/fs/cifs/cache.c ++++ b/fs/cifs/cache.c +@@ -210,6 +210,36 @@ fscache_checkaux cifs_fscache_inode_check_aux(void *cookie_netfs_data, + return FSCACHE_CHECKAUX_OKAY; + } + ++static void cifs_fscache_inode_now_uncached(void *cookie_netfs_data) ++{ ++ struct cifsInodeInfo *cifsi = cookie_netfs_data; ++ struct pagevec pvec; ++ pgoff_t first; ++ int loop, nr_pages; ++ ++ pagevec_init(&pvec, 0); ++ first = 0; ++ ++ cFYI(1, "cifs inode 0x%p now uncached\n", cifsi); ++ ++ for (;;) { ++ nr_pages = pagevec_lookup(&pvec, ++ cifsi->vfs_inode.i_mapping, first, ++ PAGEVEC_SIZE - pagevec_count(&pvec)); ++ if (!nr_pages) ++ break; ++ ++ for (loop = 0; loop < nr_pages; loop++) ++ ClearPageFsCache(pvec.pages[loop]); ++ ++ first = pvec.pages[nr_pages - 1]->index + 1; ++ ++ pvec.nr = nr_pages; ++ pagevec_release(&pvec); ++ cond_resched(); ++ } ++} ++ + const struct fscache_cookie_def cifs_fscache_inode_object_def = { + .name = "CIFS.uniqueid", + .type = FSCACHE_COOKIE_TYPE_DATAFILE, +@@ -217,4 +247,5 @@ const struct fscache_cookie_def cifs_fscache_inode_object_def = { + .get_attr = cifs_fscache_inode_get_attr, + .get_aux = cifs_fscache_inode_get_aux, + .check_aux = cifs_fscache_inode_check_aux, ++ .now_uncached = cifs_fscache_inode_now_uncached, + }; +diff --git a/fs/cifs/file.c b/fs/cifs/file.c +index 55ecb55..786ec04 100644 +--- a/fs/cifs/file.c ++++ b/fs/cifs/file.c +@@ -2271,6 +2271,22 @@ out: + return rc; + } + ++static int cifs_release_page(struct page *page, gfp_t gfp) ++{ ++ if (PagePrivate(page)) ++ return 0; ++ ++ return cifs_fscache_release_page(page, gfp); ++} ++ ++static void cifs_invalidate_page(struct page *page, unsigned long offset) ++{ ++ struct cifsInodeInfo *cifsi = CIFS_I(page->mapping->host); ++ ++ if (offset == 0) ++ cifs_fscache_invalidate_page(page, &cifsi->vfs_inode); ++} ++ + static void + cifs_oplock_break(struct slow_work *work) + { +@@ -2344,6 +2360,8 @@ const struct address_space_operations cifs_addr_ops = { + .write_begin = cifs_write_begin, + .write_end = cifs_write_end, + .set_page_dirty = __set_page_dirty_nobuffers, ++ .releasepage = cifs_release_page, ++ .invalidatepage = cifs_invalidate_page, + /* .sync_page = cifs_sync_page, */ + /* .direct_IO = */ + }; +@@ -2360,6 +2378,8 @@ const struct address_space_operations cifs_addr_ops_smallbuf = { + .write_begin = cifs_write_begin, + .write_end = cifs_write_end, + .set_page_dirty = __set_page_dirty_nobuffers, ++ .releasepage = cifs_release_page, ++ .invalidatepage = cifs_invalidate_page, + /* .sync_page = cifs_sync_page, */ + /* .direct_IO = */ + }; +diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c +index ddfd355..c09d3b8 100644 +--- a/fs/cifs/fscache.c ++++ b/fs/cifs/fscache.c +@@ -130,3 +130,29 @@ void cifs_fscache_reset_inode_cookie(struct inode *inode) + } + } + ++int cifs_fscache_release_page(struct page *page, gfp_t gfp) ++{ ++ if (PageFsCache(page)) { ++ struct inode *inode = page->mapping->host; ++ struct cifsInodeInfo *cifsi = CIFS_I(inode); ++ ++ cFYI(1, "CIFS: fscache release page (0x%p/0x%p)\n", ++ cifsi->fscache, page); ++ if (!fscache_maybe_release_page(cifsi->fscache, page, gfp)) ++ return 0; ++ } ++ ++ return 1; ++} ++ ++void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode) ++{ ++ struct cifsInodeInfo *cifsi = CIFS_I(inode); ++ struct fscache_cookie *cookie = cifsi->fscache; ++ ++ cFYI(1, "CIFS: fscache invalidatepage (0x%p/0x%p/0x%p)\n", ++ cookie, page, cifsi); ++ fscache_wait_on_page_write(cookie, page); ++ fscache_uncache_page(cookie, page); ++} ++ +diff --git a/fs/cifs/fscache.h b/fs/cifs/fscache.h +index 836bb02..127cb0a 100644 +--- a/fs/cifs/fscache.h ++++ b/fs/cifs/fscache.h +@@ -47,6 +47,16 @@ extern void cifs_fscache_release_inode_cookie(struct inode *); + extern void cifs_fscache_set_inode_cookie(struct inode *, struct file *); + extern void cifs_fscache_reset_inode_cookie(struct inode *); + ++extern void __cifs_fscache_invalidate_page(struct page *, struct inode *); ++extern int cifs_fscache_release_page(struct page *page, gfp_t gfp); ++ ++static inline void cifs_fscache_invalidate_page(struct page *page, ++ struct inode *inode) ++{ ++ if (PageFsCache(page)) ++ __cifs_fscache_invalidate_page(page, inode); ++} ++ + #else /* CONFIG_CIFS_FSCACHE */ + static inline int cifs_fscache_register(void) { return 0; } + static inline void cifs_fscache_unregister(void) {} +@@ -63,7 +73,13 @@ static inline void cifs_fscache_release_inode_cookie(struct inode *inode) {} + static inline void cifs_fscache_set_inode_cookie(struct inode *inode, + struct file *filp) {} + static inline void cifs_fscache_reset_inode_cookie(struct inode *inode) {} ++static inline void cifs_fscache_release_page(struct page *page, gfp_t gfp) ++{ ++ return 1; /* May release page */ ++} + ++static inline int cifs_fscache_invalidate_page(struct page *page, ++ struct inode *) {} + + #endif /* CONFIG_CIFS_FSCACHE */ + +-- +1.6.4.2 + + + diff --git a/test/corpora/lkml/cur/1382298587.001736:2, b/test/corpora/lkml/cur/1382298587.001736:2, new file mode 100644 index 00000000..f972891b --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001736:2, @@ -0,0 +1,256 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: [RFC][PATCH 09/10] cifs: read pages from FS-Cache +Date: Tue, 22 Jun 2010 20:54:21 +0530 +Lines: 219 +Message-ID: <1277220261-3717-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 17:44:46 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OR5eX-0008O2-Q4 + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 17:44:46 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1752563Ab0FVPom (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 11:44:42 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:42741 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752542Ab0FVPok (ORCPT + <rfc822;groupwise-SJayaraman-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org:0:0>); + Tue, 22 Jun 2010 11:44:40 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:24:22 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001762> + +Read pages from a FS-Cache data storage object into a CIFS inode. + +Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +--- + fs/cifs/file.c | 19 ++++++++++++++ + fs/cifs/fscache.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + fs/cifs/fscache.h | 40 ++++++++++++++++++++++++++++- + 3 files changed, 131 insertions(+), 1 deletions(-) + +diff --git a/fs/cifs/file.c b/fs/cifs/file.c +index 39c1ce0..42d2f25 100644 +--- a/fs/cifs/file.c ++++ b/fs/cifs/file.c +@@ -1978,6 +1978,16 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, + cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); + pTcon = cifs_sb->tcon; + ++ /* ++ * Reads as many pages as possible from fscache. Returns -ENOBUFS ++ * immediately if the cookie is negative ++ */ ++ rc = cifs_readpages_from_fscache(mapping->host, mapping, page_list, ++ &num_pages); ++ cFYI(1, "CIFS: readpages_from_fscache returned %d\n", rc); ++ if (rc == 0) ++ goto read_complete; ++ + cFYI(DBG2, "rpages: num pages %d", num_pages); + for (i = 0; i < num_pages; ) { + unsigned contig_pages; +@@ -2090,6 +2100,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, + smb_read_data = NULL; + } + ++read_complete: + FreeXid(xid); + return rc; + } +@@ -2100,6 +2111,12 @@ static int cifs_readpage_worker(struct file *file, struct page *page, + char *read_data; + int rc; + ++ /* Is the page cached? */ ++ rc = cifs_readpage_from_fscache(file->f_path.dentry->d_inode, page); ++ cFYI(1, "CIFS: cifs_readpage_from_fscache returned %d\n", rc); ++ if (rc == 0) ++ goto read_complete; ++ + page_cache_get(page); + read_data = kmap(page); + /* for reads over a certain size could initiate async read ahead */ +@@ -2128,6 +2145,8 @@ static int cifs_readpage_worker(struct file *file, struct page *page, + io_error: + kunmap(page); + page_cache_release(page); ++ ++read_complete: + return rc; + } + +diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c +index 13e47d5..6813737 100644 +--- a/fs/cifs/fscache.c ++++ b/fs/cifs/fscache.c +@@ -145,6 +145,79 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp) + return 1; + } + ++static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx, ++ int error) ++{ ++ cFYI(1, "CFS: readpage_from_fscache_complete (0x%p/%d)\n", ++ page, error); ++ if (!error) ++ SetPageUptodate(page); ++ unlock_page(page); ++} ++ ++/* ++ * Retrieve a page from FS-Cache ++ */ ++int __cifs_readpage_from_fscache(struct inode *inode, struct page *page) ++{ ++ int ret; ++ ++ cFYI(1, "CIFS: readpage_from_fscache(fsc:%p, p:%p, i:0x%p\n", ++ CIFS_I(inode)->fscache, page, inode); ++ ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page, ++ cifs_readpage_from_fscache_complete, ++ NULL, ++ GFP_KERNEL); ++ switch (ret) { ++ ++ case 0: /* page found in fscache, read submitted */ ++ cFYI(1, "CIFS: readpage_from_fscache: submitted\n"); ++ return ret; ++ case -ENOBUFS: /* page won't be cached */ ++ case -ENODATA: /* page not in cache */ ++ cFYI(1, "CIFS: readpage_from_fscache %d\n", ret); ++ return 1; ++ ++ default: ++ cFYI(1, "unknown error ret = %d", ret); ++ } ++ return ret; ++} ++ ++/* ++ * Retrieve a set of pages from FS-Cache ++ */ ++int __cifs_readpages_from_fscache(struct inode *inode, ++ struct address_space *mapping, ++ struct list_head *pages, ++ unsigned *nr_pages) ++{ ++ int ret; ++ ++ cFYI(1, "CIFS: __cifs_readpages_from_fscache (0x%p/%u/0x%p)\n", ++ CIFS_I(inode)->fscache, *nr_pages, inode); ++ ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping, ++ pages, nr_pages, ++ cifs_readpage_from_fscache_complete, ++ NULL, ++ mapping_gfp_mask(mapping)); ++ switch (ret) { ++ case 0: /* read submitted to the cache for all pages */ ++ cFYI(1, "CIFS: readpages_from_fscache\n"); ++ return ret; ++ ++ case -ENOBUFS: /* some pages are not cached and can't be */ ++ case -ENODATA: /* some pages are not cached */ ++ cFYI(1, "CIFS: readpages_from_fscache: no page\n"); ++ return 1; ++ ++ default: ++ cFYI(1, "unknown error ret = %d", ret); ++ } ++ ++ return ret; ++} ++ + void __cifs_readpage_to_fscache(struct inode *inode, struct page *page) + { + int ret; +diff --git a/fs/cifs/fscache.h b/fs/cifs/fscache.h +index e34d8ab..03bd3fe 100644 +--- a/fs/cifs/fscache.h ++++ b/fs/cifs/fscache.h +@@ -31,7 +31,6 @@ extern const struct fscache_cookie_def cifs_fscache_server_index_def; + extern const struct fscache_cookie_def cifs_fscache_super_index_def; + extern const struct fscache_cookie_def cifs_fscache_inode_object_def; + +- + extern int cifs_fscache_register(void); + extern void cifs_fscache_unregister(void); + +@@ -49,6 +48,11 @@ extern void cifs_fscache_reset_inode_cookie(struct inode *); + + extern void __cifs_fscache_invalidate_page(struct page *, struct inode *); + extern int cifs_fscache_release_page(struct page *page, gfp_t gfp); ++extern int __cifs_readpage_from_fscache(struct inode *, struct page *); ++extern int __cifs_readpages_from_fscache(struct inode *, ++ struct address_space *, ++ struct list_head *, ++ unsigned *); + + extern void __cifs_readpage_to_fscache(struct inode *, struct page *); + +@@ -59,6 +63,26 @@ static inline void cifs_fscache_invalidate_page(struct page *page, + __cifs_fscache_invalidate_page(page, inode); + } + ++static inline int cifs_readpage_from_fscache(struct inode *inode, ++ struct page *page) ++{ ++ if (CIFS_I(inode)->fscache) ++ return __cifs_readpage_from_fscache(inode, page); ++ ++ return -ENOBUFS; ++} ++ ++static inline int cifs_readpages_from_fscache(struct inode *inode, ++ struct address_space *mapping, ++ struct list_head *pages, ++ unsigned *nr_pages) ++{ ++ if (CIFS_I(inode)->fscache) ++ return __cifs_readpages_from_fscache(inode, mapping, pages, ++ nr_pages); ++ return -ENOBUFS; ++} ++ + static inline void cifs_readpage_to_fscache(struct inode *inode, + struct page *page) + { +@@ -89,6 +113,20 @@ static inline void cifs_fscache_release_page(struct page *page, gfp_t gfp) + + static inline int cifs_fscache_invalidate_page(struct page *page, + struct inode *) {} ++static inline int ++cifs_readpage_from_fscache(struct inode *inode, struct page *page) ++{ ++ return -ENOBUFS; ++} ++ ++static inline int cifs_readpages_from_fscache(struct inode *inode, ++ struct address_space *mapping, ++ struct list_head *pages, ++ unsigned *nr_pages) ++{ ++ return -ENOBUFS; ++} ++ + static inline void cifs_readpage_to_fscache(struct inode *inode, + struct page *page) {} + +-- +1.6.4.2 + + + diff --git a/test/corpora/lkml/cur/1382298587.001738:2, b/test/corpora/lkml/cur/1382298587.001738:2, new file mode 100644 index 00000000..b1e0edfb --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001738:2, @@ -0,0 +1,139 @@ +From: Suresh Jayaraman <sjayaraman@suse.de> +Subject: [RFC][PATCH 08/10] cifs: store pages into local cache +Date: Tue, 22 Jun 2010 20:54:00 +0530 +Lines: 102 +Message-ID: <1277220240-3674-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com> +To: Steve French <smfrench@gmail.com> +X-From: linux-fsdevel-owner@vger.kernel.org Tue Jun 22 17:45:09 2010 +Return-path: <linux-fsdevel-owner@vger.kernel.org> +Envelope-to: lnx-linux-fsdevel@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-fsdevel-owner@vger.kernel.org>) + id 1OR5ev-00007O-6e + for lnx-linux-fsdevel@lo.gmane.org; Tue, 22 Jun 2010 17:45:09 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1755015Ab0FVPon (ORCPT <rfc822;lnx-linux-fsdevel@m.gmane.org>); + Tue, 22 Jun 2010 11:44:43 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:58250 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751265Ab0FVPok (ORCPT + <rfc822;groupwise-SJayaraman@novell.com:0:0>); + Tue, 22 Jun 2010 11:44:40 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:24:02 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-fsdevel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-fsdevel.vger.kernel.org> +X-Mailing-List: linux-fsdevel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001764> + +Store pages from an CIFS inode into the data storage object associated with +that inode. + +Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> +--- + fs/cifs/file.c | 6 ++++++ + fs/cifs/fscache.c | 13 +++++++++++++ + fs/cifs/fscache.h | 11 +++++++++++ + 3 files changed, 30 insertions(+), 0 deletions(-) + +diff --git a/fs/cifs/file.c b/fs/cifs/file.c +index 786ec04..39c1ce0 100644 +--- a/fs/cifs/file.c ++++ b/fs/cifs/file.c +@@ -2060,6 +2060,8 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, + we will hit it on next read */ + + /* break; */ ++ /* send this page to FS-Cache */ ++ cifs_readpage_to_fscache(mapping->host, page); + } + } else { + cFYI(1, "No bytes read (%d) at offset %lld . " +@@ -2117,6 +2119,10 @@ static int cifs_readpage_worker(struct file *file, struct page *page, + + flush_dcache_page(page); + SetPageUptodate(page); ++ ++ /* send this page to the cache */ ++ cifs_readpage_to_fscache(file->f_path.dentry->d_inode, page); ++ + rc = 0; + + io_error: +diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c +index c09d3b8..13e47d5 100644 +--- a/fs/cifs/fscache.c ++++ b/fs/cifs/fscache.c +@@ -145,6 +145,19 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp) + return 1; + } + ++void __cifs_readpage_to_fscache(struct inode *inode, struct page *page) ++{ ++ int ret; ++ ++ cFYI(1, "CIFS: readpage_to_fscache(fsc: %p, p: %p, i: %p\n", ++ CIFS_I(inode)->fscache, page, inode); ++ ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL); ++ cFYI(1, "CIFS: fscache_write_page returned %d\n", ret); ++ ++ if (ret != 0) ++ fscache_uncache_page(CIFS_I(inode)->fscache, page); ++} ++ + void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode) + { + struct cifsInodeInfo *cifsi = CIFS_I(inode); +diff --git a/fs/cifs/fscache.h b/fs/cifs/fscache.h +index 127cb0a..e34d8ab 100644 +--- a/fs/cifs/fscache.h ++++ b/fs/cifs/fscache.h +@@ -50,6 +50,8 @@ extern void cifs_fscache_reset_inode_cookie(struct inode *); + extern void __cifs_fscache_invalidate_page(struct page *, struct inode *); + extern int cifs_fscache_release_page(struct page *page, gfp_t gfp); + ++extern void __cifs_readpage_to_fscache(struct inode *, struct page *); ++ + static inline void cifs_fscache_invalidate_page(struct page *page, + struct inode *inode) + { +@@ -57,6 +59,13 @@ static inline void cifs_fscache_invalidate_page(struct page *page, + __cifs_fscache_invalidate_page(page, inode); + } + ++static inline void cifs_readpage_to_fscache(struct inode *inode, ++ struct page *page) ++{ ++ if (PageFsCache(page)) ++ __cifs_readpage_to_fscache(inode, page); ++} ++ + #else /* CONFIG_CIFS_FSCACHE */ + static inline int cifs_fscache_register(void) { return 0; } + static inline void cifs_fscache_unregister(void) {} +@@ -80,6 +89,8 @@ static inline void cifs_fscache_release_page(struct page *page, gfp_t gfp) + + static inline int cifs_fscache_invalidate_page(struct page *page, + struct inode *) {} ++static inline void cifs_readpage_to_fscache(struct inode *inode, ++ struct page *page) {} + + #endif /* CONFIG_CIFS_FSCACHE */ + +-- +1.6.4.2 + +-- +To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298587.001739:2, b/test/corpora/lkml/cur/1382298587.001739:2, new file mode 100644 index 00000000..d0abda0a --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001739:2, @@ -0,0 +1,355 @@ +From: Suresh Jayaraman <sjayaraman@suse.de> +Subject: [RFC][PATCH 06/10] cifs: define inode-level cache object and register them +Date: Tue, 22 Jun 2010 20:53:33 +0530 +Lines: 318 +Message-ID: <1277220214-3597-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com> +To: Steve French <smfrench@gmail.com> +X-From: linux-kernel-owner@vger.kernel.org Tue Jun 22 17:45:30 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OR5fF-0000Ka-Na + for glk-linux-kernel-3@lo.gmane.org; Tue, 22 Jun 2010 17:45:30 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1755952Ab0FVPpP (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 22 Jun 2010 11:45:15 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:59441 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751397Ab0FVPoA (ORCPT + <rfc822;groupwise-SJayaraman@novell.com:0:0>); + Tue, 22 Jun 2010 11:44:00 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:23:35 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001765> + +Define inode-level data storage objects (managed by cifsInodeInfo structs). +Each inode-level object is created in a super-block level object and is itself +a data storage object in to which pages from the inode are stored. + +The inode object is keyed by UniqueId. The coherency data being used is +LastWriteTime and the file size. + +Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> +--- + fs/cifs/cache.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + fs/cifs/cifsfs.c | 7 ++++ + fs/cifs/cifsglob.h | 3 + + fs/cifs/file.c | 6 +++ + fs/cifs/fscache.c | 68 +++++++++++++++++++++++++++++++++++++++++++++ + fs/cifs/fscache.h | 12 +++++++ + fs/cifs/inode.c | 4 ++ + 7 files changed, 180 insertions(+) + +Index: cifs-2.6/fs/cifs/cache.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/cache.c ++++ cifs-2.6/fs/cifs/cache.c +@@ -138,3 +138,83 @@ const struct fscache_cookie_def cifs_fsc + .get_key = cifs_super_get_key, + }; + ++/* ++ * Auxiliary data attached to CIFS inode within the cache ++ */ ++struct cifs_fscache_inode_auxdata { ++ struct timespec last_write_time; ++ loff_t size; ++}; ++ ++static uint16_t cifs_fscache_inode_get_key(const void *cookie_netfs_data, ++ void *buffer, uint16_t maxbuf) ++{ ++ const struct cifsInodeInfo *cifsi = cookie_netfs_data; ++ uint16_t keylen; ++ ++ /* use the UniqueId as the key */ ++ keylen = sizeof(cifsi->uniqueid); ++ if (keylen > maxbuf) ++ keylen = 0; ++ else ++ memcpy(buffer, &cifsi->uniqueid, keylen); ++ ++ return keylen; ++} ++ ++static void ++cifs_fscache_inode_get_attr(const void *cookie_netfs_data, uint64_t *size) ++{ ++ const struct cifsInodeInfo *cifsi = cookie_netfs_data; ++ ++ *size = cifsi->vfs_inode.i_size; ++} ++ ++static uint16_t ++cifs_fscache_inode_get_aux(const void *cookie_netfs_data, void *buffer, ++ uint16_t maxbuf) ++{ ++ struct cifs_fscache_inode_auxdata auxdata; ++ const struct cifsInodeInfo *cifsi = cookie_netfs_data; ++ ++ memset(&auxdata, 0, sizeof(auxdata)); ++ auxdata.size = cifsi->vfs_inode.i_size; ++ auxdata.last_write_time = cifsi->vfs_inode.i_ctime; ++ ++ if (maxbuf > sizeof(auxdata)) ++ maxbuf = sizeof(auxdata); ++ ++ memcpy(buffer, &auxdata, maxbuf); ++ ++ return maxbuf; ++} ++ ++static enum ++fscache_checkaux cifs_fscache_inode_check_aux(void *cookie_netfs_data, ++ const void *data, ++ uint16_t datalen) ++{ ++ struct cifs_fscache_inode_auxdata auxdata; ++ struct cifsInodeInfo *cifsi = cookie_netfs_data; ++ ++ if (datalen != sizeof(auxdata)) ++ return FSCACHE_CHECKAUX_OBSOLETE; ++ ++ memset(&auxdata, 0, sizeof(auxdata)); ++ auxdata.size = cifsi->vfs_inode.i_size; ++ auxdata.last_write_time = cifsi->vfs_inode.i_ctime; ++ ++ if (memcmp(data, &auxdata, datalen) != 0) ++ return FSCACHE_CHECKAUX_OBSOLETE; ++ ++ return FSCACHE_CHECKAUX_OKAY; ++} ++ ++const struct fscache_cookie_def cifs_fscache_inode_object_def = { ++ .name = "CIFS.uniqueid", ++ .type = FSCACHE_COOKIE_TYPE_DATAFILE, ++ .get_key = cifs_fscache_inode_get_key, ++ .get_attr = cifs_fscache_inode_get_attr, ++ .get_aux = cifs_fscache_inode_get_aux, ++ .check_aux = cifs_fscache_inode_check_aux, ++}; +Index: cifs-2.6/fs/cifs/cifsfs.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/cifsfs.c ++++ cifs-2.6/fs/cifs/cifsfs.c +@@ -330,6 +330,12 @@ cifs_destroy_inode(struct inode *inode) + } + + static void ++cifs_clear_inode(struct inode *inode) ++{ ++ cifs_fscache_release_inode_cookie(inode); ++} ++ ++static void + cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server) + { + seq_printf(s, ",addr="); +@@ -490,6 +496,7 @@ static const struct super_operations cif + .alloc_inode = cifs_alloc_inode, + .destroy_inode = cifs_destroy_inode, + .drop_inode = cifs_drop_inode, ++ .clear_inode = cifs_clear_inode, + /* .delete_inode = cifs_delete_inode, */ /* Do not need above + function unless later we add lazy close of inodes or unless the + kernel forgets to call us with the same number of releases (closes) +Index: cifs-2.6/fs/cifs/cifsglob.h +=================================================================== +--- cifs-2.6.orig/fs/cifs/cifsglob.h ++++ cifs-2.6/fs/cifs/cifsglob.h +@@ -407,6 +407,9 @@ struct cifsInodeInfo { + bool invalid_mapping:1; /* pagecache is invalid */ + u64 server_eof; /* current file size on server */ + u64 uniqueid; /* server inode number */ ++#ifdef CONFIG_CIFS_FSCACHE ++ struct fscache_cookie *fscache; ++#endif + struct inode vfs_inode; + }; + +Index: cifs-2.6/fs/cifs/file.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/file.c ++++ cifs-2.6/fs/cifs/file.c +@@ -40,6 +40,7 @@ + #include "cifs_unicode.h" + #include "cifs_debug.h" + #include "cifs_fs_sb.h" ++#include "fscache.h" + + static inline int cifs_convert_flags(unsigned int flags) + { +@@ -282,6 +283,9 @@ int cifs_open(struct inode *inode, struc + CIFSSMBClose(xid, tcon, netfid); + rc = -ENOMEM; + } ++ ++ cifs_fscache_set_inode_cookie(inode, file); ++ + goto out; + } else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { + if (tcon->ses->serverNOS) +@@ -373,6 +377,8 @@ int cifs_open(struct inode *inode, struc + goto out; + } + ++ cifs_fscache_set_inode_cookie(inode, file); ++ + if (oplock & CIFS_CREATE_ACTION) { + /* time to set mode which we can not set earlier due to + problems creating new read-only files */ +Index: cifs-2.6/fs/cifs/fscache.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/fscache.c ++++ cifs-2.6/fs/cifs/fscache.c +@@ -62,3 +62,71 @@ void cifs_fscache_release_super_cookie(s + tcon->fscache = NULL; + } + ++static void cifs_fscache_enable_inode_cookie(struct inode *inode) ++{ ++ struct cifsInodeInfo *cifsi = CIFS_I(inode); ++ struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); ++ ++ if (cifsi->fscache) ++ return; ++ ++ cifsi->fscache = fscache_acquire_cookie(cifs_sb->tcon->fscache, ++ &cifs_fscache_inode_object_def, ++ cifsi); ++ cFYI(1, "CIFS: got FH cookie (0x%p/0x%p/0x%p)\n", ++ cifs_sb->tcon, cifsi, cifsi->fscache); ++} ++ ++void cifs_fscache_release_inode_cookie(struct inode *inode) ++{ ++ struct cifsInodeInfo *cifsi = CIFS_I(inode); ++ ++ if (cifsi->fscache) { ++ cFYI(1, "CIFS releasing inode cookie (0x%p/0x%p)\n", ++ cifsi, cifsi->fscache); ++ fscache_relinquish_cookie(cifsi->fscache, 0); ++ cifsi->fscache = NULL; ++ } ++} ++ ++static void cifs_fscache_disable_inode_cookie(struct inode *inode) ++{ ++ struct cifsInodeInfo *cifsi = CIFS_I(inode); ++ ++ if (cifsi->fscache) { ++ cFYI(1, "CIFS disabling inode cookie (0x%p/0x%p)\n", ++ cifsi, cifsi->fscache); ++ fscache_relinquish_cookie(cifsi->fscache, 1); ++ cifsi->fscache = NULL; ++ } ++} ++ ++void cifs_fscache_set_inode_cookie(struct inode *inode, struct file *filp) ++{ ++ /* BB: parallel opens - need locking? */ ++ if ((filp->f_flags & O_ACCMODE) != O_RDONLY) ++ cifs_fscache_disable_inode_cookie(inode); ++ else { ++ cifs_fscache_enable_inode_cookie(inode); ++ cFYI(1, "CIFS: fscache inode cookie set\n"); ++ } ++} ++ ++void cifs_fscache_reset_inode_cookie(struct inode *inode) ++{ ++ struct cifsInodeInfo *cifsi = CIFS_I(inode); ++ struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); ++ struct fscache_cookie *old = cifsi->fscache; ++ ++ if (cifsi->fscache) { ++ /* retire the current fscache cache and get a new one */ ++ fscache_relinquish_cookie(cifsi->fscache, 1); ++ ++ cifsi->fscache = fscache_acquire_cookie(cifs_sb->tcon->fscache, ++ &cifs_fscache_inode_object_def, ++ cifsi); ++ cFYI(1, "CIFS: new cookie (0x%p/0x%p) oldcookie 0x%p\n", ++ cifsi, cifsi->fscache, old); ++ } ++} ++ +Index: cifs-2.6/fs/cifs/fscache.h +=================================================================== +--- cifs-2.6.orig/fs/cifs/fscache.h ++++ cifs-2.6/fs/cifs/fscache.h +@@ -29,6 +29,8 @@ + extern struct fscache_netfs cifs_fscache_netfs; + extern const struct fscache_cookie_def cifs_fscache_server_index_def; + extern const struct fscache_cookie_def cifs_fscache_super_index_def; ++extern const struct fscache_cookie_def cifs_fscache_inode_object_def; ++ + + extern int cifs_fscache_register(void); + extern void cifs_fscache_unregister(void); +@@ -41,6 +43,10 @@ extern void cifs_fscache_release_client_ + extern void cifs_fscache_get_super_cookie(struct cifsTconInfo *); + extern void cifs_fscache_release_super_cookie(struct cifsTconInfo *); + ++extern void cifs_fscache_release_inode_cookie(struct inode *); ++extern void cifs_fscache_set_inode_cookie(struct inode *, struct file *); ++extern void cifs_fscache_reset_inode_cookie(struct inode *); ++ + #else /* CONFIG_CIFS_FSCACHE */ + static inline int cifs_fscache_register(void) { return 0; } + static inline void cifs_fscache_unregister(void) {} +@@ -53,6 +59,12 @@ static inline void cifs_fscache_get_supe + static inline void + cifs_fscache_release_super_cookie(struct cifsTconInfo *tcon) {} + ++static inline void cifs_fscache_release_inode_cookie(struct inode *inode) {} ++static inline void cifs_fscache_set_inode_cookie(struct inode *inode, ++ struct file *filp) {} ++static inline void cifs_fscache_reset_inode_cookie(struct inode *inode) {} ++ ++ + #endif /* CONFIG_CIFS_FSCACHE */ + + #endif /* _CIFS_FSCACHE_H */ +Index: cifs-2.6/fs/cifs/inode.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/inode.c ++++ cifs-2.6/fs/cifs/inode.c +@@ -29,6 +29,7 @@ + #include "cifsproto.h" + #include "cifs_debug.h" + #include "cifs_fs_sb.h" ++#include "fscache.h" + + + static void cifs_set_ops(struct inode *inode, const bool is_dfs_referral) +@@ -776,6 +777,8 @@ retry_iget5_locked: + inode->i_flags |= S_NOATIME | S_NOCMTIME; + if (inode->i_state & I_NEW) { + inode->i_ino = hash; ++ /* initialize per-inode cache cookie pointer */ ++ CIFS_I(inode)->fscache = NULL; + unlock_new_inode(inode); + } + } +@@ -1568,6 +1571,7 @@ cifs_invalidate_mapping(struct inode *in + cifs_i->write_behind_rc = rc; + } + invalidate_remote_inode(inode); ++ cifs_fscache_reset_inode_cookie(inode); + } + + int cifs_revalidate_file(struct file *filp) + + diff --git a/test/corpora/lkml/cur/1382298587.001740:2, b/test/corpora/lkml/cur/1382298587.001740:2, new file mode 100644 index 00000000..ef0f657b --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001740:2, @@ -0,0 +1,214 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: [RFC][PATCH 05/10] cifs: define superblock-level cache index objects and register them +Date: Tue, 22 Jun 2010 20:53:26 +0530 +Lines: 177 +Message-ID: <1277220206-3559-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 17:45:50 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OR5fZ-0000Vj-Mj + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 17:45:50 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1752511Ab0FVPpJ (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 11:45:09 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:56189 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752441Ab0FVPoA (ORCPT + <rfc822;groupwise-SJayaraman-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org:0:0>); + Tue, 22 Jun 2010 11:44:00 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:23:29 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001766> + +Define superblock-level cache index objects (managed by cifsTconInfo structs). +Each superblock object is created in a server-level index object and in itself +an index into which inode-level objects are inserted. + +Currently, the superblock objects are keyed by sharename. + +Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +--- + fs/cifs/cache.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + fs/cifs/cifsglob.h | 3 ++ + fs/cifs/connect.c | 4 +++ + fs/cifs/fscache.c | 17 ++++++++++++++ + fs/cifs/fscache.h | 6 +++++ + 5 files changed, 92 insertions(+) + +Index: cifs-2.6/fs/cifs/cache.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/cache.c ++++ cifs-2.6/fs/cifs/cache.c +@@ -76,3 +76,65 @@ const struct fscache_cookie_def cifs_fsc + .type = FSCACHE_COOKIE_TYPE_INDEX, + .get_key = cifs_server_get_key, + }; ++ ++static char *extract_sharename(const char *treename) ++{ ++ const char *src; ++ char *delim, *dst; ++ int len; ++ ++ /* skip double chars at the beginning */ ++ src = treename + 2; ++ ++ /* share name is always preceded by '\\' now */ ++ delim = strchr(src, '\\'); ++ if (!delim) ++ return ERR_PTR(-EINVAL); ++ delim++; ++ len = strlen(delim); ++ ++ /* caller has to free the memory */ ++ dst = kstrndup(delim, len, GFP_KERNEL); ++ if (!dst) ++ return ERR_PTR(-ENOMEM); ++ ++ return dst; ++} ++ ++/* ++ * Superblock object currently keyed by share name ++ */ ++static uint16_t cifs_super_get_key(const void *cookie_netfs_data, void *buffer, ++ uint16_t maxbuf) ++{ ++ const struct cifsTconInfo *tcon = cookie_netfs_data; ++ char *sharename; ++ uint16_t len; ++ ++ sharename = extract_sharename(tcon->treeName); ++ if (IS_ERR(sharename)) { ++ cFYI(1, "CIFS: couldn't extract sharename\n"); ++ sharename = NULL; ++ return 0; ++ } ++ ++ len = strlen(sharename); ++ if (len > maxbuf) ++ return 0; ++ ++ memcpy(buffer, sharename, len); ++ ++ kfree(sharename); ++ ++ return len; ++} ++ ++/* ++ * Superblock object for FS-Cache ++ */ ++const struct fscache_cookie_def cifs_fscache_super_index_def = { ++ .name = "CIFS.super", ++ .type = FSCACHE_COOKIE_TYPE_INDEX, ++ .get_key = cifs_super_get_key, ++}; ++ +Index: cifs-2.6/fs/cifs/cifsglob.h +=================================================================== +--- cifs-2.6.orig/fs/cifs/cifsglob.h ++++ cifs-2.6/fs/cifs/cifsglob.h +@@ -317,6 +317,9 @@ struct cifsTconInfo { + bool local_lease:1; /* check leases (only) on local system not remote */ + bool broken_posix_open; /* e.g. Samba server versions < 3.3.2, 3.2.9 */ + bool need_reconnect:1; /* connection reset, tid now invalid */ ++#ifdef CONFIG_CIFS_FSCACHE ++ struct fscache_cookie *fscache; /* cookie for share */ ++#endif + /* BB add field for back pointer to sb struct(s)? */ + }; + +Index: cifs-2.6/fs/cifs/connect.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/connect.c ++++ cifs-2.6/fs/cifs/connect.c +@@ -1773,6 +1773,8 @@ cifs_put_tcon(struct cifsTconInfo *tcon) + list_del_init(&tcon->tcon_list); + write_unlock(&cifs_tcp_ses_lock); + ++ cifs_fscache_release_super_cookie(tcon); ++ + xid = GetXid(); + CIFSSMBTDis(xid, tcon); + _FreeXid(xid); +@@ -1843,6 +1845,8 @@ cifs_get_tcon(struct cifsSesInfo *ses, s + tcon->nocase = volume_info->nocase; + tcon->local_lease = volume_info->local_lease; + ++ cifs_fscache_get_super_cookie(tcon); ++ + write_lock(&cifs_tcp_ses_lock); + list_add(&tcon->tcon_list, &ses->tcon_list); + write_unlock(&cifs_tcp_ses_lock); +Index: cifs-2.6/fs/cifs/fscache.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/fscache.c ++++ cifs-2.6/fs/cifs/fscache.c +@@ -45,3 +45,20 @@ void cifs_fscache_release_client_cookie( + server->fscache = NULL; + } + ++void cifs_fscache_get_super_cookie(struct cifsTconInfo *tcon) ++{ ++ tcon->fscache = ++ fscache_acquire_cookie(tcon->ses->server->fscache, ++ &cifs_fscache_super_index_def, tcon); ++ cFYI(1, "CIFS: get superblock cookie (0x%p/0x%p)\n", ++ tcon, tcon->fscache); ++} ++ ++void cifs_fscache_release_super_cookie(struct cifsTconInfo *tcon) ++{ ++ cFYI(1, "CIFS: releasing superblock cookie (0x%p/0x%p)\n", ++ tcon, tcon->fscache); ++ fscache_relinquish_cookie(tcon->fscache, 0); ++ tcon->fscache = NULL; ++} ++ +Index: cifs-2.6/fs/cifs/fscache.h +=================================================================== +--- cifs-2.6.orig/fs/cifs/fscache.h ++++ cifs-2.6/fs/cifs/fscache.h +@@ -28,6 +28,7 @@ + + extern struct fscache_netfs cifs_fscache_netfs; + extern const struct fscache_cookie_def cifs_fscache_server_index_def; ++extern const struct fscache_cookie_def cifs_fscache_super_index_def; + + extern int cifs_fscache_register(void); + extern void cifs_fscache_unregister(void); +@@ -37,6 +38,8 @@ extern void cifs_fscache_unregister(void + */ + extern void cifs_fscache_get_client_cookie(struct TCP_Server_Info *); + extern void cifs_fscache_release_client_cookie(struct TCP_Server_Info *); ++extern void cifs_fscache_get_super_cookie(struct cifsTconInfo *); ++extern void cifs_fscache_release_super_cookie(struct cifsTconInfo *); + + #else /* CONFIG_CIFS_FSCACHE */ + static inline int cifs_fscache_register(void) { return 0; } +@@ -46,6 +49,9 @@ static inline void + cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) {} + static inline void + cifs_fscache_get_client_cookie(struct TCP_Server_Info *server); {} ++static inline void cifs_fscache_get_super_cookie(struct cifsTconInfo *tcon) {} ++static inline void ++cifs_fscache_release_super_cookie(struct cifsTconInfo *tcon) {} + + #endif /* CONFIG_CIFS_FSCACHE */ + + + diff --git a/test/corpora/lkml/cur/1382298587.001887:2, b/test/corpora/lkml/cur/1382298587.001887:2, new file mode 100644 index 00000000..81290484 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001887:2, @@ -0,0 +1,85 @@ +From: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> +Subject: Re: [RFC][PATCH 02/10] cifs: guard cifsglob.h against multiple + inclusion +Date: Tue, 22 Jun 2010 17:37:42 -0400 +Lines: 35 +Message-ID: <20100622173742.448e1e94@corrin.poochiereds.net> +References: <yes> + <1277220170-3442-1-git-send-email-sjayaraman@suse.de> +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 23:36:08 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORB8Z-00027v-R8 + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 23:36:08 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1751663Ab0FVVfq (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 17:35:46 -0400 +Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.121]:46190 "EHLO + cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751933Ab0FVVfo (ORCPT + <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); Tue, 22 Jun 2010 17:35:44 -0400 +X-Authority-Analysis: v=1.0 c=1 a=Y4kVDsoNLLAA:10 a=yQWWgrYGNuUA:10 a=kj9zAlcOel0A:10 a=hGzw-44bAAAA:8 a=6UT2YofcClCzWf3PPoQA:9 a=Ipo6nwFRv7ENfF13HvmH_iG48b8A:4 a=CjuIK1q_8ugA:10 a=0kPLrQdw3YYA:10 a=dowx1zmaLagA:10 +X-Cloudmark-Score: 0 +X-Originating-IP: 71.70.153.3 +Received: from [71.70.153.3] ([71.70.153.3:49036] helo=mail.poochiereds.net) + by cdptpa-oedge01.mail.rr.com (envelope-from <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>) + (ecelerity 2.2.2.39 r()) with ESMTP + id 29/22-24471-DAC212C4; Tue, 22 Jun 2010 21:35:42 +0000 +Received: from corrin.poochiereds.net (unknown [65.88.2.5]) + by mail.poochiereds.net (Postfix) with ESMTPSA id 1C5A1580F4; + Tue, 22 Jun 2010 17:35:41 -0400 (EDT) +In-Reply-To: <1277220170-3442-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-redhat-linux-gnu) +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001913> + +On Tue, 22 Jun 2010 20:52:50 +0530 +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> Add conditional compile macros to guard the header file against multiple +> inclusion. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +> --- +> fs/cifs/cifsglob.h | 5 +++++ +> 1 files changed, 5 insertions(+), 0 deletions(-) +> +> diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h +> index a88479c..6b2c39d 100644 +> --- a/fs/cifs/cifsglob.h +> +++ b/fs/cifs/cifsglob.h +> @@ -16,6 +16,9 @@ +> * the GNU Lesser General Public License for more details. +> * +> */ +> +#ifndef _CIFS_GLOB_H +> +#define _CIFS_GLOB_H +> + +> #include <linux/in.h> +> #include <linux/in6.h> +> #include <linux/slab.h> +> @@ -733,3 +736,5 @@ GLOBAL_EXTERN unsigned int cifs_min_small; /* min size of small buf pool */ +> GLOBAL_EXTERN unsigned int cifs_max_pending; /* MAX requests at once to server*/ +> +> extern const struct slow_work_ops cifs_oplock_break_ops; +> + +> +#endif /* _CIFS_GLOB_H */ + +Strong ACK + +Acked-by: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> + + diff --git a/test/corpora/lkml/cur/1382298587.001892:2, b/test/corpora/lkml/cur/1382298587.001892:2, new file mode 100644 index 00000000..82603bf1 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001892:2, @@ -0,0 +1,254 @@ +From: Jeff Layton <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org> +Subject: Re: [RFC][PATCH 04/10] cifs: define server-level cache index + objects and register them with FS-Cache +Date: Tue, 22 Jun 2010 17:52:14 -0400 +Lines: 204 +Message-ID: <20100622175214.4c56234f@corrin.poochiereds.net> +References: <yes> + <1277220198-3522-1-git-send-email-sjayaraman@suse.de> +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 23:50:23 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORBMJ-0005WJ-Lj + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 23:50:20 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1750777Ab0FVVuS (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 17:50:18 -0400 +Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:55670 "EHLO + cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1750749Ab0FVVuR (ORCPT + <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); Tue, 22 Jun 2010 17:50:17 -0400 +X-Authority-Analysis: v=1.1 cv=8MuG1bpxLlSbaYWWtODGdBCK7StbFcRsMXhWm1NVx/I= c=1 sm=0 a=wpY4Lvx3kJcA:10 a=UBIxAjGgU1YA:10 a=kj9zAlcOel0A:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=VwQbUJbxAAAA:8 a=qYub2k57AAAA:8 a=uYIlwBZcjrF9BUCsR4kA:9 a=OO1ZLbZb6q4TPdC5pcAA:7 a=jFshslHAf8hJVDYUYRlYN4n-w5YA:4 a=CjuIK1q_8ugA:10 a=x8gzFH9gYPwA:10 a=0kPLrQdw3YYA:10 a=jBoGP612-tUA:10 a=t5DF_bUGhurCx8LQ:21 a=W6P_Gh1y2IibdbqZ:21 a=ld/erqUjW76FpBUqCqkKeA==:117 +X-Cloudmark-Score: 0 +X-Originating-IP: 71.70.153.3 +Received: from [71.70.153.3] ([71.70.153.3:59154] helo=mail.poochiereds.net) + by cdptpa-oedge03.mail.rr.com (envelope-from <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org>) + (ecelerity 2.2.2.39 r()) with ESMTP + id AC/10-00502-710312C4; Tue, 22 Jun 2010 21:50:16 +0000 +Received: from corrin.poochiereds.net (unknown [65.88.2.5]) + by mail.poochiereds.net (Postfix) with ESMTPSA id 03B11580F4; + Tue, 22 Jun 2010 17:50:14 -0400 (EDT) +In-Reply-To: <1277220198-3522-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-redhat-linux-gnu) +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001918> + +On Tue, 22 Jun 2010 20:53:18 +0530 +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> Define server-level cache index objects (as managed by TCP_ServerInfo structs). +> Each server object is created in the CIFS top-level index object and is itself +> an index into which superblock-level objects are inserted. +> +> Currently, the server objects are keyed by hostname. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +> --- +> fs/cifs/Makefile | 2 +- +> fs/cifs/cache.c | 25 +++++++++++++++++++++++++ +> fs/cifs/cifsglob.h | 3 +++ +> fs/cifs/connect.c | 4 ++++ +> fs/cifs/fscache.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ +> fs/cifs/fscache.h | 12 ++++++++++++ +> 6 files changed, 92 insertions(+), 1 deletion(-) +> create mode 100644 fs/cifs/fscache.c +> +> Index: cifs-2.6/fs/cifs/Makefile +> =================================================================== +> --- cifs-2.6.orig/fs/cifs/Makefile +> +++ cifs-2.6/fs/cifs/Makefile +> @@ -12,4 +12,4 @@ cifs-$(CONFIG_CIFS_UPCALL) += cifs_spneg +> +> cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o +> +> -cifs-$(CONFIG_CIFS_FSCACHE) += cache.o +> +cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cache.o +> Index: cifs-2.6/fs/cifs/cache.c +> =================================================================== +> --- cifs-2.6.orig/fs/cifs/cache.c +> +++ cifs-2.6/fs/cifs/cache.c +> @@ -51,3 +51,28 @@ void cifs_fscache_unregister(void) +> fscache_unregister_netfs(&cifs_fscache_netfs); +> } +> +> +/* +> + * Server object currently keyed by hostname +> + */ +> +static uint16_t cifs_server_get_key(const void *cookie_netfs_data, +> + void *buffer, uint16_t maxbuf) +> +{ +> + const struct TCP_Server_Info *server = cookie_netfs_data; +> + uint16_t len = strnlen(server->hostname, sizeof(server->hostname)); +> + + +Would a tuple of address/family/port be a better choice here? Imagine I +mount "foo" and then later mount "foor.bar.baz". If they are the same +address and only the UNC differs, then you won't get the benefit of +the cache, right? + +> + if (len > maxbuf) +> + return 0; +> + +> + memcpy(buffer, server->hostname, len); +> + +> + return len; +> +} +> + +> +/* +> + * Server object for FS-Cache +> + */ +> +const struct fscache_cookie_def cifs_fscache_server_index_def = { +> + .name = "CIFS.server", +> + .type = FSCACHE_COOKIE_TYPE_INDEX, +> + .get_key = cifs_server_get_key, +> +}; +> Index: cifs-2.6/fs/cifs/cifsglob.h +> =================================================================== +> --- cifs-2.6.orig/fs/cifs/cifsglob.h +> +++ cifs-2.6/fs/cifs/cifsglob.h +> @@ -193,6 +193,9 @@ struct TCP_Server_Info { +> bool sec_mskerberos; /* supports legacy MS Kerberos */ +> bool sec_kerberosu2u; /* supports U2U Kerberos */ +> bool sec_ntlmssp; /* supports NTLMSSP */ +> +#ifdef CONFIG_CIFS_FSCACHE +> + struct fscache_cookie *fscache; /* client index cache cookie */ +> +#endif +> }; +> +> /* +> Index: cifs-2.6/fs/cifs/connect.c +> =================================================================== +> --- cifs-2.6.orig/fs/cifs/connect.c +> +++ cifs-2.6/fs/cifs/connect.c +> @@ -48,6 +48,7 @@ +> #include "nterr.h" +> #include "rfc1002pdu.h" +> #include "cn_cifs.h" +> +#include "fscache.h" +> +> #define CIFS_PORT 445 +> #define RFC1001_PORT 139 +> @@ -1453,6 +1454,8 @@ cifs_put_tcp_session(struct TCP_Server_I +> return; +> } +> +> + cifs_fscache_release_client_cookie(server); +> + +> list_del_init(&server->tcp_ses_list); +> write_unlock(&cifs_tcp_ses_lock); +> +> @@ -1572,6 +1575,7 @@ cifs_get_tcp_session(struct smb_vol *vol +> goto out_err; +> } +> +> + cifs_fscache_get_client_cookie(tcp_ses); +> /* thread spawned, put it on the list */ +> write_lock(&cifs_tcp_ses_lock); +> list_add(&tcp_ses->tcp_ses_list, &cifs_tcp_ses_list); +> Index: cifs-2.6/fs/cifs/fscache.c +> =================================================================== +> --- /dev/null +> +++ cifs-2.6/fs/cifs/fscache.c +> @@ -0,0 +1,47 @@ +> +/* +> + * fs/cifs/fscache.c - CIFS filesystem cache interface +> + * +> + * Copyright (c) 2010 Novell, Inc. +> + * Authors(s): Suresh Jayaraman (sjayaraman-l3A5Bk7waGM@public.gmane.org> +> + * +> + * This library is free software; you can redistribute it and/or modify +> + * it under the terms of the GNU Lesser General Public License as published +> + * by the Free Software Foundation; either version 2.1 of the License, or +> + * (at your option) any later version. +> + * +> + * This library is distributed in the hope that it will be useful, +> + * but WITHOUT ANY WARRANTY; without even the implied warranty of +> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +> + * the GNU Lesser General Public License for more details. +> + * +> + * You should have received a copy of the GNU Lesser General Public License +> + * along with this library; if not, write to the Free Software +> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +> + */ +> +#include <linux/init.h> +> +#include <linux/kernel.h> +> +#include <linux/sched.h> +> +#include <linux/mm.h> +> +#include <linux/in6.h> +> + +> +#include "fscache.h" +> +#include "cifsglob.h" +> +#include "cifs_debug.h" +> + +> +void cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) +> +{ +> + server->fscache = +> + fscache_acquire_cookie(cifs_fscache_netfs.primary_index, +> + &cifs_fscache_server_index_def, server); +> + cFYI(1, "CIFS: get client cookie (0x%p/0x%p)\n", +> + server, server->fscache); +> +} +> + +> +void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server) +> +{ +> + cFYI(1, "CIFS: release client cookie (0x%p/0x%p)\n", +> + server, server->fscache); +> + fscache_relinquish_cookie(server->fscache, 0); +> + server->fscache = NULL; +> +} +> + +> Index: cifs-2.6/fs/cifs/fscache.h +> =================================================================== +> --- cifs-2.6.orig/fs/cifs/fscache.h +> +++ cifs-2.6/fs/cifs/fscache.h +> @@ -27,14 +27,26 @@ +> #ifdef CONFIG_CIFS_FSCACHE +> +> extern struct fscache_netfs cifs_fscache_netfs; +> +extern const struct fscache_cookie_def cifs_fscache_server_index_def; +> +> extern int cifs_fscache_register(void); +> extern void cifs_fscache_unregister(void); +> +> +/* +> + * fscache.c +> + */ +> +extern void cifs_fscache_get_client_cookie(struct TCP_Server_Info *); +> +extern void cifs_fscache_release_client_cookie(struct TCP_Server_Info *); +> + +> #else /* CONFIG_CIFS_FSCACHE */ +> static inline int cifs_fscache_register(void) { return 0; } +> static inline void cifs_fscache_unregister(void) {} +> +> +static inline void +> +cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) {} +> +static inline void +> +cifs_fscache_get_client_cookie(struct TCP_Server_Info *server); {} +> + +> #endif /* CONFIG_CIFS_FSCACHE */ +> +> #endif /* _CIFS_FSCACHE_H */ +> -- +> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in +> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +> More majordomo info at http://vger.kernel.org/majordomo-info.html +> + + +-- +Jeff Layton <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org> + + diff --git a/test/corpora/lkml/cur/1382298587.001970:2, b/test/corpora/lkml/cur/1382298587.001970:2, new file mode 100644 index 00000000..707d0ad2 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.001970:2, @@ -0,0 +1,103 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: Re: [RFC][PATCH 04/10] cifs: define server-level cache index objects + and register them with FS-Cache +Date: Wed, 23 Jun 2010 11:04:39 +0530 +Lines: 61 +Message-ID: <4C219CEF.5000003@suse.de> +References: <yes> <1277220198-3522-1-git-send-email-sjayaraman@suse.de> <20100622175214.4c56234f@corrin.poochiereds.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Jeff Layton <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Wed Jun 23 07:34:50 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORIbp-0002v4-3W + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Wed, 23 Jun 2010 07:34:49 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1750954Ab0FWFes (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Wed, 23 Jun 2010 01:34:48 -0400 +Received: from cantor2.suse.de ([195.135.220.15]:58263 "EHLO mx2.suse.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1750809Ab0FWFes (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Wed, 23 Jun 2010 01:34:48 -0400 +Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) + by mx2.suse.de (Postfix) with ESMTP id 8C18386A2E; + Wed, 23 Jun 2010 07:34:46 +0200 (CEST) +User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 +In-Reply-To: <20100622175214.4c56234f-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001998> + +On 06/23/2010 03:22 AM, Jeff Layton wrote: +> On Tue, 22 Jun 2010 20:53:18 +0530 +> Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: +> +>> Define server-level cache index objects (as managed by TCP_ServerInfo structs). +>> Each server object is created in the CIFS top-level index object and is itself +>> an index into which superblock-level objects are inserted. +>> +>> Currently, the server objects are keyed by hostname. +>> +>> Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +>> --- +>> fs/cifs/Makefile | 2 +- +>> fs/cifs/cache.c | 25 +++++++++++++++++++++++++ +>> fs/cifs/cifsglob.h | 3 +++ +>> fs/cifs/connect.c | 4 ++++ +>> fs/cifs/fscache.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ +>> fs/cifs/fscache.h | 12 ++++++++++++ +>> 6 files changed, 92 insertions(+), 1 deletion(-) +>> create mode 100644 fs/cifs/fscache.c +>> +>> Index: cifs-2.6/fs/cifs/Makefile +>> =================================================================== +>> --- cifs-2.6.orig/fs/cifs/Makefile +>> +++ cifs-2.6/fs/cifs/Makefile +>> @@ -12,4 +12,4 @@ cifs-$(CONFIG_CIFS_UPCALL) += cifs_spneg +>> +>> cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o +>> +>> -cifs-$(CONFIG_CIFS_FSCACHE) += cache.o +>> +cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cache.o +>> Index: cifs-2.6/fs/cifs/cache.c +>> =================================================================== +>> --- cifs-2.6.orig/fs/cifs/cache.c +>> +++ cifs-2.6/fs/cifs/cache.c +>> @@ -51,3 +51,28 @@ void cifs_fscache_unregister(void) +>> fscache_unregister_netfs(&cifs_fscache_netfs); +>> } +>> +>> +/* +>> + * Server object currently keyed by hostname +>> + */ +>> +static uint16_t cifs_server_get_key(const void *cookie_netfs_data, +>> + void *buffer, uint16_t maxbuf) +>> +{ +>> + const struct TCP_Server_Info *server = cookie_netfs_data; +>> + uint16_t len = strnlen(server->hostname, sizeof(server->hostname)); +>> + +> +> Would a tuple of address/family/port be a better choice here? Imagine I +> mount "foo" and then later mount "foor.bar.baz". If they are the same +> address and only the UNC differs, then you won't get the benefit of +> the cache, right? +> + +Good point. I'll fix it up when I do a respin. + +Thanks, + +-- +Suresh Jayaraman + + diff --git a/test/corpora/lkml/cur/1382298587.002189:2, b/test/corpora/lkml/cur/1382298587.002189:2, new file mode 100644 index 00000000..3cfc62e0 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002189:2, @@ -0,0 +1,66 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 03/10] cifs: register CIFS for caching +Date: Wed, 23 Jun 2010 17:51:17 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 20 +Message-ID: <9603.1277311877@redhat.com> +References: <1277220189-3485-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Wed Jun 23 18:51:32 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORTAg-0008Bt-CT + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Wed, 23 Jun 2010 18:51:30 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1751915Ab0FWQv3 (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Wed, 23 Jun 2010 12:51:29 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:50923 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751520Ab0FWQv3 (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Wed, 23 Jun 2010 12:51:29 -0400 +Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NGpLFc028550 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 12:51:21 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NGpHIG010890; + Wed, 23 Jun 2010 12:51:18 -0400 +In-Reply-To: <1277220189-3485-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002219> + +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> + rc = cifs_fscache_register(); +> + if (rc) +> + goto out; +> + +> rc = cifs_init_inodecache(); +> if (rc) +> goto out_clean_proc; +> @@ -949,8 +954,10 @@ init_cifs(void) +> cifs_destroy_mids(); +> out_destroy_inodecache: +> cifs_destroy_inodecache(); +> + cifs_fscache_unregister(); +> out_clean_proc: + +This is incorrect. You need to call cifs_fscache_unregister() if +cifs_init_inodecache() fails. + +David + + diff --git a/test/corpora/lkml/cur/1382298587.002193:2, b/test/corpora/lkml/cur/1382298587.002193:2, new file mode 100644 index 00000000..e2ea6266 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002193:2, @@ -0,0 +1,59 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 05/10] cifs: define superblock-level cache index objects and register them +Date: Wed, 23 Jun 2010 17:58:10 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 13 +Message-ID: <9720.1277312290@redhat.com> +References: <1277220206-3559-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Wed Jun 23 18:58:19 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORTHG-0003Az-Ge + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Wed, 23 Jun 2010 18:58:18 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1751520Ab0FWQ6R (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Wed, 23 Jun 2010 12:58:17 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:62343 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751372Ab0FWQ6R (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Wed, 23 Jun 2010 12:58:17 -0400 +Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NGwDC2031683 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 12:58:13 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NGwAfq021298; + Wed, 23 Jun 2010 12:58:11 -0400 +In-Reply-To: <1277220206-3559-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002223> + +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> Define superblock-level cache index objects (managed by cifsTconInfo +> structs). Each superblock object is created in a server-level index object +> and in itself an index into which inode-level objects are inserted. +> +> Currently, the superblock objects are keyed by sharename. + +Seems reasonable. Is there any way you can check that the share you are +looking at on a server is the same as the last time you looked? Can you +validate the root directory of the share in some way? + +David + + diff --git a/test/corpora/lkml/cur/1382298587.002194:2, b/test/corpora/lkml/cur/1382298587.002194:2, new file mode 100644 index 00000000..d2d1efdb --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002194:2, @@ -0,0 +1,61 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and register them +Date: Wed, 23 Jun 2010 18:02:53 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 15 +Message-ID: <9822.1277312573@redhat.com> +References: <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Wed Jun 23 19:03:04 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORTLr-0007Bh-Cs + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Wed, 23 Jun 2010 19:03:03 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1752063Ab0FWRDB (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Wed, 23 Jun 2010 13:03:01 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:30823 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751804Ab0FWRDA (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Wed, 23 Jun 2010 13:03:00 -0400 +Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH2v0J030982 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 13:02:57 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH2r9N014323; + Wed, 23 Jun 2010 13:02:54 -0400 +In-Reply-To: <1277220214-3597-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002224> + +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> Define inode-level data storage objects (managed by cifsInodeInfo structs). +> Each inode-level object is created in a super-block level object and is +> itself a data storage object in to which pages from the inode are stored. +> +> The inode object is keyed by UniqueId. The coherency data being used is +> LastWriteTime and the file size. + +Isn't there a file creation time too? + +I take it you don't support caching on files that are open for writing at this +time? + +David + + diff --git a/test/corpora/lkml/cur/1382298587.002195:2, b/test/corpora/lkml/cur/1382298587.002195:2, new file mode 100644 index 00000000..ec54a814 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002195:2, @@ -0,0 +1,59 @@ +From: David Howells <dhowells@redhat.com> +Subject: Re: [RFC][PATCH 07/10] cifs: FS-Cache page management +Date: Wed, 23 Jun 2010 18:05:01 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 13 +Message-ID: <9866.1277312701@redhat.com> +References: <1277220228-3635-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells@redhat.com, Steve French <smfrench@gmail.com>, + linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Suresh Jayaraman <sjayaraman@suse.de> +X-From: linux-fsdevel-owner@vger.kernel.org Wed Jun 23 19:05:19 2010 +Return-path: <linux-fsdevel-owner@vger.kernel.org> +Envelope-to: lnx-linux-fsdevel@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-fsdevel-owner@vger.kernel.org>) + id 1ORTNz-0008Oj-Ho + for lnx-linux-fsdevel@lo.gmane.org; Wed, 23 Jun 2010 19:05:15 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1752145Ab0FWRFO (ORCPT <rfc822;lnx-linux-fsdevel@m.gmane.org>); + Wed, 23 Jun 2010 13:05:14 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:1689 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751804Ab0FWRFN (ORCPT <rfc822;linux-fsdevel@vger.kernel.org>); + Wed, 23 Jun 2010 13:05:13 -0400 +Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH59sl011966 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 13:05:09 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH52Jl022163; + Wed, 23 Jun 2010 13:05:03 -0400 +In-Reply-To: <1277220228-3635-1-git-send-email-sjayaraman@suse.de> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 +Sender: linux-fsdevel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-fsdevel.vger.kernel.org> +X-Mailing-List: linux-fsdevel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002225> + +Suresh Jayaraman <sjayaraman@suse.de> wrote: + +> Takes care of invalidation and release of FS-Cache marked pages and also +> invalidation of the FsCache page flag when the inode is removed. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> + +Acked-by: David Howells <dhowells@redhat.com> +-- +To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298587.002196:2, b/test/corpora/lkml/cur/1382298587.002196:2, new file mode 100644 index 00000000..63838dc7 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002196:2, @@ -0,0 +1,54 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 08/10] cifs: store pages into local cache +Date: Wed, 23 Jun 2010 18:06:12 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 8 +Message-ID: <9890.1277312772@redhat.com> +References: <1277220240-3674-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Wed Jun 23 19:06:21 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORTP3-0000fp-01 + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Wed, 23 Jun 2010 19:06:21 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1752403Ab0FWRGU (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Wed, 23 Jun 2010 13:06:20 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:63621 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751804Ab0FWRGT (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Wed, 23 Jun 2010 13:06:19 -0400 +Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH6FCB012081 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 13:06:15 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH6CKG013414; + Wed, 23 Jun 2010 13:06:13 -0400 +In-Reply-To: <1277220240-3674-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002226> + +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> Store pages from an CIFS inode into the data storage object associated with +> that inode. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> + +Acked-by: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> + + diff --git a/test/corpora/lkml/cur/1382298587.002197:2, b/test/corpora/lkml/cur/1382298587.002197:2, new file mode 100644 index 00000000..765c3993 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002197:2, @@ -0,0 +1,53 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 09/10] cifs: read pages from FS-Cache +Date: Wed, 23 Jun 2010 18:07:40 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 7 +Message-ID: <9918.1277312860@redhat.com> +References: <1277220261-3717-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Wed Jun 23 19:07:51 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORTQR-0000nv-JF + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Wed, 23 Jun 2010 19:07:47 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1751708Ab0FWRHr (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Wed, 23 Jun 2010 13:07:47 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:34413 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1750954Ab0FWRHq (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Wed, 23 Jun 2010 13:07:46 -0400 +Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH7h3Y005904 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 13:07:43 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH7efR020683; + Wed, 23 Jun 2010 13:07:41 -0400 +In-Reply-To: <1277220261-3717-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002227> + +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> Read pages from a FS-Cache data storage object into a CIFS inode. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> + +Acked-by: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> + + diff --git a/test/corpora/lkml/cur/1382298587.002201:2, b/test/corpora/lkml/cur/1382298587.002201:2, new file mode 100644 index 00000000..bae1eefe --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002201:2, @@ -0,0 +1,58 @@ +From: David Howells <dhowells@redhat.com> +Subject: Re: [RFC][PATCH 10/10] cifs: add mount option to enable local caching +Date: Wed, 23 Jun 2010 18:08:34 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 12 +Message-ID: <9942.1277312914@redhat.com> +References: <1277220309-3757-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells@redhat.com, Steve French <smfrench@gmail.com>, + linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Suresh Jayaraman <sjayaraman@suse.de> +X-From: linux-kernel-owner@vger.kernel.org Wed Jun 23 19:09:22 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1ORTRv-0002J8-2s + for glk-linux-kernel-3@lo.gmane.org; Wed, 23 Jun 2010 19:09:19 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1753275Ab0FWRIt (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Wed, 23 Jun 2010 13:08:49 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:6156 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1753203Ab0FWRIr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Wed, 23 Jun 2010 13:08:47 -0400 +Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH8dax006028 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 13:08:39 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH8YmA020846; + Wed, 23 Jun 2010 13:08:36 -0400 +In-Reply-To: <1277220309-3757-1-git-send-email-sjayaraman@suse.de> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002231> + +Suresh Jayaraman <sjayaraman@suse.de> wrote: + +> Add a mount option 'fsc' to enable local caching on CIFS. +> +> As the cifs-utils (userspace) changes are not done yet, this patch enables +> 'fsc' by default to assist testing. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> + +Acked-by: David Howells <dhowells@redhat.com> + +(Give or take the debugging bit) + + diff --git a/test/corpora/lkml/cur/1382298587.002228:2, b/test/corpora/lkml/cur/1382298587.002228:2, new file mode 100644 index 00000000..b401ae39 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002228:2, @@ -0,0 +1,100 @@ +From: Scott Lovenberg <scott.lovenberg@gmail.com> +Subject: Re: [RFC][PATCH 10/10] cifs: add mount option to enable local caching +Date: Wed, 23 Jun 2010 14:32:24 -0400 +Lines: 37 +Message-ID: <4C225338.9010807@gmail.com> +References: <yes> <1277220309-3757-1-git-send-email-sjayaraman@suse.de> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench@gmail.com>, linux-cifs@vger.kernel.org, + linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, + David Howells <dhowells@redhat.com> +To: Suresh Jayaraman <sjayaraman@suse.de> +X-From: linux-kernel-owner@vger.kernel.org Wed Jun 23 20:32:44 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1ORUke-00020X-7B + for glk-linux-kernel-3@lo.gmane.org; Wed, 23 Jun 2010 20:32:44 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1753205Ab0FWScd (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Wed, 23 Jun 2010 14:32:33 -0400 +Received: from mail-gx0-f174.google.com ([209.85.161.174]:50118 "EHLO + mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752380Ab0FWScb (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Wed, 23 Jun 2010 14:32:31 -0400 +Received: by gxk28 with SMTP id 28so317656gxk.19 + for <multiple recipients>; Wed, 23 Jun 2010 11:32:31 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:received:received:message-id:date:from + :user-agent:mime-version:to:cc:subject:references:in-reply-to + :content-type:content-transfer-encoding; + bh=iTBSrajJefJVTimpUcvJQmptYefXJDrz9ZyZgxnMvzA=; + b=DOZLux9YGwNIWknqofz5rMltvopOT+kRgPsHIYw8Z7Uhh9gR5YAD4V6kKmv1SIaWoo + uXjNwY+IPIiD4f4OwwlpwJTd4B7PkBCDIlOkwVcvvS3F6qr6WbXBd0nRuRiFGMwONU3E + MqTAWDDwIXLVURr1t+n3MFrKwKj5b7pZT5fHw= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=message-id:date:from:user-agent:mime-version:to:cc:subject + :references:in-reply-to:content-type:content-transfer-encoding; + b=pTsfPMlTDpE3Oi2w9V3eE2ohOeBEloXhgElmCwGEenBegF7ZhIyoga6tyRJqQ922ws + oyxLXSORpOuPJRoIBRXfzae3KXkgKT0eLDjxQNTdS7Jbe+vcJ604sANFcnxBsJ51fThT + R/wXt7LiG/T6H4DUpcN7aUjtzlq9JgC2JQ/ws= +Received: by 10.224.43.197 with SMTP id x5mr5243425qae.127.1277317950764; + Wed, 23 Jun 2010 11:32:30 -0700 (PDT) +Received: from [192.168.0.2] ([64.9.41.61]) + by mx.google.com with ESMTPS id 15sm3010007qcg.2.2010.06.23.11.32.25 + (version=TLSv1/SSLv3 cipher=RC4-MD5); + Wed, 23 Jun 2010 11:32:26 -0700 (PDT) +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100512 Lightning/1.0b1 Thunderbird/3.0.5 ThunderBrowse/3.2.8.1 +In-Reply-To: <1277220309-3757-1-git-send-email-sjayaraman@suse.de> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002258> + +On 6/22/2010 11:25 AM, Suresh Jayaraman wrote: +> Add a mount option 'fsc' to enable local caching on CIFS. +> +> As the cifs-utils (userspace) changes are not done yet, this patch enables +> 'fsc' by default to assist testing. +> +[...] +> @@ -1332,6 +1336,8 @@ cifs_parse_mount_options(char *options, const char *devname, +> printk(KERN_WARNING "CIFS: Mount option noac not " +> "supported. Instead set " +> "/proc/fs/cifs/LookupCacheEnabled to 0\n"); +> + } else if (strnicmp(data, "fsc", 3) == 0) { +> + vol->fsc = true; +> } else +> printk(KERN_WARNING "CIFS: Unknown mount option %s\n", +> data); +> @@ -2405,6 +2411,8 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info, +> cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_GID; +> if (pvolume_info->dynperm) +> cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM; +> + if (pvolume_info->fsc) +> + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_FSCACHE; +> if (pvolume_info->direct_io) { +> cFYI(1, "mounting share using direct i/o"); +> cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; +> +I reworked the CIFS mount option parsing a while back; I'm not sure +whether that patch was going to be in the 2.6.35 tree or not (the window +just opened, didn't it?). + +Jeff, Steve, can you confirm if that patch is going to be in 2.6.35? + +Patch refs: http://patchwork.ozlabs.org/patch/53059/ and +http://patchwork.ozlabs.org/patch/53674/ + + + + + diff --git a/test/corpora/lkml/cur/1382298587.002878:2, b/test/corpora/lkml/cur/1382298587.002878:2, new file mode 100644 index 00000000..66a3e223 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002878:2, @@ -0,0 +1,90 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: Re: [RFC][PATCH 10/10] cifs: add mount option to enable local caching +Date: Fri, 25 Jun 2010 16:18:12 +0530 +Lines: 47 +Message-ID: <4C24896C.4000903@suse.de> +References: <yes> <1277220309-3757-1-git-send-email-sjayaraman@suse.de> <4C225338.9010807@gmail.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Fri Jun 25 12:48:27 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OS6SO-0003QF-NW + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Fri, 25 Jun 2010 12:48:25 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1753965Ab0FYKsX (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 06:48:23 -0400 +Received: from cantor.suse.de ([195.135.220.2]:46395 "EHLO mx1.suse.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1752612Ab0FYKsW (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Fri, 25 Jun 2010 06:48:22 -0400 +Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mx1.suse.de (Postfix) with ESMTP id 60CED6CB00; + Fri, 25 Jun 2010 12:48:21 +0200 (CEST) +User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 +In-Reply-To: <4C225338.9010807-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002912> + +On 06/24/2010 12:02 AM, Scott Lovenberg wrote: +> On 6/22/2010 11:25 AM, Suresh Jayaraman wrote: +>> Add a mount option 'fsc' to enable local caching on CIFS. +>> +>> As the cifs-utils (userspace) changes are not done yet, this patch +>> enables +>> 'fsc' by default to assist testing. +>> +> [...] +>> @@ -1332,6 +1336,8 @@ cifs_parse_mount_options(char *options, const +>> char *devname, +>> printk(KERN_WARNING "CIFS: Mount option noac not " +>> "supported. Instead set " +>> "/proc/fs/cifs/LookupCacheEnabled to 0\n"); +>> + } else if (strnicmp(data, "fsc", 3) == 0) { +>> + vol->fsc = true; +>> } else +>> printk(KERN_WARNING "CIFS: Unknown mount option %s\n", +>> data); +>> @@ -2405,6 +2411,8 @@ static void setup_cifs_sb(struct smb_vol +>> *pvolume_info, +>> cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_GID; +>> if (pvolume_info->dynperm) +>> cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM; +>> + if (pvolume_info->fsc) +>> + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_FSCACHE; +>> if (pvolume_info->direct_io) { +>> cFYI(1, "mounting share using direct i/o"); +>> cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; +>> +> I reworked the CIFS mount option parsing a while back; I'm not sure +> whether that patch was going to be in the 2.6.35 tree or not (the window +> just opened, didn't it?). + +Not a problem, I could redo this patch alone when the reworked option +parsing patches get in. + +> Jeff, Steve, can you confirm if that patch is going to be in 2.6.35? +> +> Patch refs: http://patchwork.ozlabs.org/patch/53059/ and +> http://patchwork.ozlabs.org/patch/53674/ +> + +Thanks, + +-- +Suresh Jayaraman + + diff --git a/test/corpora/lkml/cur/1382298587.002912:2, b/test/corpora/lkml/cur/1382298587.002912:2, new file mode 100644 index 00000000..d9c761de --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002912:2, @@ -0,0 +1,65 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and + register them +Date: Fri, 25 Jun 2010 18:20:14 +0530 +Lines: 24 +Message-ID: <4C24A606.5040001@suse.de> +References: <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <yes> <9822.1277312573@redhat.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Fri Jun 25 14:50:26 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OS8MR-0007EU-OS + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Fri, 25 Jun 2010 14:50:24 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1754607Ab0FYMuX (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 08:50:23 -0400 +Received: from cantor2.suse.de ([195.135.220.15]:38716 "EHLO mx2.suse.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1753675Ab0FYMuW (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Fri, 25 Jun 2010 08:50:22 -0400 +Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) + by mx2.suse.de (Postfix) with ESMTP id B05E686A2E; + Fri, 25 Jun 2010 14:50:21 +0200 (CEST) +User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 +In-Reply-To: <9822.1277312573-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002946> + +On 06/23/2010 10:32 PM, David Howells wrote: +> Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: +> +>> Define inode-level data storage objects (managed by cifsInodeInfo structs). +>> Each inode-level object is created in a super-block level object and is +>> itself a data storage object in to which pages from the inode are stored. +>> +>> The inode object is keyed by UniqueId. The coherency data being used is +>> LastWriteTime and the file size. +> +> Isn't there a file creation time too? + +I think the creation time is currently being ignored as we won't be able +to accomodate in POSIX stat struct. + +> I take it you don't support caching on files that are open for writing at this +> time? +> + +Yes. + + +-- +Suresh Jayaraman + + diff --git a/test/corpora/lkml/cur/1382298587.002915:2, b/test/corpora/lkml/cur/1382298587.002915:2, new file mode 100644 index 00000000..e43c909f --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002915:2, @@ -0,0 +1,58 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and register them +Date: Fri, 25 Jun 2010 13:55:49 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 12 +Message-ID: <22697.1277470549@redhat.com> +References: <4C24A606.5040001@suse.de> <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <yes> <9822.1277312573@redhat.com> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Fri Jun 25 14:56:04 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OS8Rw-0002tq-3k + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Fri, 25 Jun 2010 14:56:04 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1753622Ab0FYM4B (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 08:56:01 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:50162 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1752535Ab0FYM4B (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Fri, 25 Jun 2010 08:56:01 -0400 +Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5PCtqOd018091 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Fri, 25 Jun 2010 08:55:52 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5PCtn4G016466; + Fri, 25 Jun 2010 08:55:51 -0400 +In-Reply-To: <4C24A606.5040001-l3A5Bk7waGM@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002949> + +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> I think the creation time is currently being ignored as we won't be able +> to accomodate in POSIX stat struct. + +The FS-Cache interface doesn't use the POSIX stat struct, but it could be +really useful to save it and use it for cache coherency inside the kernel. + +Out of interest, what does Samba do when it comes to generating a creation time +for UNIX where one does not exist? + +David + + diff --git a/test/corpora/lkml/cur/1382298587.002917:2, b/test/corpora/lkml/cur/1382298587.002917:2, new file mode 100644 index 00000000..f7047f84 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002917:2, @@ -0,0 +1,67 @@ +From: David Howells <dhowells@redhat.com> +Subject: Re: [RFC][PATCH 05/10] cifs: define superblock-level cache index objects and register them +Date: Fri, 25 Jun 2010 13:58:33 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 21 +Message-ID: <22746.1277470713@redhat.com> +References: <4C24A4A0.90408@suse.de> <1277220206-3559-1-git-send-email-sjayaraman@suse.de> <yes> <9720.1277312290@redhat.com> +Cc: dhowells@redhat.com, Steve French <smfrench@gmail.com>, + linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Suresh Jayaraman <sjayaraman@suse.de> +X-From: linux-fsdevel-owner@vger.kernel.org Fri Jun 25 15:02:20 2010 +Return-path: <linux-fsdevel-owner@vger.kernel.org> +Envelope-to: lnx-linux-fsdevel@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with smtp (Exim 4.69) + (envelope-from <linux-fsdevel-owner@vger.kernel.org>) + id 1OS8Xz-000628-FG + for lnx-linux-fsdevel@lo.gmane.org; Fri, 25 Jun 2010 15:02:19 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1755357Ab0FYM6k (ORCPT <rfc822;lnx-linux-fsdevel@m.gmane.org>); + Fri, 25 Jun 2010 08:58:40 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:50417 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1754086Ab0FYM6j (ORCPT <rfc822;linux-fsdevel@vger.kernel.org>); + Fri, 25 Jun 2010 08:58:39 -0400 +Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5PCwa7Z005113 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Fri, 25 Jun 2010 08:58:36 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5PCwXVB011094; + Fri, 25 Jun 2010 08:58:34 -0400 +In-Reply-To: <4C24A4A0.90408@suse.de> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 +Sender: linux-fsdevel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-fsdevel.vger.kernel.org> +X-Mailing-List: linux-fsdevel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002951> + +Suresh Jayaraman <sjayaraman@suse.de> wrote: + +> Also, considering the UNC name of the resource (//server/share) may not +> be a good idea too as the cache will not be used when for e.g. IPaddress +> is used to mount. + +You could convert the UNC name to an IP address, and just use that as your +key. + +> > validate the root directory of the share in some way? +> +> I don't know if there is a way to do this. + +Is there an inode number or something? Even the creation time might do. + +David +-- +To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298587.002997:2, b/test/corpora/lkml/cur/1382298587.002997:2, new file mode 100644 index 00000000..b78073cd --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.002997:2, @@ -0,0 +1,90 @@ +From: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and + register them +Date: Fri, 25 Jun 2010 12:53:06 -0400 +Lines: 36 +Message-ID: <20100625125306.7f9b1966@tlielax.poochiereds.net> +References: <4C24A606.5040001@suse.de> + <1277220214-3597-1-git-send-email-sjayaraman@suse.de> + <yes> + <9822.1277312573@redhat.com> + <22697.1277470549@redhat.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +Cc: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org>, + Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org +To: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Fri Jun 25 18:53:12 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OSC9P-0005Eb-SU + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Fri, 25 Jun 2010 18:53:12 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S932199Ab0FYQxK (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 12:53:10 -0400 +Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.122]:53512 "EHLO + cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S932187Ab0FYQxJ (ORCPT + <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); Fri, 25 Jun 2010 12:53:09 -0400 +X-Authority-Analysis: v=1.0 c=1 a=iVNVO0OCT3kA:10 a=yQWWgrYGNuUA:10 a=kj9zAlcOel0A:10 a=20KFwNOVAAAA:8 a=hGzw-44bAAAA:8 a=f0L6POiToRdS6aViIA4A:9 a=tdNtT7bw1iHNm6ggrCkIte35EhAA:4 a=CjuIK1q_8ugA:10 a=jEp0ucaQiEUA:10 a=0kPLrQdw3YYA:10 a=dowx1zmaLagA:10 a=00U40p1LBqVLw4jT:21 a=gh7LVOPznGai4vo_:21 +X-Cloudmark-Score: 0 +X-Originating-IP: 71.70.153.3 +Received: from [71.70.153.3] ([71.70.153.3:42266] helo=mail.poochiereds.net) + by cdptpa-oedge01.mail.rr.com (envelope-from <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>) + (ecelerity 2.2.2.39 r()) with ESMTP + id 2D/E0-24471-3FED42C4; Fri, 25 Jun 2010 16:53:08 +0000 +Received: from tlielax.poochiereds.net (tlielax.poochiereds.net [192.168.1.3]) + by mail.poochiereds.net (Postfix) with ESMTPS id E9B19580FA; + Fri, 25 Jun 2010 12:53:06 -0400 (EDT) +In-Reply-To: <22697.1277470549-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-redhat-linux-gnu) +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003033> + +On Fri, 25 Jun 2010 13:55:49 +0100 +David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: + +> Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: +> +> > I think the creation time is currently being ignored as we won't be able +> > to accomodate in POSIX stat struct. +> +> The FS-Cache interface doesn't use the POSIX stat struct, but it could be +> really useful to save it and use it for cache coherency inside the kernel. +> +> Out of interest, what does Samba do when it comes to generating a creation time +> for UNIX where one does not exist? +> + +(cc'ing samba-technical since we're talking about the create time) + +Looks like it mostly uses the ctime. IMO, the mtime would be a better +choice since it changes less frequently, but I don't guess that it +matters very much. + +I have a few patches that make the cifs_iget code do more stringent +checks. One of those makes it use the create time like an i_generation +field to guard against matching inodes that have the same number but +that have undergone a delete/create cycle. They need a bit more testing +but I'm planning to post them in time for 2.6.36. + +Because of how samba generates this number, it could be somewhat +problematic to do this. What may save us though is that Linux<->Samba +mostly uses unix extensions unless someone has specifically disabled +them on either end. The unix extension calls don't generally send any +sort of create time field, so we can't rely on it in those codepaths +anyway. + +-- +Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> + + diff --git a/test/corpora/lkml/cur/1382298587.003106:2, b/test/corpora/lkml/cur/1382298587.003106:2, new file mode 100644 index 00000000..19ea381d --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.003106:2, @@ -0,0 +1,60 @@ +From: David Howells <dhowells@redhat.com> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and register them +Date: Fri, 25 Jun 2010 22:46:38 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 13 +Message-ID: <18628.1277502398@redhat.com> +References: <20100625125306.7f9b1966@tlielax.poochiereds.net> <4C24A606.5040001@suse.de> <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <yes> <9822.1277312573@redhat.com> <22697.1277470549@redhat.com> +Cc: dhowells@redhat.com, Suresh Jayaraman <sjayaraman@suse.de>, + Steve French <smfrench@gmail.com>, linux-cifs@vger.kernel.org, + linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, + samba-technical@lists.samba.org +To: Jeff Layton <jlayton@samba.org> +X-From: linux-kernel-owner@vger.kernel.org Fri Jun 25 23:47:07 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OSGjo-0006q8-ME + for glk-linux-kernel-3@lo.gmane.org; Fri, 25 Jun 2010 23:47:05 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932250Ab0FYVqv (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Fri, 25 Jun 2010 17:46:51 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:55406 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932088Ab0FYVqs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Fri, 25 Jun 2010 17:46:48 -0400 +Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5PLkhIG005974 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Fri, 25 Jun 2010 17:46:43 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5PLkd77017768; + Fri, 25 Jun 2010 17:46:40 -0400 +In-Reply-To: <20100625125306.7f9b1966@tlielax.poochiereds.net> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003142> + +Jeff Layton <jlayton@samba.org> wrote: + +> Looks like it mostly uses the ctime. IMO, the mtime would be a better +> choice since it changes less frequently, but I don't guess that it +> matters very much. + +I'd've thought mtime changes more frequently since that's altered when data is +written. ctime is changed when attributes are changed. + +Note that Ext4 appears to have a file creation time field in its inode +(struct ext4_inode::i_crtime[_extra]). Can Samba be made to use that? + +David + + diff --git a/test/corpora/lkml/cur/1382298587.003112:2, b/test/corpora/lkml/cur/1382298587.003112:2, new file mode 100644 index 00000000..e74a864c --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.003112:2, @@ -0,0 +1,105 @@ +From: Jeff Layton <jlayton@samba.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and + register them +Date: Fri, 25 Jun 2010 18:26:51 -0400 +Lines: 30 +Message-ID: <20100625182651.36800d06@tlielax.poochiereds.net> +References: <20100625125306.7f9b1966@tlielax.poochiereds.net> + <4C24A606.5040001@suse.de> + <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <yes> + <9822.1277312573@redhat.com> <22697.1277470549@redhat.com> + <18628.1277502398@redhat.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +Cc: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, + linux-kernel@vger.kernel.org, Steve French <smfrench@gmail.com>, + linux-fsdevel@vger.kernel.org +To: David Howells <dhowells@redhat.com> +X-From: samba-technical-bounces@lists.samba.org Sat Jun 26 00:27:01 2010 +Return-path: <samba-technical-bounces@lists.samba.org> +Envelope-to: gnsi-samba-technical@m.gmane.org +Received: from fn.samba.org ([216.83.154.106] helo=lists.samba.org) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <samba-technical-bounces@lists.samba.org>) + id 1OSHMS-0003Yl-G8 + for gnsi-samba-technical@m.gmane.org; Sat, 26 Jun 2010 00:27:01 +0200 +Received: from fn.samba.org (localhost [127.0.0.1]) + by lists.samba.org (Postfix) with ESMTP id 8919DAD2B8; + Fri, 25 Jun 2010 16:26:57 -0600 (MDT) +X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org +X-Spam-Level: +X-Spam-Status: No, score=-1.7 required=3.8 tests=AWL,BAYES_00,SPF_NEUTRAL + autolearn=no version=3.2.5 +X-Original-To: samba-technical@lists.samba.org +Delivered-To: samba-technical@lists.samba.org +Received: from cdptpa-omtalb.mail.rr.com (cdptpa-omtalb.mail.rr.com + [75.180.132.122]) + by lists.samba.org (Postfix) with ESMTP id ECB66AD220 + for <samba-technical@lists.samba.org>; + Fri, 25 Jun 2010 16:26:51 -0600 (MDT) +X-Authority-Analysis: v=1.0 c=1 a=iVNVO0OCT3kA:10 a=yQWWgrYGNuUA:10 + a=kj9zAlcOel0A:10 a=20KFwNOVAAAA:8 a=hGzw-44bAAAA:8 + a=AraS79FXNJ3kHilSTm4A:9 a=3STw0N-n4mJG0pydffwA:7 + a=0uwppTlTaQ5HiYOalIavAxwTlvEA:4 a=CjuIK1q_8ugA:10 + a=jEp0ucaQiEUA:10 a=dowx1zmaLagA:10 +X-Cloudmark-Score: 0 +X-Originating-IP: 71.70.153.3 +Received: from [71.70.153.3] ([71.70.153.3:55553] helo=mail.poochiereds.net) + by cdptpa-oedge01.mail.rr.com (envelope-from <jlayton@samba.org>) + (ecelerity 2.2.2.39 r()) with ESMTP + id 78/FA-24471-C2D252C4; Fri, 25 Jun 2010 22:26:53 +0000 +Received: from tlielax.poochiereds.net (tlielax.poochiereds.net [192.168.1.3]) + by mail.poochiereds.net (Postfix) with ESMTPS id 68F07580FA; + Fri, 25 Jun 2010 18:26:52 -0400 (EDT) +In-Reply-To: <18628.1277502398@redhat.com> +X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-redhat-linux-gnu) +X-BeenThere: samba-technical@lists.samba.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Discussions on Samba internals. For general questions please + subscribe to the list samba@samba.org" + <samba-technical.lists.samba.org> +List-Unsubscribe: <https://lists.samba.org/mailman/options/samba-technical>, + <mailto:samba-technical-request@lists.samba.org?subject=unsubscribe> +List-Archive: <http://lists.samba.org/pipermail/samba-technical> +List-Post: <mailto:samba-technical@lists.samba.org> +List-Help: <mailto:samba-technical-request@lists.samba.org?subject=help> +List-Subscribe: <https://lists.samba.org/mailman/listinfo/samba-technical>, + <mailto:samba-technical-request@lists.samba.org?subject=subscribe> +Sender: samba-technical-bounces@lists.samba.org +Errors-To: samba-technical-bounces@lists.samba.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003148> + +On Fri, 25 Jun 2010 22:46:38 +0100 +David Howells <dhowells@redhat.com> wrote: + +> Jeff Layton <jlayton@samba.org> wrote: +> +> > Looks like it mostly uses the ctime. IMO, the mtime would be a better +> > choice since it changes less frequently, but I don't guess that it +> > matters very much. +> +> I'd've thought mtime changes more frequently since that's altered when data is +> written. ctime is changed when attributes are changed. +> + +IIUC, updating mtime for a write is also an attribute change, and that +affects ctime. According to the stat(2) manpage: + + The field st_ctime is changed by writing or by setting inode informa- + tion (i.e., owner, group, link count, mode, etc.). + +> Note that Ext4 appears to have a file creation time field in its inode +> (struct ext4_inode::i_crtime[_extra]). Can Samba be made to use that? +> + +Is it exposed to userspace in any (standard) way? It would be handy to +have that. While we're wishing...it might also be nice to have a +standard way to get at the i_generation from userspace too. + +-- +Jeff Layton <jlayton@samba.org> + + + diff --git a/test/corpora/lkml/cur/1382298587.003117:2, b/test/corpora/lkml/cur/1382298587.003117:2, new file mode 100644 index 00000000..7f53e34b --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.003117:2, @@ -0,0 +1,65 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and register them +Date: Sat, 26 Jun 2010 00:04:28 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 18 +Message-ID: <20123.1277507068@redhat.com> +References: <20100625182651.36800d06@tlielax.poochiereds.net> <20100625125306.7f9b1966@tlielax.poochiereds.net> <4C24A606.5040001@suse.de> <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <yes> <9822.1277312573@redhat.com> <22697.1277470549@redhat.com> <18628.1277502398@redhat.com> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org>, + Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org +To: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Sat Jun 26 01:04:45 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OSHww-0006Jk-NV + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Sat, 26 Jun 2010 01:04:43 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1751807Ab0FYXEl (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 19:04:41 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:62977 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1752149Ab0FYXEl (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Fri, 25 Jun 2010 19:04:41 -0400 +Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5PN4X40004498 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Fri, 25 Jun 2010 19:04:34 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5PN4Sld008220; + Fri, 25 Jun 2010 19:04:30 -0400 +In-Reply-To: <20100625182651.36800d06-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003153> + +Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> wrote: + +> IIUC, updating mtime for a write is also an attribute change, and that +> affects ctime. According to the stat(2) manpage: + +You're right. Okay, ctime is the more frequently changed. + +> > Note that Ext4 appears to have a file creation time field in its inode +> > (struct ext4_inode::i_crtime[_extra]). Can Samba be made to use that? +> +> Is it exposed to userspace in any (standard) way? It would be handy to +> have that. While we're wishing...it might also be nice to have a +> standard way to get at the i_generation from userspace too. + +Not at present, but it's something that could be exported by ioctl() or +getxattr(). + +David + + diff --git a/test/corpora/lkml/cur/1382298587.003118:2, b/test/corpora/lkml/cur/1382298587.003118:2, new file mode 100644 index 00000000..a1ec438b --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.003118:2, @@ -0,0 +1,122 @@ +From: Steve French <smfrench@gmail.com> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and + register them +Date: Fri, 25 Jun 2010 18:05:30 -0500 +Lines: 51 +Message-ID: <AANLkTilOTrHLvLv4XWYZO6xCnYZgYT7gO2M-oKZ6VvqM@mail.gmail.com> +References: <20100625125306.7f9b1966@tlielax.poochiereds.net> + <4C24A606.5040001@suse.de> + <1277220214-3597-1-git-send-email-sjayaraman@suse.de> + <9822.1277312573@redhat.com> + <22697.1277470549@redhat.com> + <18628.1277502398@redhat.com> + <20100625182651.36800d06@tlielax.poochiereds.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: QUOTED-PRINTABLE +Cc: David Howells <dhowells@redhat.com>, + Suresh Jayaraman <sjayaraman@suse.de>, + linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org, samba-technical@lists.samba.org, + Jeff Layton <jlayton@redhat.com> +To: Jeff Layton <jlayton@samba.org>, + "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>, + Mingming Cao <mcao@us.ibm.com> +X-From: linux-kernel-owner@vger.kernel.org Sat Jun 26 01:05:41 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OSHxs-0006a8-BA + for glk-linux-kernel-3@lo.gmane.org; Sat, 26 Jun 2010 01:05:40 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1756188Ab0FYXFd convert rfc822-to-quoted-printable (ORCPT + <rfc822;glk-linux-kernel-3@m.gmane.org>); + Fri, 25 Jun 2010 19:05:33 -0400 +Received: from mail-qw0-f46.google.com ([209.85.216.46]:51369 "EHLO + mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751575Ab0FYXFb convert rfc822-to-8bit (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Fri, 25 Jun 2010 19:05:31 -0400 +Received: by qwi4 with SMTP id 4so742644qwi.19 + for <multiple recipients>; Fri, 25 Jun 2010 16:05:30 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:mime-version:received:received:in-reply-to + :references:date:message-id:subject:from:to:cc:content-type + :content-transfer-encoding; + bh=6wKQkGOEeUGN4oPR3Nm4SRxtJr/EBwN8ENmpLnfdCDU=; + b=X7L6W0MtpQeW/4iBuj+oDlcP2yCJ3qwUs9lHBq1fRW6WdYblHXjmaN8o++3GDPLAg5 + 0MD07zxbYTGXRSrgCjCrGVm0tT88/6hY2a/rB8g68h/Qso2sIHa7B1iIN8JRR4pPWle0 + sVjp9Xy/bQn2e0uE481Ii1TLHuWYA/QDXZreU= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=mime-version:in-reply-to:references:date:message-id:subject:from:to + :cc:content-type:content-transfer-encoding; + b=B+7qQvdOpN5a/KCRrDbssKZX8D3SnP73VMHd9RpkqP9nCHCmSLAgbeH03+/m6CLVAo + G+NKWqWtknwPBkYqT/bdP2XEak1yr+0rjOqjUaNvaT7AhzsyHEJBkaNnsbS3qaRy39OP + S7OkAyHfmgdeNAHkKnKRF73hfpvgAqR9X4bn8= +Received: by 10.224.59.223 with SMTP id m31mr1130670qah.63.1277507130411; Fri, + 25 Jun 2010 16:05:30 -0700 (PDT) +Received: by 10.229.46.136 with HTTP; Fri, 25 Jun 2010 16:05:30 -0700 (PDT) +In-Reply-To: <20100625182651.36800d06@tlielax.poochiereds.net> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003154> + +On Fri, Jun 25, 2010 at 5:26 PM, Jeff Layton <jlayton@samba.org> wrote: +> +> On Fri, 25 Jun 2010 22:46:38 +0100 +> David Howells <dhowells@redhat.com> wrote: +> +> > Jeff Layton <jlayton@samba.org> wrote: +> > +> > > Looks like it mostly uses the ctime. IMO, the mtime would be a be= +tter +> > > choice since it changes less frequently, but I don't guess that i= +t +> > > matters very much. +> > +> > I'd've thought mtime changes more frequently since that's altered w= +hen data is +> > written. =A0ctime is changed when attributes are changed. +> > +> +> IIUC, updating mtime for a write is also an attribute change, and tha= +t +> affects ctime. According to the stat(2) manpage: +> +> =A0 =A0 =A0 The field st_ctime is changed by writing or by setting =A0= +inode =A0informa- +> =A0 =A0 =A0 tion (i.e., owner, group, link count, mode, etc.). +> +> > Note that Ext4 appears to have a file creation time field in its in= +ode +> > (struct ext4_inode::i_crtime[_extra]). =A0Can Samba be made to use = +that? +> > +> +> Is it exposed to userspace in any (standard) way? It would be handy t= +o +> have that. While we're wishing...it might also be nice to have a +> standard way to get at the i_generation from userspace too. +> + +Yes - I have talked with MingMing and Aneesh about those (NFS may +someday be able to use those too).=A0 An obstacle in the past had been +that samba server stores its own fake creation time in an ndr encoded +xattr which complicates things. + +MingMing/Annesh - +Xattr or other way to get at birth time? + + +-- +Thanks, + +Steve + + diff --git a/test/corpora/lkml/cur/1382298587.003171:2, b/test/corpora/lkml/cur/1382298587.003171:2, new file mode 100644 index 00000000..66e425ef --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.003171:2, @@ -0,0 +1,174 @@ +From: Mingming Cao <mcao@us.ibm.com> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and + register them +Date: Fri, 25 Jun 2010 17:52:24 -0700 +Lines: 92 +Message-ID: <OFB55E8EC7.E8DD23D5-ON8725774E.0004921E-8825774E.0004CC31@us.ibm.com> +References: <20100625125306.7f9b1966@tlielax.poochiereds.net> <4C24A606.5040001@suse.de> + <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <9822.1277312573@redhat.com> + <22697.1277470549@redhat.com> <18628.1277502398@redhat.com> <20100625182651.36800d06@tlielax.poochiereds.net> + <AANLkTilOTrHLvLv4XWYZO6xCnYZgYT7gO2M-oKZ6VvqM@mail.gmail.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: quoted-printable +Cc: linux-cifs@vger.kernel.org, Jeff Layton <jlayton@redhat.com>, + samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, + David Howells <dhowells@redhat.com>, linux-fsdevel@vger.kernel.org, + "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> +To: Steve French <smfrench@gmail.com> +X-From: samba-technical-bounces@lists.samba.org Sat Jun 26 13:36:56 2010 +Return-path: <samba-technical-bounces@lists.samba.org> +Envelope-to: gnsi-samba-technical@m.gmane.org +Received: from fn.samba.org ([216.83.154.106] helo=lists.samba.org) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <samba-technical-bounces@lists.samba.org>) + id 1OSTgu-00025d-6P + for gnsi-samba-technical@m.gmane.org; Sat, 26 Jun 2010 13:36:56 +0200 +Received: from fn.samba.org (localhost [127.0.0.1]) + by lists.samba.org (Postfix) with ESMTP id 1ED11AD2C4; + Sat, 26 Jun 2010 05:36:45 -0600 (MDT) +X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org +X-Spam-Level: +X-Spam-Status: No, score=-6.6 required=3.8 tests=BAYES_00,HTML_MESSAGE, + RCVD_IN_DNSWL_MED,SPF_PASS autolearn=ham version=3.2.5 +X-Original-To: samba-technical@lists.samba.org +Delivered-To: samba-technical@lists.samba.org +Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) + by lists.samba.org (Postfix) with ESMTP id 30F90AD282 + for <samba-technical@lists.samba.org>; + Fri, 25 Jun 2010 18:52:24 -0600 (MDT) +Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com + [9.17.195.226]) + by e34.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o5Q0iN1h017083 + for <samba-technical@lists.samba.org>; Fri, 25 Jun 2010 18:44:23 -0600 +Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) + by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id + o5Q0qQTN175324 + for <samba-technical@lists.samba.org>; Fri, 25 Jun 2010 18:52:26 -0600 +Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) + by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP + id o5Q0qPCF006767 + for <samba-technical@lists.samba.org>; Fri, 25 Jun 2010 18:52:26 -0600 +Received: from d03nm128.boulder.ibm.com (d03nm128.boulder.ibm.com + [9.17.195.32]) + by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id + o5Q0qPrh006760; Fri, 25 Jun 2010 18:52:25 -0600 +In-Reply-To: <AANLkTilOTrHLvLv4XWYZO6xCnYZgYT7gO2M-oKZ6VvqM@mail.gmail.com> +X-KeepSent: B55E8EC7:E8DD23D5-8725774E:0004921E; + type=4; name=$KeepSent +X-Mailer: Lotus Notes Build V852_M2_03302010 March 30, 2010 +X-MIMETrack: Serialize by Router on D03NM128/03/M/IBM(Release 8.0.1|February + 07, 2008) at 06/25/2010 18:52:25 +X-Mailman-Approved-At: Sat, 26 Jun 2010 05:36:42 -0600 +X-Content-Filtered-By: Mailman/MimeDel 2.1.12 +X-BeenThere: samba-technical@lists.samba.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Discussions on Samba internals. For general questions please + subscribe to the list samba@samba.org" + <samba-technical.lists.samba.org> +List-Unsubscribe: <https://lists.samba.org/mailman/options/samba-technical>, + <mailto:samba-technical-request@lists.samba.org?subject=unsubscribe> +List-Archive: <http://lists.samba.org/pipermail/samba-technical> +List-Post: <mailto:samba-technical@lists.samba.org> +List-Help: <mailto:samba-technical-request@lists.samba.org?subject=help> +List-Subscribe: <https://lists.samba.org/mailman/listinfo/samba-technical>, + <mailto:samba-technical-request@lists.samba.org?subject=subscribe> +Sender: samba-technical-bounces@lists.samba.org +Errors-To: samba-technical-bounces@lists.samba.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003208> + + + +Steve French <smfrench@gmail.com> wrote on 06/25/2010 04:05:30 PM: + +> Steve French <smfrench@gmail.com> +> 06/25/2010 04:05 PM +> +> To +> +> Jeff Layton <jlayton@samba.org>, "Aneesh Kumar K.V" +> <aneesh.kumar@linux.vnet.ibm.com>, Mingming Cao/Beaverton/IBM@IBMUS +> +> cc +> +> David Howells <dhowells@redhat.com>, Suresh Jayaraman +> <sjayaraman@suse.de>, linux-cifs@vger.kernel.org, linux- +> fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, samba- +> technical@lists.samba.org, Jeff Layton <jlayton@redhat.com> +> +> Subject +> +> Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and +> register them +> +> On Fri, Jun 25, 2010 at 5:26 PM, Jeff Layton <jlayton@samba.org> wrot= +e: +> > +> > On Fri, 25 Jun 2010 22:46:38 +0100 +> > David Howells <dhowells@redhat.com> wrote: +> > +> > > Jeff Layton <jlayton@samba.org> wrote: +> > > +> > > > Looks like it mostly uses the ctime. IMO, the mtime would be a +better +> > > > choice since it changes less frequently, but I don't guess that= + it +> > > > matters very much. +> > > +> > > I'd've thought mtime changes more frequently since that's +> altered when data is +> > > written. =A0ctime is changed when attributes are changed. +> > > +> > +> > IIUC, updating mtime for a write is also an attribute change, and t= +hat +> > affects ctime. According to the stat(2) manpage: +> > +> > =A0 =A0 =A0 The field st_ctime is changed by writing or by setting +> =A0inode =A0informa- +> > =A0 =A0 =A0 tion (i.e., owner, group, link count, mode, etc.). +> > +> > > Note that Ext4 appears to have a file creation time field in its +inode +> > > (struct ext4_inode::i_crtime[_extra]). =A0Can Samba be made to us= +e +that? +> > > +> > +> > Is it exposed to userspace in any (standard) way? It would be handy= + to +> > have that. While we're wishing...it might also be nice to have a +> > standard way to get at the i_generation from userspace too. +> > +> +> Yes - I have talked with MingMing and Aneesh about those (NFS may +> someday be able to use those too).=A0 An obstacle in the past had bee= +n +> that samba server stores its own fake creation time in an ndr encoded= + +> xattr which complicates things. +> +> MingMing/Annesh - +> Xattr or other way to get at birth time? +> +> + +Not yet, + The ext4 file creation time only accesable from the kernel at the mome= +nt. +There were discussion +to make this information avaliable via xattr before, but was rejected, +since most people +agree that making this info avalibele via stat() is more standard. Howe= +ver +modifying stat() would imply +big interface change. thus no action has been taken yet. + +> -- +> Thanks, +> +> Steve= + + + diff --git a/test/corpora/lkml/cur/1382298587.003317:2, b/test/corpora/lkml/cur/1382298587.003317:2, new file mode 100644 index 00000000..6fce5182 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.003317:2, @@ -0,0 +1,156 @@ +From: "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and register them +Date: Sun, 27 Jun 2010 23:47:21 +0530 +Lines: 100 +Message-ID: <871vbscpce.fsf@linux.vnet.ibm.com> +References: <20100625125306.7f9b1966@tlielax.poochiereds.net> <4C24A606.5040001@suse.de> <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <9822.1277312573@redhat.com> <22697.1277470549@redhat.com> <18628.1277502398@redhat.com> <20100625182651.36800d06@tlielax.poochiereds.net> <AANLkTilOTrHLvLv4XWYZO6xCnYZgYT7gO2M-oKZ6VvqM@mail.gmail.com> <OFB55E8EC7.E8DD23D5-ON8725774E.0004921E-8825774E.0004CC31@us.ibm.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: QUOTED-PRINTABLE +Cc: David Howells <dhowells@redhat.com>, + Jeff Layton <jlayton@redhat.com>, + Jeff Layton <jlayton@samba.org>, linux-cifs@vger.kernel.org, + linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, + samba-technical@lists.samba.org, + Suresh Jayaraman <sjayaraman@suse.de> +To: Mingming Cao <mcao@us.ibm.com>, Steve French <smfrench@gmail.com>, + "DENIEL Philippe" <philippe.deniel@cea.fr> +X-From: linux-kernel-owner@vger.kernel.org Sun Jun 27 20:18:00 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OSwQZ-0003Kh-Vu + for glk-linux-kernel-3@lo.gmane.org; Sun, 27 Jun 2010 20:18:00 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1754631Ab0F0SRq convert rfc822-to-quoted-printable (ORCPT + <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 27 Jun 2010 14:17:46 -0400 +Received: from e23smtp07.au.ibm.com ([202.81.31.140]:52430 "EHLO + e23smtp07.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1753837Ab0F0SRl convert rfc822-to-8bit (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Sun, 27 Jun 2010 14:17:41 -0400 +Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) + by e23smtp07.au.ibm.com (8.14.4/8.13.1) with ESMTP id o5RIHbfJ012483; + Mon, 28 Jun 2010 04:17:37 +1000 +Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) + by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o5RIHW9f1130634; + Mon, 28 Jun 2010 04:17:32 +1000 +Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) + by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o5RIHVcR027534; + Mon, 28 Jun 2010 04:17:32 +1000 +Received: from skywalker.linux.vnet.ibm.com ([9.77.196.78]) + by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o5RIHMFl027485; + Mon, 28 Jun 2010 04:17:24 +1000 +In-Reply-To: <OFB55E8EC7.E8DD23D5-ON8725774E.0004921E-8825774E.0004CC31@us.ibm.com> +User-Agent: Notmuch/ (http://notmuchmail.org) Emacs/24.0.50.1 (i686-pc-linux-gnu) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003357> + +On Fri, 25 Jun 2010 17:52:24 -0700, Mingming Cao <mcao@us.ibm.com> wrot= +e: +>=20 +>=20 +> Steve French <smfrench@gmail.com> wrote on 06/25/2010 04:05:30 PM: +>=20 +> > Steve French <smfrench@gmail.com> +> > 06/25/2010 04:05 PM +> > +> > To +> > +> > Jeff Layton <jlayton@samba.org>, "Aneesh Kumar K.V" +> > <aneesh.kumar@linux.vnet.ibm.com>, Mingming Cao/Beaverton/IBM@IBMUS +> > +> > cc +> > +> > David Howells <dhowells@redhat.com>, Suresh Jayaraman +> > <sjayaraman@suse.de>, linux-cifs@vger.kernel.org, linux- +> > fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, samba- +> > technical@lists.samba.org, Jeff Layton <jlayton@redhat.com> +> > +> > Subject +> > +> > Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and +> > register them +> > +> > On Fri, Jun 25, 2010 at 5:26 PM, Jeff Layton <jlayton@samba.org> wr= +ote: +> > > +> > > On Fri, 25 Jun 2010 22:46:38 +0100 +> > > David Howells <dhowells@redhat.com> wrote: +> > > +> > > > Jeff Layton <jlayton@samba.org> wrote: +> > > > +> > > > > Looks like it mostly uses the ctime. IMO, the mtime would be = +a +> better +> > > > > choice since it changes less frequently, but I don't guess th= +at it +> > > > > matters very much. +> > > > +> > > > I'd've thought mtime changes more frequently since that's +> > altered when data is +> > > > written. =C2=A0ctime is changed when attributes are changed. +> > > > +> > > +> > > IIUC, updating mtime for a write is also an attribute change, and= + that +> > > affects ctime. According to the stat(2) manpage: +> > > +> > > =C2=A0 =C2=A0 =C2=A0 The field st_ctime is changed by writing or = +by setting +> > =C2=A0inode =C2=A0informa- +> > > =C2=A0 =C2=A0 =C2=A0 tion (i.e., owner, group, link count, mode, = +etc.). +> > > +> > > > Note that Ext4 appears to have a file creation time field in it= +s +> inode +> > > > (struct ext4_inode::i_crtime[_extra]). =C2=A0Can Samba be made = +to use +> that? +> > > > +> > > +> > > Is it exposed to userspace in any (standard) way? It would be han= +dy to +> > > have that. While we're wishing...it might also be nice to have a +> > > standard way to get at the i_generation from userspace too. +> > > +> > +> > Yes - I have talked with MingMing and Aneesh about those (NFS may +> > someday be able to use those too).=C2=A0 An obstacle in the past ha= +d been +> > that samba server stores its own fake creation time in an ndr encod= +ed +> > xattr which complicates things. +> > +> > MingMing/Annesh - +> > Xattr or other way to get at birth time? +> > +> > +>=20 +> Not yet, +> The ext4 file creation time only accesable from the kernel at the mo= +ment. +> There were discussion +> to make this information avaliable via xattr before, but was rejected= +, +> since most people +> agree that making this info avalibele via stat() is more standard. Ho= +wever +> modifying stat() would imply +> big interface change. thus no action has been taken yet. + +NFS ganesha pNFS also had a requirement for getting i_generation and +inode number in userspace. So may be we should now look at updating +stat or add a variant syscall that include i_generation and create time +in the return value + +-aneesh + + diff --git a/test/corpora/lkml/cur/1382298587.003318:2, b/test/corpora/lkml/cur/1382298587.003318:2, new file mode 100644 index 00000000..058d1477 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.003318:2, @@ -0,0 +1,66 @@ +From: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and + register them +Date: Sun, 27 Jun 2010 14:22:29 -0400 +Lines: 9 +Message-ID: <20100627182229.GA492@infradead.org> +References: <20100625125306.7f9b1966@tlielax.poochiereds.net> + <4C24A606.5040001@suse.de> + <1277220214-3597-1-git-send-email-sjayaraman@suse.de> + <9822.1277312573@redhat.com> + <22697.1277470549@redhat.com> + <18628.1277502398@redhat.com> + <20100625182651.36800d06@tlielax.poochiereds.net> + <AANLkTilOTrHLvLv4XWYZO6xCnYZgYT7gO2M-oKZ6VvqM@mail.gmail.com> + <OFB55E8EC7.E8DD23D5-ON8725774E.0004921E-8825774E.0004CC31@us.ibm.com> + <871vbscpce.fsf@linux.vnet.ibm.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: Mingming Cao <mcao-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + DENIEL Philippe <philippe.deniel-KCE40YydGKI@public.gmane.org>, + David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>, + Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>, + Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org, + Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +To: "Aneesh Kumar K. V" <aneesh.kumar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Sun Jun 27 20:22:46 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OSwVB-0005TI-SG + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Sun, 27 Jun 2010 20:22:46 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1752811Ab0F0SWo (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Sun, 27 Jun 2010 14:22:44 -0400 +Received: from bombadil.infradead.org ([18.85.46.34]:55433 "EHLO + bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752728Ab0F0SWn (ORCPT + <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); Sun, 27 Jun 2010 14:22:43 -0400 +Received: from hch by bombadil.infradead.org with local (Exim 4.72 #1 (Red Hat Linux)) + id 1OSwUv-00009z-9N; Sun, 27 Jun 2010 18:22:29 +0000 +Content-Disposition: inline +In-Reply-To: <871vbscpce.fsf-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> +User-Agent: Mutt/1.5.20 (2009-08-17) +X-SRS-Rewrite: SMTP reverse-path rewritten from <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> by bombadil.infradead.org + See http://www.infradead.org/rpr.html +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003358> + +On Sun, Jun 27, 2010 at 11:47:21PM +0530, Aneesh Kumar K. V wrote: +> NFS ganesha pNFS also had a requirement for getting i_generation and +> inode number in userspace. So may be we should now look at updating +> stat or add a variant syscall that include i_generation and create time +> in the return value + +What's missing in knfsd that you feel the sudden urge to move backwards +to a userspace nfsd (one with a horribly crappy codebase, too). + + + diff --git a/test/corpora/lkml/cur/1382298587.003486:2, b/test/corpora/lkml/cur/1382298587.003486:2, new file mode 100644 index 00000000..8831b450 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.003486:2, @@ -0,0 +1,89 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: Re: [RFC][PATCH 05/10] cifs: define superblock-level cache index + objects and register them +Date: Mon, 28 Jun 2010 18:23:13 +0530 +Lines: 48 +Message-ID: <4C289B39.4060901@suse.de> +References: <22746.1277470713@redhat.com> <4C24A4A0.90408@suse.de> <1277220206-3559-1-git-send-email-sjayaraman@suse.de> <yes> <9720.1277312290@redhat.com> <23204.1277472412@redhat.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Mon Jun 28 14:53:24 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OTDq0-00054Q-At + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Mon, 28 Jun 2010 14:53:24 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1754503Ab0F1MxX (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Mon, 28 Jun 2010 08:53:23 -0400 +Received: from cantor2.suse.de ([195.135.220.15]:48374 "EHLO mx2.suse.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1754456Ab0F1MxW (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Mon, 28 Jun 2010 08:53:22 -0400 +Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) + by mx2.suse.de (Postfix) with ESMTP id 7BDC18672B; + Mon, 28 Jun 2010 14:53:21 +0200 (CEST) +User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 +In-Reply-To: <23204.1277472412-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003530> + +On 06/25/2010 06:56 PM, David Howells wrote: +> David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: +> +>>>> validate the root directory of the share in some way? +>>> +>>> I don't know if there is a way to do this. +>> +>> Is there an inode number or something? Even the creation time might do. +> +> Looking in cifspdu.h, there are a number of things that it might be possible +> to use. +> +> (1) FILE_ALL_INFO: CreationTime, IndexNumber, IndexNumber1, FileName +> (assuming this isn't flattened to '\' or something for the root of a +> share. +> +> (2) FILE_UNIX_BASIC_INFO: DevMajor, DevMinor, UniqueId. +> +> (3) FILE_INFO_STANDARD: CreationDate, CreationTime. +> +> (4) FILE_INFO_BASIC: CreationTime. +> +> (5) FILE_DIRECTORY_INFO: FileIndex, CreationTime, FileName. +> +> (6) SEARCH_ID_FULL_DIR_INFO: FileIndex, CreationTime, UniqueId, FileName. +> +> (7) FILE_BOTH_DIRECTORY_INFO: FileIndex, CreationTime, ShortName, FileName. +> +> (8) OPEN_RSP_EXT: Fid, CreationTime, VolumeGUID, FileId. +> +> You may have to choose different sets of things, depending on what the server +> has on offer. Also, don't forget, if you can't work out whether a share is + +Did you mean we need to validate differently for different servers? + +I just did some testing and it looks like we could rely on CreationTime, +IndexNumber for validating with Windows servers (FileName is relative to +the mapped drive) and UniqueId for validating with Samba servers. I did +not test all possibilities (there could be more). + +> coherent or not from the above, you can always use LastWriteTime, ChangeTime +> and EndOfFile and just discard the whole subtree if they differ. +> + +Thanks, + +-- +Suresh Jayaraman + + diff --git a/test/corpora/lkml/cur/1382298587.004581:2, b/test/corpora/lkml/cur/1382298587.004581:2, new file mode 100644 index 00000000..732bfa09 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.004581:2, @@ -0,0 +1,92 @@ +From: Timur Tabi <timur.tabi@gmail.com> +Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Date: Wed, 30 Jun 2010 15:55:58 -0500 +Lines: 33 +Message-ID: <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> +References: <20100308191005.GE4324@amak.tundra.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: QUOTED-PRINTABLE +Cc: mporter@kernel.crashing.org, linux-kernel@vger.kernel.org, + linuxppc-dev@lists.ozlabs.org, thomas.moll@sysgo.com +To: Alexandre Bounine <abounine@tundra.com> +X-From: linux-kernel-owner@vger.kernel.org Wed Jun 30 22:56:40 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OU4Kl-0005Kf-V4 + for glk-linux-kernel-3@lo.gmane.org; Wed, 30 Jun 2010 22:56:40 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1756668Ab0F3U4b convert rfc822-to-quoted-printable (ORCPT + <rfc822;glk-linux-kernel-3@m.gmane.org>); + Wed, 30 Jun 2010 16:56:31 -0400 +Received: from mail-vw0-f46.google.com ([209.85.212.46]:41333 "EHLO + mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1753416Ab0F3U43 convert rfc822-to-8bit (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Wed, 30 Jun 2010 16:56:29 -0400 +Received: by vws5 with SMTP id 5so1449398vws.19 + for <linux-kernel@vger.kernel.org>; Wed, 30 Jun 2010 13:56:28 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:received:mime-version:received:in-reply-to + :references:from:date:message-id:subject:to:cc:content-type + :content-transfer-encoding; + bh=FTlit9cHTz/9rLGcvA5/pEZlzxAQ5x20v8HE5XYFwYM=; + b=NFbjnxZ4KwcjTy4tFh+BnhWPEGeYTw6z918yIouRaMmbEDph56xq26K9aTBokuYHqe + UgFjBn7XWcxvqJPyCetfsDRG+F3M2XwCq/DSCswSPtXSLsy8WKm7cMXVS3hjiO8sMZ97 + mRMGZkYBJHjWP+ulkBXiq6q7/OQuE8Dkl+rWM= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=mime-version:in-reply-to:references:from:date:message-id:subject:to + :cc:content-type:content-transfer-encoding; + b=r0N6AOAg+TSvY2kPQPahldj4iRU9oUoSLtHA7JXG2QU4CR9O5GBhxAtr2aY99qUPZd + tFS0ZWRAb9cmOgiZhTpNxsBjCJ/e/DQ1ccP5rZ/U40q1SJ1KwN92hqpOoppZ0tkqSB7/ + UlQtsvPSK7a0bYqufEmscfAi98w1+mfZIbK6U= +Received: by 10.220.161.203 with SMTP id s11mr5093041vcx.195.1277931388141; + Wed, 30 Jun 2010 13:56:28 -0700 (PDT) +Received: by 10.220.161.137 with HTTP; Wed, 30 Jun 2010 13:55:58 -0700 (PDT) +In-Reply-To: <20100308191005.GE4324@amak.tundra.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1004632> + +On Mon, Mar 8, 2010 at 2:10 PM, Alexandre Bounine <abounine@tundra.com>= + wrote: +> +> From: Alexandre Bounine <alexandre.bounine@idt.com> +> +> Add Machine Check exception handling into RapidIO port driver +> for Freescale SoCs (MPC85xx). +> +> Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> +> Tested-by: Thomas Moll <thomas.moll@sysgo.com> +=2E.. + +> +static int fsl_rio_mcheck_exception(struct pt_regs *regs) +> +{ +> + =A0 =A0 =A0 const struct exception_table_entry *entry =3D NULL; +> + =A0 =A0 =A0 unsigned long reason =3D (mfspr(SPRN_MCSR) & MCSR_MASK)= +; + +MCSR_MASK is not defined anywhere, so when I compile this code, I get t= +his: + + CC arch/powerpc/sysdev/fsl_rio.o +arch/powerpc/sysdev/fsl_rio.c: In function 'fsl_rio_mcheck_exception': +arch/powerpc/sysdev/fsl_rio.c:248: error: 'MCSR_MASK' undeclared +(first use in this function) +arch/powerpc/sysdev/fsl_rio.c:248: error: (Each undeclared identifier +is reported only once +arch/powerpc/sysdev/fsl_rio.c:248: error: for each function it appears = +in.) + +--=20 +Timur Tabi +Linux kernel developer at Freescale + + diff --git a/test/corpora/lkml/cur/1382298587.004582:2, b/test/corpora/lkml/cur/1382298587.004582:2, new file mode 100644 index 00000000..d149b721 --- /dev/null +++ b/test/corpora/lkml/cur/1382298587.004582:2, @@ -0,0 +1,68 @@ +From: Timur Tabi <timur.tabi@gmail.com> +Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Date: Wed, 30 Jun 2010 16:00:56 -0500 +Lines: 12 +Message-ID: <AANLkTinKbimKyLpvFD7KOvavshu_n8gRcp2BvEJj0XZQ@mail.gmail.com> +References: <20100308191005.GE4324@amak.tundra.com> <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1 +Cc: mporter@kernel.crashing.org, linux-kernel@vger.kernel.org, + linuxppc-dev@lists.ozlabs.org, thomas.moll@sysgo.com +To: Alexandre Bounine <abounine@tundra.com> +X-From: linux-kernel-owner@vger.kernel.org Wed Jun 30 23:01:37 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OU4PZ-0000HS-0T + for glk-linux-kernel-3@lo.gmane.org; Wed, 30 Jun 2010 23:01:37 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1755703Ab0F3VB2 (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Wed, 30 Jun 2010 17:01:28 -0400 +Received: from mail-vw0-f46.google.com ([209.85.212.46]:53141 "EHLO + mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751784Ab0F3VB1 (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Wed, 30 Jun 2010 17:01:27 -0400 +Received: by vws5 with SMTP id 5so1454517vws.19 + for <linux-kernel@vger.kernel.org>; Wed, 30 Jun 2010 14:01:26 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:received:mime-version:received:in-reply-to + :references:from:date:message-id:subject:to:cc:content-type; + bh=+BUKti+Oa03CrnVvRyT591FhcoxqR7S2rzZHtD6WSuY=; + b=O/b04HLJrmTE0aIq2mNCRznQrXxAAGHSMarHR5mrgYptmr68froM6UgmDqTZFLhNiH + BcT8g+AziiqSV1k/ckXjRyVR0s9Jdv4g2phMNtp8NStbPfOPpLDkUKTQadphOTonCfeK + e+ZrLBwh+FCoYNAOjvFioBKj6CxN2Oi5xIhPc= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=mime-version:in-reply-to:references:from:date:message-id:subject:to + :cc:content-type; + b=UcKGhJIXCTTcSvBWwGwLUefPONGygVPsUnTt4nDSl4udB8JKMyi0EghzzgNXUyq4Dz + UCxzZAyxzjvjgsgPS3kzPhSsWG2PRG66pC1OA68RJ5YVOjt55/yOz/yfTqXBVvRSq2fV + QNcKACYHSjkIZ7Uq7ZEW9bEGI5tTKdz++N2UA= +Received: by 10.220.124.73 with SMTP id t9mr5099129vcr.37.1277931686462; Wed, + 30 Jun 2010 14:01:26 -0700 (PDT) +Received: by 10.220.161.137 with HTTP; Wed, 30 Jun 2010 14:00:56 -0700 (PDT) +In-Reply-To: <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1004633> + +On Wed, Jun 30, 2010 at 3:55 PM, Timur Tabi <timur.tabi@gmail.com> wrote: + +> MCSR_MASK is not defined anywhere, so when I compile this code, I get this: + +Never mind. I see that it's been fixed already, and that the patch +that removed MCSR_MASK was posted around the same time that this patch +was posted. + + +-- +Timur Tabi +Linux kernel developer at Freescale + + diff --git a/test/corpora/lkml/cur/1382298770.001724:2, b/test/corpora/lkml/cur/1382298770.001724:2, new file mode 100644 index 00000000..69c794c7 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001724:2, @@ -0,0 +1,104 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: [RFC][PATCH 10/10] cifs: add mount option to enable local caching +Date: Tue, 22 Jun 2010 20:55:09 +0530 +Lines: 66 +Message-ID: <1277220309-3757-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 17:25:29 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OR5Ls-0004PS-BM + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 17:25:28 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1755015Ab0FVPZ1 (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 11:25:27 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:48639 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1754070Ab0FVPZ1 (ORCPT + <rfc822;groupwise-SJayaraman-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org:0:0>); + Tue, 22 Jun 2010 11:25:27 -0400 +X-Greylist: delayed 316 seconds by postgrey-1.27 at vger.kernel.org; Tue, 22 Jun 2010 11:25:26 EDT +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:25:11 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001750> + +Add a mount option 'fsc' to enable local caching on CIFS. + +As the cifs-utils (userspace) changes are not done yet, this patch enables +'fsc' by default to assist testing. + +Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +--- + fs/cifs/cifs_fs_sb.h | 1 + + fs/cifs/connect.c | 8 ++++++++ + 2 files changed, 9 insertions(+), 0 deletions(-) + +diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h +index 246a167..9e77145 100644 +--- a/fs/cifs/cifs_fs_sb.h ++++ b/fs/cifs/cifs_fs_sb.h +@@ -35,6 +35,7 @@ + #define CIFS_MOUNT_DYNPERM 0x1000 /* allow in-memory only mode setting */ + #define CIFS_MOUNT_NOPOSIXBRL 0x2000 /* mandatory not posix byte range lock */ + #define CIFS_MOUNT_NOSSYNC 0x4000 /* don't do slow SMBflush on every sync*/ ++#define CIFS_MOUNT_FSCACHE 0x8000 /* local caching enabled */ + + struct cifs_sb_info { + struct cifsTconInfo *tcon; /* primary mount */ +diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c +index 4844dbd..6c6ff3c 100644 +--- a/fs/cifs/connect.c ++++ b/fs/cifs/connect.c +@@ -98,6 +98,7 @@ struct smb_vol { + bool noblocksnd:1; + bool noautotune:1; + bool nostrictsync:1; /* do not force expensive SMBflush on every sync */ ++ bool fsc:1; /* enable fscache */ + unsigned int rsize; + unsigned int wsize; + bool sockopt_tcp_nodelay:1; +@@ -843,6 +844,9 @@ cifs_parse_mount_options(char *options, const char *devname, + /* default to using server inode numbers where available */ + vol->server_ino = 1; + ++ /* XXX: default to fsc for testing until mount.cifs pieces are done */ ++ vol->fsc = 1; ++ + if (!options) + return 1; + +@@ -1332,6 +1336,8 @@ cifs_parse_mount_options(char *options, const char *devname, + printk(KERN_WARNING "CIFS: Mount option noac not " + "supported. Instead set " + "/proc/fs/cifs/LookupCacheEnabled to 0\n"); ++ } else if (strnicmp(data, "fsc", 3) == 0) { ++ vol->fsc = true; + } else + printk(KERN_WARNING "CIFS: Unknown mount option %s\n", + data); +@@ -2405,6 +2411,8 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info, + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_GID; + if (pvolume_info->dynperm) + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM; ++ if (pvolume_info->fsc) ++ cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_FSCACHE; + if (pvolume_info->direct_io) { + cFYI(1, "mounting share using direct i/o"); + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; +-- +1.6.4.2 + + + diff --git a/test/corpora/lkml/cur/1382298770.001730:2, b/test/corpora/lkml/cur/1382298770.001730:2, new file mode 100644 index 00000000..840be2ee --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001730:2, @@ -0,0 +1,103 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: [RFC][PATCH 00/10] cifs: local caching support using FS-Cache +Date: Tue, 22 Jun 2010 20:50:05 +0530 +Lines: 66 +Message-ID: <1277220005-3322-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 17:40:38 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OR5aY-00055O-BD + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 17:40:38 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1751889Ab0FVPkf (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 11:40:35 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:50040 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751554Ab0FVPkf (ORCPT + <rfc822;groupwise-SJayaraman-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org:0:0>); + Tue, 22 Jun 2010 11:40:35 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:20:07 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001756> + +This patchset is a first stab at adding persistent, local caching facility for +CIFS using the FS-Cache interface. + +The index hierarchy which is mainly used to locate a file object or discard +a certain subset of the files cached, currently has three levels: + - Server + - Share + - File + +The server index object is keyed by hostname of the server. The superblock +index object is keyed by the sharename and the inode object is keyed by the +UniqueId. The cache coherency is ensured by checking the 'LastWriteTime' and +size of file. + +To use this, apply this patchset in order, mount the share with rsize=4096 and +try copying a huge file (say few hundred MBs) from mount point to local +filesystem. During the first time, the cache will be initialized. When you copy +the second time, it should read from the local cache. + +To reduce the impact of page cache and see the local caching in action +readily, try doing a sync and drop the caches by doing: + sync; echo 3 > /proc/sys/vm/drop_caches + +Known issues +------------- + - the cache coherency check may not be reliable always as some + CIFS servers are known not to update mtime until the filehandle is + closed. + - not all the Servers under all circumstances provide a unique + 'UniqueId'. + +Todo's +------- + - improvements to avoid potential key collisions + - address the above known issues + +This set is lightly tested and all the bugs seen during my testing have been +fixed. However, this can be considered as an RFC for now. + +Any Comments or Suggestions are welcome. + +Suresh Jayaraman (10) + cifs: add kernel config option for CIFS Client caching support + cifs: guard cifsglob.h against multiple inclusion + cifs: register CIFS for caching + cifs: define server-level cache index objects and register them with FS-Cache + cifs: define superblock-level cache index objects and register them + cifs: define inode-level cache object and register them + cifs: FS-Cache page management + cifs: store pages into local cache + cifs: read pages from FS-Cache + cifs: add mount option to enable local caching + + Kconfig | 9 ++ + Makefile | 2 + cache.c | 251 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + cifs_fs_sb.h | 1 + cifsfs.c | 15 +++ + cifsglob.h | 14 +++ + connect.c | 16 +++ + file.c | 51 +++++++++++ + fscache.c | 244 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + fscache.h | 135 +++++++++++++++++++++++++++++++ + inode.c | 4 + 11 files changed, 742 insertions(+) + + + diff --git a/test/corpora/lkml/cur/1382298770.001731:2, b/test/corpora/lkml/cur/1382298770.001731:2, new file mode 100644 index 00000000..d8b3168c --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001731:2, @@ -0,0 +1,67 @@ +From: Suresh Jayaraman <sjayaraman@suse.de> +Subject: [RFC][PATCH 01/10] cifs: add kernel config option for CIFS Client caching support +Date: Tue, 22 Jun 2010 20:52:38 +0530 +Lines: 30 +Message-ID: <1277220158-3405-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com> +To: Steve French <smfrench@gmail.com> +X-From: linux-kernel-owner@vger.kernel.org Tue Jun 22 17:43:27 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OR5dG-0007m9-Ij + for glk-linux-kernel-3@lo.gmane.org; Tue, 22 Jun 2010 17:43:26 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1751536Ab0FVPnS (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 22 Jun 2010 11:43:18 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:51303 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1750800Ab0FVPnR (ORCPT + <rfc822;groupwise-SJayaraman@novell.com:0:0>); + Tue, 22 Jun 2010 11:43:17 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:22:40 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001757> + +Add a kernel config option to enable local caching for CIFS. + +Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> +--- + fs/cifs/Kconfig | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +diff --git a/fs/cifs/Kconfig b/fs/cifs/Kconfig +index 80f3525..5739fd7 100644 +--- a/fs/cifs/Kconfig ++++ b/fs/cifs/Kconfig +@@ -131,6 +131,15 @@ config CIFS_DFS_UPCALL + IP addresses) which is needed for implicit mounts of DFS junction + points. If unsure, say N. + ++config CIFS_FSCACHE ++ bool "Provide CIFS client caching support (EXPERIMENTAL)" ++ depends on EXPERIMENTAL ++ depends on CIFS=m && FSCACHE || CIFS=y && FSCACHE=y ++ help ++ Makes CIFS FS-Cache capable. Say Y here if you want your CIFS data ++ to be cached locally on disk through the general filesystem cache ++ manager. If unsure, say N. ++ + config CIFS_EXPERIMENTAL + bool "CIFS Experimental Features (EXPERIMENTAL)" + depends on CIFS && EXPERIMENTAL +-- +1.6.4.2 + + + diff --git a/test/corpora/lkml/cur/1382298770.001732:2, b/test/corpora/lkml/cur/1382298770.001732:2, new file mode 100644 index 00000000..8850953a --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001732:2, @@ -0,0 +1,73 @@ +From: Suresh Jayaraman <sjayaraman@suse.de> +Subject: [RFC][PATCH 02/10] cifs: guard cifsglob.h against multiple inclusion +Date: Tue, 22 Jun 2010 20:52:50 +0530 +Lines: 36 +Message-ID: <1277220170-3442-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com> +To: Steve French <smfrench@gmail.com> +X-From: linux-fsdevel-owner@vger.kernel.org Tue Jun 22 17:43:39 2010 +Return-path: <linux-fsdevel-owner@vger.kernel.org> +Envelope-to: lnx-linux-fsdevel@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-fsdevel-owner@vger.kernel.org>) + id 1OR5dT-0007sB-18 + for lnx-linux-fsdevel@lo.gmane.org; Tue, 22 Jun 2010 17:43:39 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1752441Ab0FVPn3 (ORCPT <rfc822;lnx-linux-fsdevel@m.gmane.org>); + Tue, 22 Jun 2010 11:43:29 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:41538 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751889Ab0FVPn2 (ORCPT + <rfc822;groupwise-SJayaraman@novell.com:0:0>); + Tue, 22 Jun 2010 11:43:28 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:22:52 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-fsdevel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-fsdevel.vger.kernel.org> +X-Mailing-List: linux-fsdevel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001758> + +Add conditional compile macros to guard the header file against multiple +inclusion. + +Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> +--- + fs/cifs/cifsglob.h | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h +index a88479c..6b2c39d 100644 +--- a/fs/cifs/cifsglob.h ++++ b/fs/cifs/cifsglob.h +@@ -16,6 +16,9 @@ + * the GNU Lesser General Public License for more details. + * + */ ++#ifndef _CIFS_GLOB_H ++#define _CIFS_GLOB_H ++ + #include <linux/in.h> + #include <linux/in6.h> + #include <linux/slab.h> +@@ -733,3 +736,5 @@ GLOBAL_EXTERN unsigned int cifs_min_small; /* min size of small buf pool */ + GLOBAL_EXTERN unsigned int cifs_max_pending; /* MAX requests at once to server*/ + + extern const struct slow_work_ops cifs_oplock_break_ops; ++ ++#endif /* _CIFS_GLOB_H */ +-- +1.6.4.2 + +-- +To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298770.001733:2, b/test/corpora/lkml/cur/1382298770.001733:2, new file mode 100644 index 00000000..d782f90e --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001733:2, @@ -0,0 +1,211 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: [RFC][PATCH 03/10] cifs: register CIFS for caching +Date: Tue, 22 Jun 2010 20:53:09 +0530 +Lines: 174 +Message-ID: <1277220189-3485-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 17:43:52 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OR5de-0007xC-Ov + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 17:43:51 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1753125Ab0FVPnt (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 11:43:49 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:55866 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751261Ab0FVPnt (ORCPT + <rfc822;groupwise-SJayaraman-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org:0:0>); + Tue, 22 Jun 2010 11:43:49 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:23:11 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001759> + +Define CIFS for FS-Cache and register for caching. Upon registration the +top-level index object cookie will be stuck to the netfs definition by +FS-Cache. + +Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +--- + fs/cifs/Makefile | 2 ++ + fs/cifs/cache.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + fs/cifs/cifsfs.c | 8 ++++++++ + fs/cifs/fscache.h | 40 ++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 103 insertions(+), 0 deletions(-) + create mode 100644 fs/cifs/cache.c + create mode 100644 fs/cifs/fscache.h + +diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile +index 9948c00..e2de709 100644 +--- a/fs/cifs/Makefile ++++ b/fs/cifs/Makefile +@@ -11,3 +11,5 @@ cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \ + cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o + + cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o ++ ++cifs-$(CONFIG_CIFS_FSCACHE) += cache.o +diff --git a/fs/cifs/cache.c b/fs/cifs/cache.c +new file mode 100644 +index 0000000..1080b96 +--- /dev/null ++++ b/fs/cifs/cache.c +@@ -0,0 +1,53 @@ ++/* ++ * fs/cifs/cache.c - CIFS filesystem cache index structure definitions ++ * ++ * Copyright (c) 2010 Novell, Inc. ++ * Authors(s): Suresh Jayaraman (sjayaraman-l3A5Bk7waGM@public.gmane.org> ++ * ++ * This library is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as published ++ * by the Free Software Foundation; either version 2.1 of the License, or ++ * (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ++ * the GNU Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++#include <linux/init.h> ++#include <linux/kernel.h> ++#include <linux/sched.h> ++#include <linux/mm.h> ++ ++#include "fscache.h" ++#include "cifsglob.h" ++#include "cifs_debug.h" ++ ++/* ++ * CIFS filesystem definition for FS-Cache ++ */ ++struct fscache_netfs cifs_fscache_netfs = { ++ .name = "cifs", ++ .version = 0, ++}; ++ ++/* ++ * Register CIFS for caching with FS-Cache ++ */ ++int cifs_fscache_register(void) ++{ ++ return fscache_register_netfs(&cifs_fscache_netfs); ++} ++ ++/* ++ * Unregister CIFS for caching ++ */ ++void cifs_fscache_unregister(void) ++{ ++ fscache_unregister_netfs(&cifs_fscache_netfs); ++} ++ +diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c +index 484e52b..c2a7aa9 100644 +--- a/fs/cifs/cifsfs.c ++++ b/fs/cifs/cifsfs.c +@@ -47,6 +47,7 @@ + #include <linux/key-type.h> + #include "dns_resolve.h" + #include "cifs_spnego.h" ++#include "fscache.h" + #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ + + int cifsFYI = 0; +@@ -902,6 +903,10 @@ init_cifs(void) + cFYI(1, "cifs_max_pending set to max of 256"); + } + ++ rc = cifs_fscache_register(); ++ if (rc) ++ goto out; ++ + rc = cifs_init_inodecache(); + if (rc) + goto out_clean_proc; +@@ -949,8 +954,10 @@ init_cifs(void) + cifs_destroy_mids(); + out_destroy_inodecache: + cifs_destroy_inodecache(); ++ cifs_fscache_unregister(); + out_clean_proc: + cifs_proc_clean(); ++ out: + return rc; + } + +@@ -959,6 +966,7 @@ exit_cifs(void) + { + cFYI(DBG2, "exit_cifs"); + cifs_proc_clean(); ++ cifs_fscache_unregister(); + #ifdef CONFIG_CIFS_DFS_UPCALL + cifs_dfs_release_automount_timer(); + unregister_key_type(&key_type_dns_resolver); +diff --git a/fs/cifs/fscache.h b/fs/cifs/fscache.h +new file mode 100644 +index 0000000..cec9e2b +--- /dev/null ++++ b/fs/cifs/fscache.h +@@ -0,0 +1,40 @@ ++/* ++ * fs/cifs/fscache.h - CIFS filesystem cache interface definitions ++ * ++ * Copyright (c) 2010 Novell, Inc. ++ * Authors(s): Suresh Jayaraman (sjayaraman-l3A5Bk7waGM@public.gmane.org> ++ * ++ * This library is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as published ++ * by the Free Software Foundation; either version 2.1 of the License, or ++ * (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ++ * the GNU Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++#ifndef _CIFS_FSCACHE_H ++#define _CIFS_FSCACHE_H ++ ++#include <linux/fscache.h> ++#include "cifsglob.h" ++ ++#ifdef CONFIG_CIFS_FSCACHE ++ ++extern struct fscache_netfs cifs_fscache_netfs; ++ ++extern int cifs_fscache_register(void); ++extern void cifs_fscache_unregister(void); ++ ++#else /* CONFIG_CIFS_FSCACHE */ ++static inline int cifs_fscache_register(void) { return 0; } ++static inline void cifs_fscache_unregister(void) {} ++ ++#endif /* CONFIG_CIFS_FSCACHE */ ++ ++#endif /* _CIFS_FSCACHE_H */ +-- +1.6.4.2 + + + diff --git a/test/corpora/lkml/cur/1382298770.001734:2, b/test/corpora/lkml/cur/1382298770.001734:2, new file mode 100644 index 00000000..4b64bc3b --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001734:2, @@ -0,0 +1,223 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: [RFC][PATCH 04/10] cifs: define server-level cache index objects and register them with FS-Cache +Date: Tue, 22 Jun 2010 20:53:18 +0530 +Lines: 186 +Message-ID: <1277220198-3522-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 17:44:26 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OR5eD-0008G7-KP + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 17:44:26 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1753942Ab0FVPoC (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 11:44:02 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:58783 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751265Ab0FVPoA (ORCPT + <rfc822;groupwise-SJayaraman-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org:0:0>); + Tue, 22 Jun 2010 11:44:00 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:23:20 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001760> + +Define server-level cache index objects (as managed by TCP_ServerInfo structs). +Each server object is created in the CIFS top-level index object and is itself +an index into which superblock-level objects are inserted. + +Currently, the server objects are keyed by hostname. + +Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +--- + fs/cifs/Makefile | 2 +- + fs/cifs/cache.c | 25 +++++++++++++++++++++++++ + fs/cifs/cifsglob.h | 3 +++ + fs/cifs/connect.c | 4 ++++ + fs/cifs/fscache.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ + fs/cifs/fscache.h | 12 ++++++++++++ + 6 files changed, 92 insertions(+), 1 deletion(-) + create mode 100644 fs/cifs/fscache.c + +Index: cifs-2.6/fs/cifs/Makefile +=================================================================== +--- cifs-2.6.orig/fs/cifs/Makefile ++++ cifs-2.6/fs/cifs/Makefile +@@ -12,4 +12,4 @@ cifs-$(CONFIG_CIFS_UPCALL) += cifs_spneg + + cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o + +-cifs-$(CONFIG_CIFS_FSCACHE) += cache.o ++cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cache.o +Index: cifs-2.6/fs/cifs/cache.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/cache.c ++++ cifs-2.6/fs/cifs/cache.c +@@ -51,3 +51,28 @@ void cifs_fscache_unregister(void) + fscache_unregister_netfs(&cifs_fscache_netfs); + } + ++/* ++ * Server object currently keyed by hostname ++ */ ++static uint16_t cifs_server_get_key(const void *cookie_netfs_data, ++ void *buffer, uint16_t maxbuf) ++{ ++ const struct TCP_Server_Info *server = cookie_netfs_data; ++ uint16_t len = strnlen(server->hostname, sizeof(server->hostname)); ++ ++ if (len > maxbuf) ++ return 0; ++ ++ memcpy(buffer, server->hostname, len); ++ ++ return len; ++} ++ ++/* ++ * Server object for FS-Cache ++ */ ++const struct fscache_cookie_def cifs_fscache_server_index_def = { ++ .name = "CIFS.server", ++ .type = FSCACHE_COOKIE_TYPE_INDEX, ++ .get_key = cifs_server_get_key, ++}; +Index: cifs-2.6/fs/cifs/cifsglob.h +=================================================================== +--- cifs-2.6.orig/fs/cifs/cifsglob.h ++++ cifs-2.6/fs/cifs/cifsglob.h +@@ -193,6 +193,9 @@ struct TCP_Server_Info { + bool sec_mskerberos; /* supports legacy MS Kerberos */ + bool sec_kerberosu2u; /* supports U2U Kerberos */ + bool sec_ntlmssp; /* supports NTLMSSP */ ++#ifdef CONFIG_CIFS_FSCACHE ++ struct fscache_cookie *fscache; /* client index cache cookie */ ++#endif + }; + + /* +Index: cifs-2.6/fs/cifs/connect.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/connect.c ++++ cifs-2.6/fs/cifs/connect.c +@@ -48,6 +48,7 @@ + #include "nterr.h" + #include "rfc1002pdu.h" + #include "cn_cifs.h" ++#include "fscache.h" + + #define CIFS_PORT 445 + #define RFC1001_PORT 139 +@@ -1453,6 +1454,8 @@ cifs_put_tcp_session(struct TCP_Server_I + return; + } + ++ cifs_fscache_release_client_cookie(server); ++ + list_del_init(&server->tcp_ses_list); + write_unlock(&cifs_tcp_ses_lock); + +@@ -1572,6 +1575,7 @@ cifs_get_tcp_session(struct smb_vol *vol + goto out_err; + } + ++ cifs_fscache_get_client_cookie(tcp_ses); + /* thread spawned, put it on the list */ + write_lock(&cifs_tcp_ses_lock); + list_add(&tcp_ses->tcp_ses_list, &cifs_tcp_ses_list); +Index: cifs-2.6/fs/cifs/fscache.c +=================================================================== +--- /dev/null ++++ cifs-2.6/fs/cifs/fscache.c +@@ -0,0 +1,47 @@ ++/* ++ * fs/cifs/fscache.c - CIFS filesystem cache interface ++ * ++ * Copyright (c) 2010 Novell, Inc. ++ * Authors(s): Suresh Jayaraman (sjayaraman-l3A5Bk7waGM@public.gmane.org> ++ * ++ * This library is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as published ++ * by the Free Software Foundation; either version 2.1 of the License, or ++ * (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ++ * the GNU Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++#include <linux/init.h> ++#include <linux/kernel.h> ++#include <linux/sched.h> ++#include <linux/mm.h> ++#include <linux/in6.h> ++ ++#include "fscache.h" ++#include "cifsglob.h" ++#include "cifs_debug.h" ++ ++void cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) ++{ ++ server->fscache = ++ fscache_acquire_cookie(cifs_fscache_netfs.primary_index, ++ &cifs_fscache_server_index_def, server); ++ cFYI(1, "CIFS: get client cookie (0x%p/0x%p)\n", ++ server, server->fscache); ++} ++ ++void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server) ++{ ++ cFYI(1, "CIFS: release client cookie (0x%p/0x%p)\n", ++ server, server->fscache); ++ fscache_relinquish_cookie(server->fscache, 0); ++ server->fscache = NULL; ++} ++ +Index: cifs-2.6/fs/cifs/fscache.h +=================================================================== +--- cifs-2.6.orig/fs/cifs/fscache.h ++++ cifs-2.6/fs/cifs/fscache.h +@@ -27,14 +27,26 @@ + #ifdef CONFIG_CIFS_FSCACHE + + extern struct fscache_netfs cifs_fscache_netfs; ++extern const struct fscache_cookie_def cifs_fscache_server_index_def; + + extern int cifs_fscache_register(void); + extern void cifs_fscache_unregister(void); + ++/* ++ * fscache.c ++ */ ++extern void cifs_fscache_get_client_cookie(struct TCP_Server_Info *); ++extern void cifs_fscache_release_client_cookie(struct TCP_Server_Info *); ++ + #else /* CONFIG_CIFS_FSCACHE */ + static inline int cifs_fscache_register(void) { return 0; } + static inline void cifs_fscache_unregister(void) {} + ++static inline void ++cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) {} ++static inline void ++cifs_fscache_get_client_cookie(struct TCP_Server_Info *server); {} ++ + #endif /* CONFIG_CIFS_FSCACHE */ + + #endif /* _CIFS_FSCACHE_H */ + + diff --git a/test/corpora/lkml/cur/1382298770.001735:2, b/test/corpora/lkml/cur/1382298770.001735:2, new file mode 100644 index 00000000..d76da353 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001735:2, @@ -0,0 +1,212 @@ +From: Suresh Jayaraman <sjayaraman@suse.de> +Subject: [RFC][PATCH 07/10] cifs: FS-Cache page management +Date: Tue, 22 Jun 2010 20:53:48 +0530 +Lines: 175 +Message-ID: <1277220228-3635-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com> +To: Steve French <smfrench@gmail.com> +X-From: linux-kernel-owner@vger.kernel.org Tue Jun 22 17:44:27 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OR5eF-0008G7-BK + for glk-linux-kernel-3@lo.gmane.org; Tue, 22 Jun 2010 17:44:27 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1754757Ab0FVPoS (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 22 Jun 2010 11:44:18 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:54214 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752542Ab0FVPoB (ORCPT + <rfc822;groupwise-SJayaraman@novell.com:0:0>); + Tue, 22 Jun 2010 11:44:01 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:23:50 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001761> + +Takes care of invalidation and release of FS-Cache marked pages and also +invalidation of the FsCache page flag when the inode is removed. + +Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> +--- + fs/cifs/cache.c | 31 +++++++++++++++++++++++++++++++ + fs/cifs/file.c | 20 ++++++++++++++++++++ + fs/cifs/fscache.c | 26 ++++++++++++++++++++++++++ + fs/cifs/fscache.h | 16 ++++++++++++++++ + 4 files changed, 93 insertions(+), 0 deletions(-) + +diff --git a/fs/cifs/cache.c b/fs/cifs/cache.c +index b205424..3a733c1 100644 +--- a/fs/cifs/cache.c ++++ b/fs/cifs/cache.c +@@ -210,6 +210,36 @@ fscache_checkaux cifs_fscache_inode_check_aux(void *cookie_netfs_data, + return FSCACHE_CHECKAUX_OKAY; + } + ++static void cifs_fscache_inode_now_uncached(void *cookie_netfs_data) ++{ ++ struct cifsInodeInfo *cifsi = cookie_netfs_data; ++ struct pagevec pvec; ++ pgoff_t first; ++ int loop, nr_pages; ++ ++ pagevec_init(&pvec, 0); ++ first = 0; ++ ++ cFYI(1, "cifs inode 0x%p now uncached\n", cifsi); ++ ++ for (;;) { ++ nr_pages = pagevec_lookup(&pvec, ++ cifsi->vfs_inode.i_mapping, first, ++ PAGEVEC_SIZE - pagevec_count(&pvec)); ++ if (!nr_pages) ++ break; ++ ++ for (loop = 0; loop < nr_pages; loop++) ++ ClearPageFsCache(pvec.pages[loop]); ++ ++ first = pvec.pages[nr_pages - 1]->index + 1; ++ ++ pvec.nr = nr_pages; ++ pagevec_release(&pvec); ++ cond_resched(); ++ } ++} ++ + const struct fscache_cookie_def cifs_fscache_inode_object_def = { + .name = "CIFS.uniqueid", + .type = FSCACHE_COOKIE_TYPE_DATAFILE, +@@ -217,4 +247,5 @@ const struct fscache_cookie_def cifs_fscache_inode_object_def = { + .get_attr = cifs_fscache_inode_get_attr, + .get_aux = cifs_fscache_inode_get_aux, + .check_aux = cifs_fscache_inode_check_aux, ++ .now_uncached = cifs_fscache_inode_now_uncached, + }; +diff --git a/fs/cifs/file.c b/fs/cifs/file.c +index 55ecb55..786ec04 100644 +--- a/fs/cifs/file.c ++++ b/fs/cifs/file.c +@@ -2271,6 +2271,22 @@ out: + return rc; + } + ++static int cifs_release_page(struct page *page, gfp_t gfp) ++{ ++ if (PagePrivate(page)) ++ return 0; ++ ++ return cifs_fscache_release_page(page, gfp); ++} ++ ++static void cifs_invalidate_page(struct page *page, unsigned long offset) ++{ ++ struct cifsInodeInfo *cifsi = CIFS_I(page->mapping->host); ++ ++ if (offset == 0) ++ cifs_fscache_invalidate_page(page, &cifsi->vfs_inode); ++} ++ + static void + cifs_oplock_break(struct slow_work *work) + { +@@ -2344,6 +2360,8 @@ const struct address_space_operations cifs_addr_ops = { + .write_begin = cifs_write_begin, + .write_end = cifs_write_end, + .set_page_dirty = __set_page_dirty_nobuffers, ++ .releasepage = cifs_release_page, ++ .invalidatepage = cifs_invalidate_page, + /* .sync_page = cifs_sync_page, */ + /* .direct_IO = */ + }; +@@ -2360,6 +2378,8 @@ const struct address_space_operations cifs_addr_ops_smallbuf = { + .write_begin = cifs_write_begin, + .write_end = cifs_write_end, + .set_page_dirty = __set_page_dirty_nobuffers, ++ .releasepage = cifs_release_page, ++ .invalidatepage = cifs_invalidate_page, + /* .sync_page = cifs_sync_page, */ + /* .direct_IO = */ + }; +diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c +index ddfd355..c09d3b8 100644 +--- a/fs/cifs/fscache.c ++++ b/fs/cifs/fscache.c +@@ -130,3 +130,29 @@ void cifs_fscache_reset_inode_cookie(struct inode *inode) + } + } + ++int cifs_fscache_release_page(struct page *page, gfp_t gfp) ++{ ++ if (PageFsCache(page)) { ++ struct inode *inode = page->mapping->host; ++ struct cifsInodeInfo *cifsi = CIFS_I(inode); ++ ++ cFYI(1, "CIFS: fscache release page (0x%p/0x%p)\n", ++ cifsi->fscache, page); ++ if (!fscache_maybe_release_page(cifsi->fscache, page, gfp)) ++ return 0; ++ } ++ ++ return 1; ++} ++ ++void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode) ++{ ++ struct cifsInodeInfo *cifsi = CIFS_I(inode); ++ struct fscache_cookie *cookie = cifsi->fscache; ++ ++ cFYI(1, "CIFS: fscache invalidatepage (0x%p/0x%p/0x%p)\n", ++ cookie, page, cifsi); ++ fscache_wait_on_page_write(cookie, page); ++ fscache_uncache_page(cookie, page); ++} ++ +diff --git a/fs/cifs/fscache.h b/fs/cifs/fscache.h +index 836bb02..127cb0a 100644 +--- a/fs/cifs/fscache.h ++++ b/fs/cifs/fscache.h +@@ -47,6 +47,16 @@ extern void cifs_fscache_release_inode_cookie(struct inode *); + extern void cifs_fscache_set_inode_cookie(struct inode *, struct file *); + extern void cifs_fscache_reset_inode_cookie(struct inode *); + ++extern void __cifs_fscache_invalidate_page(struct page *, struct inode *); ++extern int cifs_fscache_release_page(struct page *page, gfp_t gfp); ++ ++static inline void cifs_fscache_invalidate_page(struct page *page, ++ struct inode *inode) ++{ ++ if (PageFsCache(page)) ++ __cifs_fscache_invalidate_page(page, inode); ++} ++ + #else /* CONFIG_CIFS_FSCACHE */ + static inline int cifs_fscache_register(void) { return 0; } + static inline void cifs_fscache_unregister(void) {} +@@ -63,7 +73,13 @@ static inline void cifs_fscache_release_inode_cookie(struct inode *inode) {} + static inline void cifs_fscache_set_inode_cookie(struct inode *inode, + struct file *filp) {} + static inline void cifs_fscache_reset_inode_cookie(struct inode *inode) {} ++static inline void cifs_fscache_release_page(struct page *page, gfp_t gfp) ++{ ++ return 1; /* May release page */ ++} + ++static inline int cifs_fscache_invalidate_page(struct page *page, ++ struct inode *) {} + + #endif /* CONFIG_CIFS_FSCACHE */ + +-- +1.6.4.2 + + + diff --git a/test/corpora/lkml/cur/1382298770.001736:2, b/test/corpora/lkml/cur/1382298770.001736:2, new file mode 100644 index 00000000..f972891b --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001736:2, @@ -0,0 +1,256 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: [RFC][PATCH 09/10] cifs: read pages from FS-Cache +Date: Tue, 22 Jun 2010 20:54:21 +0530 +Lines: 219 +Message-ID: <1277220261-3717-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 17:44:46 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OR5eX-0008O2-Q4 + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 17:44:46 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1752563Ab0FVPom (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 11:44:42 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:42741 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752542Ab0FVPok (ORCPT + <rfc822;groupwise-SJayaraman-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org:0:0>); + Tue, 22 Jun 2010 11:44:40 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:24:22 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001762> + +Read pages from a FS-Cache data storage object into a CIFS inode. + +Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +--- + fs/cifs/file.c | 19 ++++++++++++++ + fs/cifs/fscache.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + fs/cifs/fscache.h | 40 ++++++++++++++++++++++++++++- + 3 files changed, 131 insertions(+), 1 deletions(-) + +diff --git a/fs/cifs/file.c b/fs/cifs/file.c +index 39c1ce0..42d2f25 100644 +--- a/fs/cifs/file.c ++++ b/fs/cifs/file.c +@@ -1978,6 +1978,16 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, + cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); + pTcon = cifs_sb->tcon; + ++ /* ++ * Reads as many pages as possible from fscache. Returns -ENOBUFS ++ * immediately if the cookie is negative ++ */ ++ rc = cifs_readpages_from_fscache(mapping->host, mapping, page_list, ++ &num_pages); ++ cFYI(1, "CIFS: readpages_from_fscache returned %d\n", rc); ++ if (rc == 0) ++ goto read_complete; ++ + cFYI(DBG2, "rpages: num pages %d", num_pages); + for (i = 0; i < num_pages; ) { + unsigned contig_pages; +@@ -2090,6 +2100,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, + smb_read_data = NULL; + } + ++read_complete: + FreeXid(xid); + return rc; + } +@@ -2100,6 +2111,12 @@ static int cifs_readpage_worker(struct file *file, struct page *page, + char *read_data; + int rc; + ++ /* Is the page cached? */ ++ rc = cifs_readpage_from_fscache(file->f_path.dentry->d_inode, page); ++ cFYI(1, "CIFS: cifs_readpage_from_fscache returned %d\n", rc); ++ if (rc == 0) ++ goto read_complete; ++ + page_cache_get(page); + read_data = kmap(page); + /* for reads over a certain size could initiate async read ahead */ +@@ -2128,6 +2145,8 @@ static int cifs_readpage_worker(struct file *file, struct page *page, + io_error: + kunmap(page); + page_cache_release(page); ++ ++read_complete: + return rc; + } + +diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c +index 13e47d5..6813737 100644 +--- a/fs/cifs/fscache.c ++++ b/fs/cifs/fscache.c +@@ -145,6 +145,79 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp) + return 1; + } + ++static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx, ++ int error) ++{ ++ cFYI(1, "CFS: readpage_from_fscache_complete (0x%p/%d)\n", ++ page, error); ++ if (!error) ++ SetPageUptodate(page); ++ unlock_page(page); ++} ++ ++/* ++ * Retrieve a page from FS-Cache ++ */ ++int __cifs_readpage_from_fscache(struct inode *inode, struct page *page) ++{ ++ int ret; ++ ++ cFYI(1, "CIFS: readpage_from_fscache(fsc:%p, p:%p, i:0x%p\n", ++ CIFS_I(inode)->fscache, page, inode); ++ ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page, ++ cifs_readpage_from_fscache_complete, ++ NULL, ++ GFP_KERNEL); ++ switch (ret) { ++ ++ case 0: /* page found in fscache, read submitted */ ++ cFYI(1, "CIFS: readpage_from_fscache: submitted\n"); ++ return ret; ++ case -ENOBUFS: /* page won't be cached */ ++ case -ENODATA: /* page not in cache */ ++ cFYI(1, "CIFS: readpage_from_fscache %d\n", ret); ++ return 1; ++ ++ default: ++ cFYI(1, "unknown error ret = %d", ret); ++ } ++ return ret; ++} ++ ++/* ++ * Retrieve a set of pages from FS-Cache ++ */ ++int __cifs_readpages_from_fscache(struct inode *inode, ++ struct address_space *mapping, ++ struct list_head *pages, ++ unsigned *nr_pages) ++{ ++ int ret; ++ ++ cFYI(1, "CIFS: __cifs_readpages_from_fscache (0x%p/%u/0x%p)\n", ++ CIFS_I(inode)->fscache, *nr_pages, inode); ++ ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping, ++ pages, nr_pages, ++ cifs_readpage_from_fscache_complete, ++ NULL, ++ mapping_gfp_mask(mapping)); ++ switch (ret) { ++ case 0: /* read submitted to the cache for all pages */ ++ cFYI(1, "CIFS: readpages_from_fscache\n"); ++ return ret; ++ ++ case -ENOBUFS: /* some pages are not cached and can't be */ ++ case -ENODATA: /* some pages are not cached */ ++ cFYI(1, "CIFS: readpages_from_fscache: no page\n"); ++ return 1; ++ ++ default: ++ cFYI(1, "unknown error ret = %d", ret); ++ } ++ ++ return ret; ++} ++ + void __cifs_readpage_to_fscache(struct inode *inode, struct page *page) + { + int ret; +diff --git a/fs/cifs/fscache.h b/fs/cifs/fscache.h +index e34d8ab..03bd3fe 100644 +--- a/fs/cifs/fscache.h ++++ b/fs/cifs/fscache.h +@@ -31,7 +31,6 @@ extern const struct fscache_cookie_def cifs_fscache_server_index_def; + extern const struct fscache_cookie_def cifs_fscache_super_index_def; + extern const struct fscache_cookie_def cifs_fscache_inode_object_def; + +- + extern int cifs_fscache_register(void); + extern void cifs_fscache_unregister(void); + +@@ -49,6 +48,11 @@ extern void cifs_fscache_reset_inode_cookie(struct inode *); + + extern void __cifs_fscache_invalidate_page(struct page *, struct inode *); + extern int cifs_fscache_release_page(struct page *page, gfp_t gfp); ++extern int __cifs_readpage_from_fscache(struct inode *, struct page *); ++extern int __cifs_readpages_from_fscache(struct inode *, ++ struct address_space *, ++ struct list_head *, ++ unsigned *); + + extern void __cifs_readpage_to_fscache(struct inode *, struct page *); + +@@ -59,6 +63,26 @@ static inline void cifs_fscache_invalidate_page(struct page *page, + __cifs_fscache_invalidate_page(page, inode); + } + ++static inline int cifs_readpage_from_fscache(struct inode *inode, ++ struct page *page) ++{ ++ if (CIFS_I(inode)->fscache) ++ return __cifs_readpage_from_fscache(inode, page); ++ ++ return -ENOBUFS; ++} ++ ++static inline int cifs_readpages_from_fscache(struct inode *inode, ++ struct address_space *mapping, ++ struct list_head *pages, ++ unsigned *nr_pages) ++{ ++ if (CIFS_I(inode)->fscache) ++ return __cifs_readpages_from_fscache(inode, mapping, pages, ++ nr_pages); ++ return -ENOBUFS; ++} ++ + static inline void cifs_readpage_to_fscache(struct inode *inode, + struct page *page) + { +@@ -89,6 +113,20 @@ static inline void cifs_fscache_release_page(struct page *page, gfp_t gfp) + + static inline int cifs_fscache_invalidate_page(struct page *page, + struct inode *) {} ++static inline int ++cifs_readpage_from_fscache(struct inode *inode, struct page *page) ++{ ++ return -ENOBUFS; ++} ++ ++static inline int cifs_readpages_from_fscache(struct inode *inode, ++ struct address_space *mapping, ++ struct list_head *pages, ++ unsigned *nr_pages) ++{ ++ return -ENOBUFS; ++} ++ + static inline void cifs_readpage_to_fscache(struct inode *inode, + struct page *page) {} + +-- +1.6.4.2 + + + diff --git a/test/corpora/lkml/cur/1382298770.001738:2, b/test/corpora/lkml/cur/1382298770.001738:2, new file mode 100644 index 00000000..b1e0edfb --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001738:2, @@ -0,0 +1,139 @@ +From: Suresh Jayaraman <sjayaraman@suse.de> +Subject: [RFC][PATCH 08/10] cifs: store pages into local cache +Date: Tue, 22 Jun 2010 20:54:00 +0530 +Lines: 102 +Message-ID: <1277220240-3674-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com> +To: Steve French <smfrench@gmail.com> +X-From: linux-fsdevel-owner@vger.kernel.org Tue Jun 22 17:45:09 2010 +Return-path: <linux-fsdevel-owner@vger.kernel.org> +Envelope-to: lnx-linux-fsdevel@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-fsdevel-owner@vger.kernel.org>) + id 1OR5ev-00007O-6e + for lnx-linux-fsdevel@lo.gmane.org; Tue, 22 Jun 2010 17:45:09 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1755015Ab0FVPon (ORCPT <rfc822;lnx-linux-fsdevel@m.gmane.org>); + Tue, 22 Jun 2010 11:44:43 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:58250 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751265Ab0FVPok (ORCPT + <rfc822;groupwise-SJayaraman@novell.com:0:0>); + Tue, 22 Jun 2010 11:44:40 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:24:02 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-fsdevel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-fsdevel.vger.kernel.org> +X-Mailing-List: linux-fsdevel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001764> + +Store pages from an CIFS inode into the data storage object associated with +that inode. + +Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> +--- + fs/cifs/file.c | 6 ++++++ + fs/cifs/fscache.c | 13 +++++++++++++ + fs/cifs/fscache.h | 11 +++++++++++ + 3 files changed, 30 insertions(+), 0 deletions(-) + +diff --git a/fs/cifs/file.c b/fs/cifs/file.c +index 786ec04..39c1ce0 100644 +--- a/fs/cifs/file.c ++++ b/fs/cifs/file.c +@@ -2060,6 +2060,8 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, + we will hit it on next read */ + + /* break; */ ++ /* send this page to FS-Cache */ ++ cifs_readpage_to_fscache(mapping->host, page); + } + } else { + cFYI(1, "No bytes read (%d) at offset %lld . " +@@ -2117,6 +2119,10 @@ static int cifs_readpage_worker(struct file *file, struct page *page, + + flush_dcache_page(page); + SetPageUptodate(page); ++ ++ /* send this page to the cache */ ++ cifs_readpage_to_fscache(file->f_path.dentry->d_inode, page); ++ + rc = 0; + + io_error: +diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c +index c09d3b8..13e47d5 100644 +--- a/fs/cifs/fscache.c ++++ b/fs/cifs/fscache.c +@@ -145,6 +145,19 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp) + return 1; + } + ++void __cifs_readpage_to_fscache(struct inode *inode, struct page *page) ++{ ++ int ret; ++ ++ cFYI(1, "CIFS: readpage_to_fscache(fsc: %p, p: %p, i: %p\n", ++ CIFS_I(inode)->fscache, page, inode); ++ ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL); ++ cFYI(1, "CIFS: fscache_write_page returned %d\n", ret); ++ ++ if (ret != 0) ++ fscache_uncache_page(CIFS_I(inode)->fscache, page); ++} ++ + void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode) + { + struct cifsInodeInfo *cifsi = CIFS_I(inode); +diff --git a/fs/cifs/fscache.h b/fs/cifs/fscache.h +index 127cb0a..e34d8ab 100644 +--- a/fs/cifs/fscache.h ++++ b/fs/cifs/fscache.h +@@ -50,6 +50,8 @@ extern void cifs_fscache_reset_inode_cookie(struct inode *); + extern void __cifs_fscache_invalidate_page(struct page *, struct inode *); + extern int cifs_fscache_release_page(struct page *page, gfp_t gfp); + ++extern void __cifs_readpage_to_fscache(struct inode *, struct page *); ++ + static inline void cifs_fscache_invalidate_page(struct page *page, + struct inode *inode) + { +@@ -57,6 +59,13 @@ static inline void cifs_fscache_invalidate_page(struct page *page, + __cifs_fscache_invalidate_page(page, inode); + } + ++static inline void cifs_readpage_to_fscache(struct inode *inode, ++ struct page *page) ++{ ++ if (PageFsCache(page)) ++ __cifs_readpage_to_fscache(inode, page); ++} ++ + #else /* CONFIG_CIFS_FSCACHE */ + static inline int cifs_fscache_register(void) { return 0; } + static inline void cifs_fscache_unregister(void) {} +@@ -80,6 +89,8 @@ static inline void cifs_fscache_release_page(struct page *page, gfp_t gfp) + + static inline int cifs_fscache_invalidate_page(struct page *page, + struct inode *) {} ++static inline void cifs_readpage_to_fscache(struct inode *inode, ++ struct page *page) {} + + #endif /* CONFIG_CIFS_FSCACHE */ + +-- +1.6.4.2 + +-- +To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298770.001739:2, b/test/corpora/lkml/cur/1382298770.001739:2, new file mode 100644 index 00000000..d0abda0a --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001739:2, @@ -0,0 +1,355 @@ +From: Suresh Jayaraman <sjayaraman@suse.de> +Subject: [RFC][PATCH 06/10] cifs: define inode-level cache object and register them +Date: Tue, 22 Jun 2010 20:53:33 +0530 +Lines: 318 +Message-ID: <1277220214-3597-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com> +To: Steve French <smfrench@gmail.com> +X-From: linux-kernel-owner@vger.kernel.org Tue Jun 22 17:45:30 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OR5fF-0000Ka-Na + for glk-linux-kernel-3@lo.gmane.org; Tue, 22 Jun 2010 17:45:30 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1755952Ab0FVPpP (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 22 Jun 2010 11:45:15 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:59441 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751397Ab0FVPoA (ORCPT + <rfc822;groupwise-SJayaraman@novell.com:0:0>); + Tue, 22 Jun 2010 11:44:00 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:23:35 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001765> + +Define inode-level data storage objects (managed by cifsInodeInfo structs). +Each inode-level object is created in a super-block level object and is itself +a data storage object in to which pages from the inode are stored. + +The inode object is keyed by UniqueId. The coherency data being used is +LastWriteTime and the file size. + +Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> +--- + fs/cifs/cache.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + fs/cifs/cifsfs.c | 7 ++++ + fs/cifs/cifsglob.h | 3 + + fs/cifs/file.c | 6 +++ + fs/cifs/fscache.c | 68 +++++++++++++++++++++++++++++++++++++++++++++ + fs/cifs/fscache.h | 12 +++++++ + fs/cifs/inode.c | 4 ++ + 7 files changed, 180 insertions(+) + +Index: cifs-2.6/fs/cifs/cache.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/cache.c ++++ cifs-2.6/fs/cifs/cache.c +@@ -138,3 +138,83 @@ const struct fscache_cookie_def cifs_fsc + .get_key = cifs_super_get_key, + }; + ++/* ++ * Auxiliary data attached to CIFS inode within the cache ++ */ ++struct cifs_fscache_inode_auxdata { ++ struct timespec last_write_time; ++ loff_t size; ++}; ++ ++static uint16_t cifs_fscache_inode_get_key(const void *cookie_netfs_data, ++ void *buffer, uint16_t maxbuf) ++{ ++ const struct cifsInodeInfo *cifsi = cookie_netfs_data; ++ uint16_t keylen; ++ ++ /* use the UniqueId as the key */ ++ keylen = sizeof(cifsi->uniqueid); ++ if (keylen > maxbuf) ++ keylen = 0; ++ else ++ memcpy(buffer, &cifsi->uniqueid, keylen); ++ ++ return keylen; ++} ++ ++static void ++cifs_fscache_inode_get_attr(const void *cookie_netfs_data, uint64_t *size) ++{ ++ const struct cifsInodeInfo *cifsi = cookie_netfs_data; ++ ++ *size = cifsi->vfs_inode.i_size; ++} ++ ++static uint16_t ++cifs_fscache_inode_get_aux(const void *cookie_netfs_data, void *buffer, ++ uint16_t maxbuf) ++{ ++ struct cifs_fscache_inode_auxdata auxdata; ++ const struct cifsInodeInfo *cifsi = cookie_netfs_data; ++ ++ memset(&auxdata, 0, sizeof(auxdata)); ++ auxdata.size = cifsi->vfs_inode.i_size; ++ auxdata.last_write_time = cifsi->vfs_inode.i_ctime; ++ ++ if (maxbuf > sizeof(auxdata)) ++ maxbuf = sizeof(auxdata); ++ ++ memcpy(buffer, &auxdata, maxbuf); ++ ++ return maxbuf; ++} ++ ++static enum ++fscache_checkaux cifs_fscache_inode_check_aux(void *cookie_netfs_data, ++ const void *data, ++ uint16_t datalen) ++{ ++ struct cifs_fscache_inode_auxdata auxdata; ++ struct cifsInodeInfo *cifsi = cookie_netfs_data; ++ ++ if (datalen != sizeof(auxdata)) ++ return FSCACHE_CHECKAUX_OBSOLETE; ++ ++ memset(&auxdata, 0, sizeof(auxdata)); ++ auxdata.size = cifsi->vfs_inode.i_size; ++ auxdata.last_write_time = cifsi->vfs_inode.i_ctime; ++ ++ if (memcmp(data, &auxdata, datalen) != 0) ++ return FSCACHE_CHECKAUX_OBSOLETE; ++ ++ return FSCACHE_CHECKAUX_OKAY; ++} ++ ++const struct fscache_cookie_def cifs_fscache_inode_object_def = { ++ .name = "CIFS.uniqueid", ++ .type = FSCACHE_COOKIE_TYPE_DATAFILE, ++ .get_key = cifs_fscache_inode_get_key, ++ .get_attr = cifs_fscache_inode_get_attr, ++ .get_aux = cifs_fscache_inode_get_aux, ++ .check_aux = cifs_fscache_inode_check_aux, ++}; +Index: cifs-2.6/fs/cifs/cifsfs.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/cifsfs.c ++++ cifs-2.6/fs/cifs/cifsfs.c +@@ -330,6 +330,12 @@ cifs_destroy_inode(struct inode *inode) + } + + static void ++cifs_clear_inode(struct inode *inode) ++{ ++ cifs_fscache_release_inode_cookie(inode); ++} ++ ++static void + cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server) + { + seq_printf(s, ",addr="); +@@ -490,6 +496,7 @@ static const struct super_operations cif + .alloc_inode = cifs_alloc_inode, + .destroy_inode = cifs_destroy_inode, + .drop_inode = cifs_drop_inode, ++ .clear_inode = cifs_clear_inode, + /* .delete_inode = cifs_delete_inode, */ /* Do not need above + function unless later we add lazy close of inodes or unless the + kernel forgets to call us with the same number of releases (closes) +Index: cifs-2.6/fs/cifs/cifsglob.h +=================================================================== +--- cifs-2.6.orig/fs/cifs/cifsglob.h ++++ cifs-2.6/fs/cifs/cifsglob.h +@@ -407,6 +407,9 @@ struct cifsInodeInfo { + bool invalid_mapping:1; /* pagecache is invalid */ + u64 server_eof; /* current file size on server */ + u64 uniqueid; /* server inode number */ ++#ifdef CONFIG_CIFS_FSCACHE ++ struct fscache_cookie *fscache; ++#endif + struct inode vfs_inode; + }; + +Index: cifs-2.6/fs/cifs/file.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/file.c ++++ cifs-2.6/fs/cifs/file.c +@@ -40,6 +40,7 @@ + #include "cifs_unicode.h" + #include "cifs_debug.h" + #include "cifs_fs_sb.h" ++#include "fscache.h" + + static inline int cifs_convert_flags(unsigned int flags) + { +@@ -282,6 +283,9 @@ int cifs_open(struct inode *inode, struc + CIFSSMBClose(xid, tcon, netfid); + rc = -ENOMEM; + } ++ ++ cifs_fscache_set_inode_cookie(inode, file); ++ + goto out; + } else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { + if (tcon->ses->serverNOS) +@@ -373,6 +377,8 @@ int cifs_open(struct inode *inode, struc + goto out; + } + ++ cifs_fscache_set_inode_cookie(inode, file); ++ + if (oplock & CIFS_CREATE_ACTION) { + /* time to set mode which we can not set earlier due to + problems creating new read-only files */ +Index: cifs-2.6/fs/cifs/fscache.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/fscache.c ++++ cifs-2.6/fs/cifs/fscache.c +@@ -62,3 +62,71 @@ void cifs_fscache_release_super_cookie(s + tcon->fscache = NULL; + } + ++static void cifs_fscache_enable_inode_cookie(struct inode *inode) ++{ ++ struct cifsInodeInfo *cifsi = CIFS_I(inode); ++ struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); ++ ++ if (cifsi->fscache) ++ return; ++ ++ cifsi->fscache = fscache_acquire_cookie(cifs_sb->tcon->fscache, ++ &cifs_fscache_inode_object_def, ++ cifsi); ++ cFYI(1, "CIFS: got FH cookie (0x%p/0x%p/0x%p)\n", ++ cifs_sb->tcon, cifsi, cifsi->fscache); ++} ++ ++void cifs_fscache_release_inode_cookie(struct inode *inode) ++{ ++ struct cifsInodeInfo *cifsi = CIFS_I(inode); ++ ++ if (cifsi->fscache) { ++ cFYI(1, "CIFS releasing inode cookie (0x%p/0x%p)\n", ++ cifsi, cifsi->fscache); ++ fscache_relinquish_cookie(cifsi->fscache, 0); ++ cifsi->fscache = NULL; ++ } ++} ++ ++static void cifs_fscache_disable_inode_cookie(struct inode *inode) ++{ ++ struct cifsInodeInfo *cifsi = CIFS_I(inode); ++ ++ if (cifsi->fscache) { ++ cFYI(1, "CIFS disabling inode cookie (0x%p/0x%p)\n", ++ cifsi, cifsi->fscache); ++ fscache_relinquish_cookie(cifsi->fscache, 1); ++ cifsi->fscache = NULL; ++ } ++} ++ ++void cifs_fscache_set_inode_cookie(struct inode *inode, struct file *filp) ++{ ++ /* BB: parallel opens - need locking? */ ++ if ((filp->f_flags & O_ACCMODE) != O_RDONLY) ++ cifs_fscache_disable_inode_cookie(inode); ++ else { ++ cifs_fscache_enable_inode_cookie(inode); ++ cFYI(1, "CIFS: fscache inode cookie set\n"); ++ } ++} ++ ++void cifs_fscache_reset_inode_cookie(struct inode *inode) ++{ ++ struct cifsInodeInfo *cifsi = CIFS_I(inode); ++ struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); ++ struct fscache_cookie *old = cifsi->fscache; ++ ++ if (cifsi->fscache) { ++ /* retire the current fscache cache and get a new one */ ++ fscache_relinquish_cookie(cifsi->fscache, 1); ++ ++ cifsi->fscache = fscache_acquire_cookie(cifs_sb->tcon->fscache, ++ &cifs_fscache_inode_object_def, ++ cifsi); ++ cFYI(1, "CIFS: new cookie (0x%p/0x%p) oldcookie 0x%p\n", ++ cifsi, cifsi->fscache, old); ++ } ++} ++ +Index: cifs-2.6/fs/cifs/fscache.h +=================================================================== +--- cifs-2.6.orig/fs/cifs/fscache.h ++++ cifs-2.6/fs/cifs/fscache.h +@@ -29,6 +29,8 @@ + extern struct fscache_netfs cifs_fscache_netfs; + extern const struct fscache_cookie_def cifs_fscache_server_index_def; + extern const struct fscache_cookie_def cifs_fscache_super_index_def; ++extern const struct fscache_cookie_def cifs_fscache_inode_object_def; ++ + + extern int cifs_fscache_register(void); + extern void cifs_fscache_unregister(void); +@@ -41,6 +43,10 @@ extern void cifs_fscache_release_client_ + extern void cifs_fscache_get_super_cookie(struct cifsTconInfo *); + extern void cifs_fscache_release_super_cookie(struct cifsTconInfo *); + ++extern void cifs_fscache_release_inode_cookie(struct inode *); ++extern void cifs_fscache_set_inode_cookie(struct inode *, struct file *); ++extern void cifs_fscache_reset_inode_cookie(struct inode *); ++ + #else /* CONFIG_CIFS_FSCACHE */ + static inline int cifs_fscache_register(void) { return 0; } + static inline void cifs_fscache_unregister(void) {} +@@ -53,6 +59,12 @@ static inline void cifs_fscache_get_supe + static inline void + cifs_fscache_release_super_cookie(struct cifsTconInfo *tcon) {} + ++static inline void cifs_fscache_release_inode_cookie(struct inode *inode) {} ++static inline void cifs_fscache_set_inode_cookie(struct inode *inode, ++ struct file *filp) {} ++static inline void cifs_fscache_reset_inode_cookie(struct inode *inode) {} ++ ++ + #endif /* CONFIG_CIFS_FSCACHE */ + + #endif /* _CIFS_FSCACHE_H */ +Index: cifs-2.6/fs/cifs/inode.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/inode.c ++++ cifs-2.6/fs/cifs/inode.c +@@ -29,6 +29,7 @@ + #include "cifsproto.h" + #include "cifs_debug.h" + #include "cifs_fs_sb.h" ++#include "fscache.h" + + + static void cifs_set_ops(struct inode *inode, const bool is_dfs_referral) +@@ -776,6 +777,8 @@ retry_iget5_locked: + inode->i_flags |= S_NOATIME | S_NOCMTIME; + if (inode->i_state & I_NEW) { + inode->i_ino = hash; ++ /* initialize per-inode cache cookie pointer */ ++ CIFS_I(inode)->fscache = NULL; + unlock_new_inode(inode); + } + } +@@ -1568,6 +1571,7 @@ cifs_invalidate_mapping(struct inode *in + cifs_i->write_behind_rc = rc; + } + invalidate_remote_inode(inode); ++ cifs_fscache_reset_inode_cookie(inode); + } + + int cifs_revalidate_file(struct file *filp) + + diff --git a/test/corpora/lkml/cur/1382298770.001740:2, b/test/corpora/lkml/cur/1382298770.001740:2, new file mode 100644 index 00000000..ef0f657b --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001740:2, @@ -0,0 +1,214 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: [RFC][PATCH 05/10] cifs: define superblock-level cache index objects and register them +Date: Tue, 22 Jun 2010 20:53:26 +0530 +Lines: 177 +Message-ID: <1277220206-3559-1-git-send-email-sjayaraman@suse.de> +References: <yes> +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 17:45:50 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OR5fZ-0000Vj-Mj + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 17:45:50 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1752511Ab0FVPpJ (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 11:45:09 -0400 +Received: from victor.provo.novell.com ([137.65.250.26]:56189 "EHLO + victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752441Ab0FVPoA (ORCPT + <rfc822;groupwise-SJayaraman-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org:0:0>); + Tue, 22 Jun 2010 11:44:00 -0400 +Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) + by victor.provo.novell.com with ESMTP; Tue, 22 Jun 2010 09:23:29 -0600 +X-Mailer: git-send-email 1.6.4.2 +In-Reply-To: <yes> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001766> + +Define superblock-level cache index objects (managed by cifsTconInfo structs). +Each superblock object is created in a server-level index object and in itself +an index into which inode-level objects are inserted. + +Currently, the superblock objects are keyed by sharename. + +Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +--- + fs/cifs/cache.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + fs/cifs/cifsglob.h | 3 ++ + fs/cifs/connect.c | 4 +++ + fs/cifs/fscache.c | 17 ++++++++++++++ + fs/cifs/fscache.h | 6 +++++ + 5 files changed, 92 insertions(+) + +Index: cifs-2.6/fs/cifs/cache.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/cache.c ++++ cifs-2.6/fs/cifs/cache.c +@@ -76,3 +76,65 @@ const struct fscache_cookie_def cifs_fsc + .type = FSCACHE_COOKIE_TYPE_INDEX, + .get_key = cifs_server_get_key, + }; ++ ++static char *extract_sharename(const char *treename) ++{ ++ const char *src; ++ char *delim, *dst; ++ int len; ++ ++ /* skip double chars at the beginning */ ++ src = treename + 2; ++ ++ /* share name is always preceded by '\\' now */ ++ delim = strchr(src, '\\'); ++ if (!delim) ++ return ERR_PTR(-EINVAL); ++ delim++; ++ len = strlen(delim); ++ ++ /* caller has to free the memory */ ++ dst = kstrndup(delim, len, GFP_KERNEL); ++ if (!dst) ++ return ERR_PTR(-ENOMEM); ++ ++ return dst; ++} ++ ++/* ++ * Superblock object currently keyed by share name ++ */ ++static uint16_t cifs_super_get_key(const void *cookie_netfs_data, void *buffer, ++ uint16_t maxbuf) ++{ ++ const struct cifsTconInfo *tcon = cookie_netfs_data; ++ char *sharename; ++ uint16_t len; ++ ++ sharename = extract_sharename(tcon->treeName); ++ if (IS_ERR(sharename)) { ++ cFYI(1, "CIFS: couldn't extract sharename\n"); ++ sharename = NULL; ++ return 0; ++ } ++ ++ len = strlen(sharename); ++ if (len > maxbuf) ++ return 0; ++ ++ memcpy(buffer, sharename, len); ++ ++ kfree(sharename); ++ ++ return len; ++} ++ ++/* ++ * Superblock object for FS-Cache ++ */ ++const struct fscache_cookie_def cifs_fscache_super_index_def = { ++ .name = "CIFS.super", ++ .type = FSCACHE_COOKIE_TYPE_INDEX, ++ .get_key = cifs_super_get_key, ++}; ++ +Index: cifs-2.6/fs/cifs/cifsglob.h +=================================================================== +--- cifs-2.6.orig/fs/cifs/cifsglob.h ++++ cifs-2.6/fs/cifs/cifsglob.h +@@ -317,6 +317,9 @@ struct cifsTconInfo { + bool local_lease:1; /* check leases (only) on local system not remote */ + bool broken_posix_open; /* e.g. Samba server versions < 3.3.2, 3.2.9 */ + bool need_reconnect:1; /* connection reset, tid now invalid */ ++#ifdef CONFIG_CIFS_FSCACHE ++ struct fscache_cookie *fscache; /* cookie for share */ ++#endif + /* BB add field for back pointer to sb struct(s)? */ + }; + +Index: cifs-2.6/fs/cifs/connect.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/connect.c ++++ cifs-2.6/fs/cifs/connect.c +@@ -1773,6 +1773,8 @@ cifs_put_tcon(struct cifsTconInfo *tcon) + list_del_init(&tcon->tcon_list); + write_unlock(&cifs_tcp_ses_lock); + ++ cifs_fscache_release_super_cookie(tcon); ++ + xid = GetXid(); + CIFSSMBTDis(xid, tcon); + _FreeXid(xid); +@@ -1843,6 +1845,8 @@ cifs_get_tcon(struct cifsSesInfo *ses, s + tcon->nocase = volume_info->nocase; + tcon->local_lease = volume_info->local_lease; + ++ cifs_fscache_get_super_cookie(tcon); ++ + write_lock(&cifs_tcp_ses_lock); + list_add(&tcon->tcon_list, &ses->tcon_list); + write_unlock(&cifs_tcp_ses_lock); +Index: cifs-2.6/fs/cifs/fscache.c +=================================================================== +--- cifs-2.6.orig/fs/cifs/fscache.c ++++ cifs-2.6/fs/cifs/fscache.c +@@ -45,3 +45,20 @@ void cifs_fscache_release_client_cookie( + server->fscache = NULL; + } + ++void cifs_fscache_get_super_cookie(struct cifsTconInfo *tcon) ++{ ++ tcon->fscache = ++ fscache_acquire_cookie(tcon->ses->server->fscache, ++ &cifs_fscache_super_index_def, tcon); ++ cFYI(1, "CIFS: get superblock cookie (0x%p/0x%p)\n", ++ tcon, tcon->fscache); ++} ++ ++void cifs_fscache_release_super_cookie(struct cifsTconInfo *tcon) ++{ ++ cFYI(1, "CIFS: releasing superblock cookie (0x%p/0x%p)\n", ++ tcon, tcon->fscache); ++ fscache_relinquish_cookie(tcon->fscache, 0); ++ tcon->fscache = NULL; ++} ++ +Index: cifs-2.6/fs/cifs/fscache.h +=================================================================== +--- cifs-2.6.orig/fs/cifs/fscache.h ++++ cifs-2.6/fs/cifs/fscache.h +@@ -28,6 +28,7 @@ + + extern struct fscache_netfs cifs_fscache_netfs; + extern const struct fscache_cookie_def cifs_fscache_server_index_def; ++extern const struct fscache_cookie_def cifs_fscache_super_index_def; + + extern int cifs_fscache_register(void); + extern void cifs_fscache_unregister(void); +@@ -37,6 +38,8 @@ extern void cifs_fscache_unregister(void + */ + extern void cifs_fscache_get_client_cookie(struct TCP_Server_Info *); + extern void cifs_fscache_release_client_cookie(struct TCP_Server_Info *); ++extern void cifs_fscache_get_super_cookie(struct cifsTconInfo *); ++extern void cifs_fscache_release_super_cookie(struct cifsTconInfo *); + + #else /* CONFIG_CIFS_FSCACHE */ + static inline int cifs_fscache_register(void) { return 0; } +@@ -46,6 +49,9 @@ static inline void + cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) {} + static inline void + cifs_fscache_get_client_cookie(struct TCP_Server_Info *server); {} ++static inline void cifs_fscache_get_super_cookie(struct cifsTconInfo *tcon) {} ++static inline void ++cifs_fscache_release_super_cookie(struct cifsTconInfo *tcon) {} + + #endif /* CONFIG_CIFS_FSCACHE */ + + + diff --git a/test/corpora/lkml/cur/1382298770.001887:2, b/test/corpora/lkml/cur/1382298770.001887:2, new file mode 100644 index 00000000..81290484 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001887:2, @@ -0,0 +1,85 @@ +From: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> +Subject: Re: [RFC][PATCH 02/10] cifs: guard cifsglob.h against multiple + inclusion +Date: Tue, 22 Jun 2010 17:37:42 -0400 +Lines: 35 +Message-ID: <20100622173742.448e1e94@corrin.poochiereds.net> +References: <yes> + <1277220170-3442-1-git-send-email-sjayaraman@suse.de> +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 23:36:08 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORB8Z-00027v-R8 + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 23:36:08 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1751663Ab0FVVfq (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 17:35:46 -0400 +Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.121]:46190 "EHLO + cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751933Ab0FVVfo (ORCPT + <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); Tue, 22 Jun 2010 17:35:44 -0400 +X-Authority-Analysis: v=1.0 c=1 a=Y4kVDsoNLLAA:10 a=yQWWgrYGNuUA:10 a=kj9zAlcOel0A:10 a=hGzw-44bAAAA:8 a=6UT2YofcClCzWf3PPoQA:9 a=Ipo6nwFRv7ENfF13HvmH_iG48b8A:4 a=CjuIK1q_8ugA:10 a=0kPLrQdw3YYA:10 a=dowx1zmaLagA:10 +X-Cloudmark-Score: 0 +X-Originating-IP: 71.70.153.3 +Received: from [71.70.153.3] ([71.70.153.3:49036] helo=mail.poochiereds.net) + by cdptpa-oedge01.mail.rr.com (envelope-from <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>) + (ecelerity 2.2.2.39 r()) with ESMTP + id 29/22-24471-DAC212C4; Tue, 22 Jun 2010 21:35:42 +0000 +Received: from corrin.poochiereds.net (unknown [65.88.2.5]) + by mail.poochiereds.net (Postfix) with ESMTPSA id 1C5A1580F4; + Tue, 22 Jun 2010 17:35:41 -0400 (EDT) +In-Reply-To: <1277220170-3442-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-redhat-linux-gnu) +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001913> + +On Tue, 22 Jun 2010 20:52:50 +0530 +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> Add conditional compile macros to guard the header file against multiple +> inclusion. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +> --- +> fs/cifs/cifsglob.h | 5 +++++ +> 1 files changed, 5 insertions(+), 0 deletions(-) +> +> diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h +> index a88479c..6b2c39d 100644 +> --- a/fs/cifs/cifsglob.h +> +++ b/fs/cifs/cifsglob.h +> @@ -16,6 +16,9 @@ +> * the GNU Lesser General Public License for more details. +> * +> */ +> +#ifndef _CIFS_GLOB_H +> +#define _CIFS_GLOB_H +> + +> #include <linux/in.h> +> #include <linux/in6.h> +> #include <linux/slab.h> +> @@ -733,3 +736,5 @@ GLOBAL_EXTERN unsigned int cifs_min_small; /* min size of small buf pool */ +> GLOBAL_EXTERN unsigned int cifs_max_pending; /* MAX requests at once to server*/ +> +> extern const struct slow_work_ops cifs_oplock_break_ops; +> + +> +#endif /* _CIFS_GLOB_H */ + +Strong ACK + +Acked-by: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> + + diff --git a/test/corpora/lkml/cur/1382298770.001892:2, b/test/corpora/lkml/cur/1382298770.001892:2, new file mode 100644 index 00000000..82603bf1 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.001892:2, @@ -0,0 +1,254 @@ +From: Jeff Layton <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org> +Subject: Re: [RFC][PATCH 04/10] cifs: define server-level cache index + objects and register them with FS-Cache +Date: Tue, 22 Jun 2010 17:52:14 -0400 +Lines: 204 +Message-ID: <20100622175214.4c56234f@corrin.poochiereds.net> +References: <yes> + <1277220198-3522-1-git-send-email-sjayaraman@suse.de> +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Tue Jun 22 23:50:23 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORBMJ-0005WJ-Lj + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Tue, 22 Jun 2010 23:50:20 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1750777Ab0FVVuS (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Tue, 22 Jun 2010 17:50:18 -0400 +Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:55670 "EHLO + cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1750749Ab0FVVuR (ORCPT + <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); Tue, 22 Jun 2010 17:50:17 -0400 +X-Authority-Analysis: v=1.1 cv=8MuG1bpxLlSbaYWWtODGdBCK7StbFcRsMXhWm1NVx/I= c=1 sm=0 a=wpY4Lvx3kJcA:10 a=UBIxAjGgU1YA:10 a=kj9zAlcOel0A:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=VwQbUJbxAAAA:8 a=qYub2k57AAAA:8 a=uYIlwBZcjrF9BUCsR4kA:9 a=OO1ZLbZb6q4TPdC5pcAA:7 a=jFshslHAf8hJVDYUYRlYN4n-w5YA:4 a=CjuIK1q_8ugA:10 a=x8gzFH9gYPwA:10 a=0kPLrQdw3YYA:10 a=jBoGP612-tUA:10 a=t5DF_bUGhurCx8LQ:21 a=W6P_Gh1y2IibdbqZ:21 a=ld/erqUjW76FpBUqCqkKeA==:117 +X-Cloudmark-Score: 0 +X-Originating-IP: 71.70.153.3 +Received: from [71.70.153.3] ([71.70.153.3:59154] helo=mail.poochiereds.net) + by cdptpa-oedge03.mail.rr.com (envelope-from <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org>) + (ecelerity 2.2.2.39 r()) with ESMTP + id AC/10-00502-710312C4; Tue, 22 Jun 2010 21:50:16 +0000 +Received: from corrin.poochiereds.net (unknown [65.88.2.5]) + by mail.poochiereds.net (Postfix) with ESMTPSA id 03B11580F4; + Tue, 22 Jun 2010 17:50:14 -0400 (EDT) +In-Reply-To: <1277220198-3522-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-redhat-linux-gnu) +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1001918> + +On Tue, 22 Jun 2010 20:53:18 +0530 +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> Define server-level cache index objects (as managed by TCP_ServerInfo structs). +> Each server object is created in the CIFS top-level index object and is itself +> an index into which superblock-level objects are inserted. +> +> Currently, the server objects are keyed by hostname. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +> --- +> fs/cifs/Makefile | 2 +- +> fs/cifs/cache.c | 25 +++++++++++++++++++++++++ +> fs/cifs/cifsglob.h | 3 +++ +> fs/cifs/connect.c | 4 ++++ +> fs/cifs/fscache.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ +> fs/cifs/fscache.h | 12 ++++++++++++ +> 6 files changed, 92 insertions(+), 1 deletion(-) +> create mode 100644 fs/cifs/fscache.c +> +> Index: cifs-2.6/fs/cifs/Makefile +> =================================================================== +> --- cifs-2.6.orig/fs/cifs/Makefile +> +++ cifs-2.6/fs/cifs/Makefile +> @@ -12,4 +12,4 @@ cifs-$(CONFIG_CIFS_UPCALL) += cifs_spneg +> +> cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o +> +> -cifs-$(CONFIG_CIFS_FSCACHE) += cache.o +> +cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cache.o +> Index: cifs-2.6/fs/cifs/cache.c +> =================================================================== +> --- cifs-2.6.orig/fs/cifs/cache.c +> +++ cifs-2.6/fs/cifs/cache.c +> @@ -51,3 +51,28 @@ void cifs_fscache_unregister(void) +> fscache_unregister_netfs(&cifs_fscache_netfs); +> } +> +> +/* +> + * Server object currently keyed by hostname +> + */ +> +static uint16_t cifs_server_get_key(const void *cookie_netfs_data, +> + void *buffer, uint16_t maxbuf) +> +{ +> + const struct TCP_Server_Info *server = cookie_netfs_data; +> + uint16_t len = strnlen(server->hostname, sizeof(server->hostname)); +> + + +Would a tuple of address/family/port be a better choice here? Imagine I +mount "foo" and then later mount "foor.bar.baz". If they are the same +address and only the UNC differs, then you won't get the benefit of +the cache, right? + +> + if (len > maxbuf) +> + return 0; +> + +> + memcpy(buffer, server->hostname, len); +> + +> + return len; +> +} +> + +> +/* +> + * Server object for FS-Cache +> + */ +> +const struct fscache_cookie_def cifs_fscache_server_index_def = { +> + .name = "CIFS.server", +> + .type = FSCACHE_COOKIE_TYPE_INDEX, +> + .get_key = cifs_server_get_key, +> +}; +> Index: cifs-2.6/fs/cifs/cifsglob.h +> =================================================================== +> --- cifs-2.6.orig/fs/cifs/cifsglob.h +> +++ cifs-2.6/fs/cifs/cifsglob.h +> @@ -193,6 +193,9 @@ struct TCP_Server_Info { +> bool sec_mskerberos; /* supports legacy MS Kerberos */ +> bool sec_kerberosu2u; /* supports U2U Kerberos */ +> bool sec_ntlmssp; /* supports NTLMSSP */ +> +#ifdef CONFIG_CIFS_FSCACHE +> + struct fscache_cookie *fscache; /* client index cache cookie */ +> +#endif +> }; +> +> /* +> Index: cifs-2.6/fs/cifs/connect.c +> =================================================================== +> --- cifs-2.6.orig/fs/cifs/connect.c +> +++ cifs-2.6/fs/cifs/connect.c +> @@ -48,6 +48,7 @@ +> #include "nterr.h" +> #include "rfc1002pdu.h" +> #include "cn_cifs.h" +> +#include "fscache.h" +> +> #define CIFS_PORT 445 +> #define RFC1001_PORT 139 +> @@ -1453,6 +1454,8 @@ cifs_put_tcp_session(struct TCP_Server_I +> return; +> } +> +> + cifs_fscache_release_client_cookie(server); +> + +> list_del_init(&server->tcp_ses_list); +> write_unlock(&cifs_tcp_ses_lock); +> +> @@ -1572,6 +1575,7 @@ cifs_get_tcp_session(struct smb_vol *vol +> goto out_err; +> } +> +> + cifs_fscache_get_client_cookie(tcp_ses); +> /* thread spawned, put it on the list */ +> write_lock(&cifs_tcp_ses_lock); +> list_add(&tcp_ses->tcp_ses_list, &cifs_tcp_ses_list); +> Index: cifs-2.6/fs/cifs/fscache.c +> =================================================================== +> --- /dev/null +> +++ cifs-2.6/fs/cifs/fscache.c +> @@ -0,0 +1,47 @@ +> +/* +> + * fs/cifs/fscache.c - CIFS filesystem cache interface +> + * +> + * Copyright (c) 2010 Novell, Inc. +> + * Authors(s): Suresh Jayaraman (sjayaraman-l3A5Bk7waGM@public.gmane.org> +> + * +> + * This library is free software; you can redistribute it and/or modify +> + * it under the terms of the GNU Lesser General Public License as published +> + * by the Free Software Foundation; either version 2.1 of the License, or +> + * (at your option) any later version. +> + * +> + * This library is distributed in the hope that it will be useful, +> + * but WITHOUT ANY WARRANTY; without even the implied warranty of +> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +> + * the GNU Lesser General Public License for more details. +> + * +> + * You should have received a copy of the GNU Lesser General Public License +> + * along with this library; if not, write to the Free Software +> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +> + */ +> +#include <linux/init.h> +> +#include <linux/kernel.h> +> +#include <linux/sched.h> +> +#include <linux/mm.h> +> +#include <linux/in6.h> +> + +> +#include "fscache.h" +> +#include "cifsglob.h" +> +#include "cifs_debug.h" +> + +> +void cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) +> +{ +> + server->fscache = +> + fscache_acquire_cookie(cifs_fscache_netfs.primary_index, +> + &cifs_fscache_server_index_def, server); +> + cFYI(1, "CIFS: get client cookie (0x%p/0x%p)\n", +> + server, server->fscache); +> +} +> + +> +void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server) +> +{ +> + cFYI(1, "CIFS: release client cookie (0x%p/0x%p)\n", +> + server, server->fscache); +> + fscache_relinquish_cookie(server->fscache, 0); +> + server->fscache = NULL; +> +} +> + +> Index: cifs-2.6/fs/cifs/fscache.h +> =================================================================== +> --- cifs-2.6.orig/fs/cifs/fscache.h +> +++ cifs-2.6/fs/cifs/fscache.h +> @@ -27,14 +27,26 @@ +> #ifdef CONFIG_CIFS_FSCACHE +> +> extern struct fscache_netfs cifs_fscache_netfs; +> +extern const struct fscache_cookie_def cifs_fscache_server_index_def; +> +> extern int cifs_fscache_register(void); +> extern void cifs_fscache_unregister(void); +> +> +/* +> + * fscache.c +> + */ +> +extern void cifs_fscache_get_client_cookie(struct TCP_Server_Info *); +> +extern void cifs_fscache_release_client_cookie(struct TCP_Server_Info *); +> + +> #else /* CONFIG_CIFS_FSCACHE */ +> static inline int cifs_fscache_register(void) { return 0; } +> static inline void cifs_fscache_unregister(void) {} +> +> +static inline void +> +cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) {} +> +static inline void +> +cifs_fscache_get_client_cookie(struct TCP_Server_Info *server); {} +> + +> #endif /* CONFIG_CIFS_FSCACHE */ +> +> #endif /* _CIFS_FSCACHE_H */ +> -- +> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in +> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +> More majordomo info at http://vger.kernel.org/majordomo-info.html +> + + +-- +Jeff Layton <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org> + + diff --git a/test/corpora/lkml/cur/1382298770.002189:2, b/test/corpora/lkml/cur/1382298770.002189:2, new file mode 100644 index 00000000..3cfc62e0 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002189:2, @@ -0,0 +1,66 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 03/10] cifs: register CIFS for caching +Date: Wed, 23 Jun 2010 17:51:17 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 20 +Message-ID: <9603.1277311877@redhat.com> +References: <1277220189-3485-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Wed Jun 23 18:51:32 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORTAg-0008Bt-CT + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Wed, 23 Jun 2010 18:51:30 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1751915Ab0FWQv3 (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Wed, 23 Jun 2010 12:51:29 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:50923 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751520Ab0FWQv3 (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Wed, 23 Jun 2010 12:51:29 -0400 +Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NGpLFc028550 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 12:51:21 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NGpHIG010890; + Wed, 23 Jun 2010 12:51:18 -0400 +In-Reply-To: <1277220189-3485-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002219> + +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> + rc = cifs_fscache_register(); +> + if (rc) +> + goto out; +> + +> rc = cifs_init_inodecache(); +> if (rc) +> goto out_clean_proc; +> @@ -949,8 +954,10 @@ init_cifs(void) +> cifs_destroy_mids(); +> out_destroy_inodecache: +> cifs_destroy_inodecache(); +> + cifs_fscache_unregister(); +> out_clean_proc: + +This is incorrect. You need to call cifs_fscache_unregister() if +cifs_init_inodecache() fails. + +David + + diff --git a/test/corpora/lkml/cur/1382298770.002191:2, b/test/corpora/lkml/cur/1382298770.002191:2, new file mode 100644 index 00000000..56752a9f --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002191:2, @@ -0,0 +1,65 @@ +From: David Howells <dhowells@redhat.com> +Subject: Re: [RFC][PATCH 04/10] cifs: define server-level cache index objects and register them with FS-Cache +Date: Wed, 23 Jun 2010 17:54:52 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 19 +Message-ID: <9658.1277312092@redhat.com> +References: <1277220198-3522-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells@redhat.com, Steve French <smfrench@gmail.com>, + linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Suresh Jayaraman <sjayaraman@suse.de> +X-From: linux-fsdevel-owner@vger.kernel.org Wed Jun 23 18:55:07 2010 +Return-path: <linux-fsdevel-owner@vger.kernel.org> +Envelope-to: lnx-linux-fsdevel@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-fsdevel-owner@vger.kernel.org>) + id 1ORTE8-0002ll-VF + for lnx-linux-fsdevel@lo.gmane.org; Wed, 23 Jun 2010 18:55:05 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1752263Ab0FWQzD (ORCPT <rfc822;lnx-linux-fsdevel@m.gmane.org>); + Wed, 23 Jun 2010 12:55:03 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:18394 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751794Ab0FWQzB (ORCPT <rfc822;linux-fsdevel@vger.kernel.org>); + Wed, 23 Jun 2010 12:55:01 -0400 +Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NGsu1L000993 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 12:54:56 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NGsrUG016433; + Wed, 23 Jun 2010 12:54:54 -0400 +In-Reply-To: <1277220198-3522-1-git-send-email-sjayaraman@suse.de> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 +Sender: linux-fsdevel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-fsdevel.vger.kernel.org> +X-Mailing-List: linux-fsdevel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002221> + +Suresh Jayaraman <sjayaraman@suse.de> wrote: + +> Define server-level cache index objects (as managed by TCP_ServerInfo +> structs). Each server object is created in the CIFS top-level index object +> and is itself an index into which superblock-level objects are inserted. +> +> Currently, the server objects are keyed by hostname. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> + +Looks reasonable, apart from the index key. I agree with Jeff that you +probably want {address,port,family} rather than a hostname. + +David +-- +To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298770.002193:2, b/test/corpora/lkml/cur/1382298770.002193:2, new file mode 100644 index 00000000..e2ea6266 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002193:2, @@ -0,0 +1,59 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 05/10] cifs: define superblock-level cache index objects and register them +Date: Wed, 23 Jun 2010 17:58:10 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 13 +Message-ID: <9720.1277312290@redhat.com> +References: <1277220206-3559-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Wed Jun 23 18:58:19 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORTHG-0003Az-Ge + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Wed, 23 Jun 2010 18:58:18 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1751520Ab0FWQ6R (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Wed, 23 Jun 2010 12:58:17 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:62343 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751372Ab0FWQ6R (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Wed, 23 Jun 2010 12:58:17 -0400 +Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NGwDC2031683 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 12:58:13 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NGwAfq021298; + Wed, 23 Jun 2010 12:58:11 -0400 +In-Reply-To: <1277220206-3559-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002223> + +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> Define superblock-level cache index objects (managed by cifsTconInfo +> structs). Each superblock object is created in a server-level index object +> and in itself an index into which inode-level objects are inserted. +> +> Currently, the superblock objects are keyed by sharename. + +Seems reasonable. Is there any way you can check that the share you are +looking at on a server is the same as the last time you looked? Can you +validate the root directory of the share in some way? + +David + + diff --git a/test/corpora/lkml/cur/1382298770.002194:2, b/test/corpora/lkml/cur/1382298770.002194:2, new file mode 100644 index 00000000..d2d1efdb --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002194:2, @@ -0,0 +1,61 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and register them +Date: Wed, 23 Jun 2010 18:02:53 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 15 +Message-ID: <9822.1277312573@redhat.com> +References: <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Wed Jun 23 19:03:04 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORTLr-0007Bh-Cs + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Wed, 23 Jun 2010 19:03:03 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1752063Ab0FWRDB (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Wed, 23 Jun 2010 13:03:01 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:30823 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751804Ab0FWRDA (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Wed, 23 Jun 2010 13:03:00 -0400 +Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH2v0J030982 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 13:02:57 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH2r9N014323; + Wed, 23 Jun 2010 13:02:54 -0400 +In-Reply-To: <1277220214-3597-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002224> + +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> Define inode-level data storage objects (managed by cifsInodeInfo structs). +> Each inode-level object is created in a super-block level object and is +> itself a data storage object in to which pages from the inode are stored. +> +> The inode object is keyed by UniqueId. The coherency data being used is +> LastWriteTime and the file size. + +Isn't there a file creation time too? + +I take it you don't support caching on files that are open for writing at this +time? + +David + + diff --git a/test/corpora/lkml/cur/1382298770.002195:2, b/test/corpora/lkml/cur/1382298770.002195:2, new file mode 100644 index 00000000..ec54a814 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002195:2, @@ -0,0 +1,59 @@ +From: David Howells <dhowells@redhat.com> +Subject: Re: [RFC][PATCH 07/10] cifs: FS-Cache page management +Date: Wed, 23 Jun 2010 18:05:01 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 13 +Message-ID: <9866.1277312701@redhat.com> +References: <1277220228-3635-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells@redhat.com, Steve French <smfrench@gmail.com>, + linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Suresh Jayaraman <sjayaraman@suse.de> +X-From: linux-fsdevel-owner@vger.kernel.org Wed Jun 23 19:05:19 2010 +Return-path: <linux-fsdevel-owner@vger.kernel.org> +Envelope-to: lnx-linux-fsdevel@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-fsdevel-owner@vger.kernel.org>) + id 1ORTNz-0008Oj-Ho + for lnx-linux-fsdevel@lo.gmane.org; Wed, 23 Jun 2010 19:05:15 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1752145Ab0FWRFO (ORCPT <rfc822;lnx-linux-fsdevel@m.gmane.org>); + Wed, 23 Jun 2010 13:05:14 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:1689 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751804Ab0FWRFN (ORCPT <rfc822;linux-fsdevel@vger.kernel.org>); + Wed, 23 Jun 2010 13:05:13 -0400 +Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH59sl011966 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 13:05:09 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH52Jl022163; + Wed, 23 Jun 2010 13:05:03 -0400 +In-Reply-To: <1277220228-3635-1-git-send-email-sjayaraman@suse.de> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 +Sender: linux-fsdevel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-fsdevel.vger.kernel.org> +X-Mailing-List: linux-fsdevel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002225> + +Suresh Jayaraman <sjayaraman@suse.de> wrote: + +> Takes care of invalidation and release of FS-Cache marked pages and also +> invalidation of the FsCache page flag when the inode is removed. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> + +Acked-by: David Howells <dhowells@redhat.com> +-- +To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298770.002196:2, b/test/corpora/lkml/cur/1382298770.002196:2, new file mode 100644 index 00000000..63838dc7 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002196:2, @@ -0,0 +1,54 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 08/10] cifs: store pages into local cache +Date: Wed, 23 Jun 2010 18:06:12 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 8 +Message-ID: <9890.1277312772@redhat.com> +References: <1277220240-3674-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Wed Jun 23 19:06:21 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORTP3-0000fp-01 + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Wed, 23 Jun 2010 19:06:21 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1752403Ab0FWRGU (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Wed, 23 Jun 2010 13:06:20 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:63621 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751804Ab0FWRGT (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Wed, 23 Jun 2010 13:06:19 -0400 +Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH6FCB012081 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 13:06:15 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH6CKG013414; + Wed, 23 Jun 2010 13:06:13 -0400 +In-Reply-To: <1277220240-3674-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002226> + +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> Store pages from an CIFS inode into the data storage object associated with +> that inode. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> + +Acked-by: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> + + diff --git a/test/corpora/lkml/cur/1382298770.002197:2, b/test/corpora/lkml/cur/1382298770.002197:2, new file mode 100644 index 00000000..765c3993 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002197:2, @@ -0,0 +1,53 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 09/10] cifs: read pages from FS-Cache +Date: Wed, 23 Jun 2010 18:07:40 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 7 +Message-ID: <9918.1277312860@redhat.com> +References: <1277220261-3717-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Wed Jun 23 19:07:51 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1ORTQR-0000nv-JF + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Wed, 23 Jun 2010 19:07:47 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1751708Ab0FWRHr (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Wed, 23 Jun 2010 13:07:47 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:34413 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1750954Ab0FWRHq (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Wed, 23 Jun 2010 13:07:46 -0400 +Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH7h3Y005904 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 13:07:43 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH7efR020683; + Wed, 23 Jun 2010 13:07:41 -0400 +In-Reply-To: <1277220261-3717-1-git-send-email-sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002227> + +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> Read pages from a FS-Cache data storage object into a CIFS inode. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> + +Acked-by: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> + + diff --git a/test/corpora/lkml/cur/1382298770.002201:2, b/test/corpora/lkml/cur/1382298770.002201:2, new file mode 100644 index 00000000..bae1eefe --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002201:2, @@ -0,0 +1,58 @@ +From: David Howells <dhowells@redhat.com> +Subject: Re: [RFC][PATCH 10/10] cifs: add mount option to enable local caching +Date: Wed, 23 Jun 2010 18:08:34 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 12 +Message-ID: <9942.1277312914@redhat.com> +References: <1277220309-3757-1-git-send-email-sjayaraman@suse.de> <yes> +Cc: dhowells@redhat.com, Steve French <smfrench@gmail.com>, + linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Suresh Jayaraman <sjayaraman@suse.de> +X-From: linux-kernel-owner@vger.kernel.org Wed Jun 23 19:09:22 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1ORTRv-0002J8-2s + for glk-linux-kernel-3@lo.gmane.org; Wed, 23 Jun 2010 19:09:19 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1753275Ab0FWRIt (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Wed, 23 Jun 2010 13:08:49 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:6156 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1753203Ab0FWRIr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Wed, 23 Jun 2010 13:08:47 -0400 +Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH8dax006028 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 23 Jun 2010 13:08:39 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5NH8YmA020846; + Wed, 23 Jun 2010 13:08:36 -0400 +In-Reply-To: <1277220309-3757-1-git-send-email-sjayaraman@suse.de> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002231> + +Suresh Jayaraman <sjayaraman@suse.de> wrote: + +> Add a mount option 'fsc' to enable local caching on CIFS. +> +> As the cifs-utils (userspace) changes are not done yet, this patch enables +> 'fsc' by default to assist testing. +> +> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> + +Acked-by: David Howells <dhowells@redhat.com> + +(Give or take the debugging bit) + + diff --git a/test/corpora/lkml/cur/1382298770.002878:2, b/test/corpora/lkml/cur/1382298770.002878:2, new file mode 100644 index 00000000..66a3e223 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002878:2, @@ -0,0 +1,90 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: Re: [RFC][PATCH 10/10] cifs: add mount option to enable local caching +Date: Fri, 25 Jun 2010 16:18:12 +0530 +Lines: 47 +Message-ID: <4C24896C.4000903@suse.de> +References: <yes> <1277220309-3757-1-git-send-email-sjayaraman@suse.de> <4C225338.9010807@gmail.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +To: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Fri Jun 25 12:48:27 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OS6SO-0003QF-NW + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Fri, 25 Jun 2010 12:48:25 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1753965Ab0FYKsX (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 06:48:23 -0400 +Received: from cantor.suse.de ([195.135.220.2]:46395 "EHLO mx1.suse.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1752612Ab0FYKsW (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Fri, 25 Jun 2010 06:48:22 -0400 +Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mx1.suse.de (Postfix) with ESMTP id 60CED6CB00; + Fri, 25 Jun 2010 12:48:21 +0200 (CEST) +User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 +In-Reply-To: <4C225338.9010807-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002912> + +On 06/24/2010 12:02 AM, Scott Lovenberg wrote: +> On 6/22/2010 11:25 AM, Suresh Jayaraman wrote: +>> Add a mount option 'fsc' to enable local caching on CIFS. +>> +>> As the cifs-utils (userspace) changes are not done yet, this patch +>> enables +>> 'fsc' by default to assist testing. +>> +> [...] +>> @@ -1332,6 +1336,8 @@ cifs_parse_mount_options(char *options, const +>> char *devname, +>> printk(KERN_WARNING "CIFS: Mount option noac not " +>> "supported. Instead set " +>> "/proc/fs/cifs/LookupCacheEnabled to 0\n"); +>> + } else if (strnicmp(data, "fsc", 3) == 0) { +>> + vol->fsc = true; +>> } else +>> printk(KERN_WARNING "CIFS: Unknown mount option %s\n", +>> data); +>> @@ -2405,6 +2411,8 @@ static void setup_cifs_sb(struct smb_vol +>> *pvolume_info, +>> cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_GID; +>> if (pvolume_info->dynperm) +>> cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM; +>> + if (pvolume_info->fsc) +>> + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_FSCACHE; +>> if (pvolume_info->direct_io) { +>> cFYI(1, "mounting share using direct i/o"); +>> cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; +>> +> I reworked the CIFS mount option parsing a while back; I'm not sure +> whether that patch was going to be in the 2.6.35 tree or not (the window +> just opened, didn't it?). + +Not a problem, I could redo this patch alone when the reworked option +parsing patches get in. + +> Jeff, Steve, can you confirm if that patch is going to be in 2.6.35? +> +> Patch refs: http://patchwork.ozlabs.org/patch/53059/ and +> http://patchwork.ozlabs.org/patch/53674/ +> + +Thanks, + +-- +Suresh Jayaraman + + diff --git a/test/corpora/lkml/cur/1382298770.002879:2, b/test/corpora/lkml/cur/1382298770.002879:2, new file mode 100644 index 00000000..5782037a --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002879:2, @@ -0,0 +1,68 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: Re: [RFC][PATCH 03/10] cifs: register CIFS for caching +Date: Fri, 25 Jun 2010 16:26:22 +0530 +Lines: 26 +Message-ID: <4C248B56.8030207@suse.de> +References: <1277220189-3485-1-git-send-email-sjayaraman@suse.de> <yes> <9603.1277311877@redhat.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Fri Jun 25 12:56:32 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OS6aG-00066f-1L + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Fri, 25 Jun 2010 12:56:32 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1754188Ab0FYK4b (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 06:56:31 -0400 +Received: from cantor.suse.de ([195.135.220.2]:46564 "EHLO mx1.suse.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1753651Ab0FYK4a (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Fri, 25 Jun 2010 06:56:30 -0400 +Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mx1.suse.de (Postfix) with ESMTP id 17F1E6CB00; + Fri, 25 Jun 2010 12:56:30 +0200 (CEST) +User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 +In-Reply-To: <9603.1277311877-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002913> + +On 06/23/2010 10:21 PM, David Howells wrote: +> Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: +> +>> + rc = cifs_fscache_register(); +>> + if (rc) +>> + goto out; +>> + +>> rc = cifs_init_inodecache(); +>> if (rc) +>> goto out_clean_proc; +>> @@ -949,8 +954,10 @@ init_cifs(void) +>> cifs_destroy_mids(); +>> out_destroy_inodecache: +>> cifs_destroy_inodecache(); +>> + cifs_fscache_unregister(); +>> out_clean_proc: +> +> This is incorrect. You need to call cifs_fscache_unregister() if +> cifs_init_inodecache() fails. +> + +Doh! I'll fix it. + + +-- +Suresh Jayaraman + + diff --git a/test/corpora/lkml/cur/1382298770.002911:2, b/test/corpora/lkml/cur/1382298770.002911:2, new file mode 100644 index 00000000..8e172cb2 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002911:2, @@ -0,0 +1,84 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: Re: [RFC][PATCH 05/10] cifs: define superblock-level cache index + objects and register them +Date: Fri, 25 Jun 2010 18:14:16 +0530 +Lines: 41 +Message-ID: <4C24A4A0.90408@suse.de> +References: <1277220206-3559-1-git-send-email-sjayaraman@suse.de> <yes> <9720.1277312290@redhat.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Fri Jun 25 14:44:28 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OS8Gh-0005Bb-E2 + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Fri, 25 Jun 2010 14:44:27 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1754703Ab0FYMo0 (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 08:44:26 -0400 +Received: from cantor.suse.de ([195.135.220.2]:51036 "EHLO mx1.suse.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1754222Ab0FYMoZ (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Fri, 25 Jun 2010 08:44:25 -0400 +Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mx1.suse.de (Postfix) with ESMTP id E07FF8FEA2; + Fri, 25 Jun 2010 14:44:24 +0200 (CEST) +User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 +In-Reply-To: <9720.1277312290-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002945> + +On 06/23/2010 10:28 PM, David Howells wrote: +> Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: +> +>> Define superblock-level cache index objects (managed by cifsTconInfo +>> structs). Each superblock object is created in a server-level index object +>> and in itself an index into which inode-level objects are inserted. +>> +>> Currently, the superblock objects are keyed by sharename. +> +> Seems reasonable. Is there any way you can check that the share you are +> looking at on a server is the same as the last time you looked? Can you + +Good point. + +I thought of using TID (Tree identifier; a unique ID for a resource in +use by client) along with sharename. But, Server is free to reuse them +when the tree connection closes and does not guarantee the same Tid for +a particular resource across tree connections. + +Also, considering the UNC name of the resource (//server/share) may not +be a good idea too as the cache will not be used when for e.g. IPaddress +is used to mount. + +So, if a server does something like this: + - export a share 'foo' (original server path: /export/vol1/foo) + - client mounts and uses it + - server unexports the share 'foo' + - server exports 'foo' (original sever path: /export/vol2/foo) + +we have a bit of problem.. + +> validate the root directory of the share in some way? +> + +I don't know if there is a way to do this. + +Thanks, + + +-- +Suresh Jayaraman + + diff --git a/test/corpora/lkml/cur/1382298770.002912:2, b/test/corpora/lkml/cur/1382298770.002912:2, new file mode 100644 index 00000000..d9c761de --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002912:2, @@ -0,0 +1,65 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and + register them +Date: Fri, 25 Jun 2010 18:20:14 +0530 +Lines: 24 +Message-ID: <4C24A606.5040001@suse.de> +References: <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <yes> <9822.1277312573@redhat.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Fri Jun 25 14:50:26 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OS8MR-0007EU-OS + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Fri, 25 Jun 2010 14:50:24 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1754607Ab0FYMuX (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 08:50:23 -0400 +Received: from cantor2.suse.de ([195.135.220.15]:38716 "EHLO mx2.suse.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1753675Ab0FYMuW (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Fri, 25 Jun 2010 08:50:22 -0400 +Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) + by mx2.suse.de (Postfix) with ESMTP id B05E686A2E; + Fri, 25 Jun 2010 14:50:21 +0200 (CEST) +User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 +In-Reply-To: <9822.1277312573-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002946> + +On 06/23/2010 10:32 PM, David Howells wrote: +> Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: +> +>> Define inode-level data storage objects (managed by cifsInodeInfo structs). +>> Each inode-level object is created in a super-block level object and is +>> itself a data storage object in to which pages from the inode are stored. +>> +>> The inode object is keyed by UniqueId. The coherency data being used is +>> LastWriteTime and the file size. +> +> Isn't there a file creation time too? + +I think the creation time is currently being ignored as we won't be able +to accomodate in POSIX stat struct. + +> I take it you don't support caching on files that are open for writing at this +> time? +> + +Yes. + + +-- +Suresh Jayaraman + + diff --git a/test/corpora/lkml/cur/1382298770.002915:2, b/test/corpora/lkml/cur/1382298770.002915:2, new file mode 100644 index 00000000..e43c909f --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002915:2, @@ -0,0 +1,58 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and register them +Date: Fri, 25 Jun 2010 13:55:49 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 12 +Message-ID: <22697.1277470549@redhat.com> +References: <4C24A606.5040001@suse.de> <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <yes> <9822.1277312573@redhat.com> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Fri Jun 25 14:56:04 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OS8Rw-0002tq-3k + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Fri, 25 Jun 2010 14:56:04 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1753622Ab0FYM4B (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 08:56:01 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:50162 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1752535Ab0FYM4B (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Fri, 25 Jun 2010 08:56:01 -0400 +Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5PCtqOd018091 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Fri, 25 Jun 2010 08:55:52 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5PCtn4G016466; + Fri, 25 Jun 2010 08:55:51 -0400 +In-Reply-To: <4C24A606.5040001-l3A5Bk7waGM@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002949> + +Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: + +> I think the creation time is currently being ignored as we won't be able +> to accomodate in POSIX stat struct. + +The FS-Cache interface doesn't use the POSIX stat struct, but it could be +really useful to save it and use it for cache coherency inside the kernel. + +Out of interest, what does Samba do when it comes to generating a creation time +for UNIX where one does not exist? + +David + + diff --git a/test/corpora/lkml/cur/1382298770.002917:2, b/test/corpora/lkml/cur/1382298770.002917:2, new file mode 100644 index 00000000..f7047f84 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002917:2, @@ -0,0 +1,67 @@ +From: David Howells <dhowells@redhat.com> +Subject: Re: [RFC][PATCH 05/10] cifs: define superblock-level cache index objects and register them +Date: Fri, 25 Jun 2010 13:58:33 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 21 +Message-ID: <22746.1277470713@redhat.com> +References: <4C24A4A0.90408@suse.de> <1277220206-3559-1-git-send-email-sjayaraman@suse.de> <yes> <9720.1277312290@redhat.com> +Cc: dhowells@redhat.com, Steve French <smfrench@gmail.com>, + linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Suresh Jayaraman <sjayaraman@suse.de> +X-From: linux-fsdevel-owner@vger.kernel.org Fri Jun 25 15:02:20 2010 +Return-path: <linux-fsdevel-owner@vger.kernel.org> +Envelope-to: lnx-linux-fsdevel@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with smtp (Exim 4.69) + (envelope-from <linux-fsdevel-owner@vger.kernel.org>) + id 1OS8Xz-000628-FG + for lnx-linux-fsdevel@lo.gmane.org; Fri, 25 Jun 2010 15:02:19 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1755357Ab0FYM6k (ORCPT <rfc822;lnx-linux-fsdevel@m.gmane.org>); + Fri, 25 Jun 2010 08:58:40 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:50417 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1754086Ab0FYM6j (ORCPT <rfc822;linux-fsdevel@vger.kernel.org>); + Fri, 25 Jun 2010 08:58:39 -0400 +Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5PCwa7Z005113 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Fri, 25 Jun 2010 08:58:36 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5PCwXVB011094; + Fri, 25 Jun 2010 08:58:34 -0400 +In-Reply-To: <4C24A4A0.90408@suse.de> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 +Sender: linux-fsdevel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-fsdevel.vger.kernel.org> +X-Mailing-List: linux-fsdevel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002951> + +Suresh Jayaraman <sjayaraman@suse.de> wrote: + +> Also, considering the UNC name of the resource (//server/share) may not +> be a good idea too as the cache will not be used when for e.g. IPaddress +> is used to mount. + +You could convert the UNC name to an IP address, and just use that as your +key. + +> > validate the root directory of the share in some way? +> +> I don't know if there is a way to do this. + +Is there an inode number or something? Even the creation time might do. + +David +-- +To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298770.002930:2, b/test/corpora/lkml/cur/1382298770.002930:2, new file mode 100644 index 00000000..20410165 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002930:2, @@ -0,0 +1,81 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 05/10] cifs: define superblock-level cache index objects and register them +Date: Fri, 25 Jun 2010 14:26:52 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 35 +Message-ID: <23204.1277472412@redhat.com> +References: <22746.1277470713@redhat.com> <4C24A4A0.90408@suse.de> <1277220206-3559-1-git-send-email-sjayaraman@suse.de> <yes> <9720.1277312290@redhat.com> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org>, + Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: unlisted-recipients:; (no To-header on input) +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Fri Jun 25 15:27:01 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OS8vt-0000Xv-FL + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Fri, 25 Jun 2010 15:27:01 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1755944Ab0FYN1A (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 09:27:00 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:15634 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1755398Ab0FYN07 (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Fri, 25 Jun 2010 09:26:59 -0400 +Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5PDQu1D020638 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Fri, 25 Jun 2010 09:26:56 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5PDQruU018472; + Fri, 25 Jun 2010 09:26:54 -0400 +In-Reply-To: <22746.1277470713-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1002964> + +David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: + +> > > validate the root directory of the share in some way? +> > +> > I don't know if there is a way to do this. +> +> Is there an inode number or something? Even the creation time might do. + +Looking in cifspdu.h, there are a number of things that it might be possible +to use. + + (1) FILE_ALL_INFO: CreationTime, IndexNumber, IndexNumber1, FileName + (assuming this isn't flattened to '\' or something for the root of a + share. + + (2) FILE_UNIX_BASIC_INFO: DevMajor, DevMinor, UniqueId. + + (3) FILE_INFO_STANDARD: CreationDate, CreationTime. + + (4) FILE_INFO_BASIC: CreationTime. + + (5) FILE_DIRECTORY_INFO: FileIndex, CreationTime, FileName. + + (6) SEARCH_ID_FULL_DIR_INFO: FileIndex, CreationTime, UniqueId, FileName. + + (7) FILE_BOTH_DIRECTORY_INFO: FileIndex, CreationTime, ShortName, FileName. + + (8) OPEN_RSP_EXT: Fid, CreationTime, VolumeGUID, FileId. + +You may have to choose different sets of things, depending on what the server +has on offer. Also, don't forget, if you can't work out whether a share is +coherent or not from the above, you can always use LastWriteTime, ChangeTime +and EndOfFile and just discard the whole subtree if they differ. + +David + + diff --git a/test/corpora/lkml/cur/1382298770.002997:2, b/test/corpora/lkml/cur/1382298770.002997:2, new file mode 100644 index 00000000..b78073cd --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.002997:2, @@ -0,0 +1,90 @@ +From: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and + register them +Date: Fri, 25 Jun 2010 12:53:06 -0400 +Lines: 36 +Message-ID: <20100625125306.7f9b1966@tlielax.poochiereds.net> +References: <4C24A606.5040001@suse.de> + <1277220214-3597-1-git-send-email-sjayaraman@suse.de> + <yes> + <9822.1277312573@redhat.com> + <22697.1277470549@redhat.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +Cc: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org>, + Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org +To: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Fri Jun 25 18:53:12 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OSC9P-0005Eb-SU + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Fri, 25 Jun 2010 18:53:12 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S932199Ab0FYQxK (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 12:53:10 -0400 +Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.122]:53512 "EHLO + cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S932187Ab0FYQxJ (ORCPT + <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); Fri, 25 Jun 2010 12:53:09 -0400 +X-Authority-Analysis: v=1.0 c=1 a=iVNVO0OCT3kA:10 a=yQWWgrYGNuUA:10 a=kj9zAlcOel0A:10 a=20KFwNOVAAAA:8 a=hGzw-44bAAAA:8 a=f0L6POiToRdS6aViIA4A:9 a=tdNtT7bw1iHNm6ggrCkIte35EhAA:4 a=CjuIK1q_8ugA:10 a=jEp0ucaQiEUA:10 a=0kPLrQdw3YYA:10 a=dowx1zmaLagA:10 a=00U40p1LBqVLw4jT:21 a=gh7LVOPznGai4vo_:21 +X-Cloudmark-Score: 0 +X-Originating-IP: 71.70.153.3 +Received: from [71.70.153.3] ([71.70.153.3:42266] helo=mail.poochiereds.net) + by cdptpa-oedge01.mail.rr.com (envelope-from <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>) + (ecelerity 2.2.2.39 r()) with ESMTP + id 2D/E0-24471-3FED42C4; Fri, 25 Jun 2010 16:53:08 +0000 +Received: from tlielax.poochiereds.net (tlielax.poochiereds.net [192.168.1.3]) + by mail.poochiereds.net (Postfix) with ESMTPS id E9B19580FA; + Fri, 25 Jun 2010 12:53:06 -0400 (EDT) +In-Reply-To: <22697.1277470549-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-redhat-linux-gnu) +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003033> + +On Fri, 25 Jun 2010 13:55:49 +0100 +David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: + +> Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote: +> +> > I think the creation time is currently being ignored as we won't be able +> > to accomodate in POSIX stat struct. +> +> The FS-Cache interface doesn't use the POSIX stat struct, but it could be +> really useful to save it and use it for cache coherency inside the kernel. +> +> Out of interest, what does Samba do when it comes to generating a creation time +> for UNIX where one does not exist? +> + +(cc'ing samba-technical since we're talking about the create time) + +Looks like it mostly uses the ctime. IMO, the mtime would be a better +choice since it changes less frequently, but I don't guess that it +matters very much. + +I have a few patches that make the cifs_iget code do more stringent +checks. One of those makes it use the create time like an i_generation +field to guard against matching inodes that have the same number but +that have undergone a delete/create cycle. They need a bit more testing +but I'm planning to post them in time for 2.6.36. + +Because of how samba generates this number, it could be somewhat +problematic to do this. What may save us though is that Linux<->Samba +mostly uses unix extensions unless someone has specifically disabled +them on either end. The unix extension calls don't generally send any +sort of create time field, so we can't rely on it in those codepaths +anyway. + +-- +Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> + + diff --git a/test/corpora/lkml/cur/1382298770.003106:2, b/test/corpora/lkml/cur/1382298770.003106:2, new file mode 100644 index 00000000..19ea381d --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.003106:2, @@ -0,0 +1,60 @@ +From: David Howells <dhowells@redhat.com> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and register them +Date: Fri, 25 Jun 2010 22:46:38 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 13 +Message-ID: <18628.1277502398@redhat.com> +References: <20100625125306.7f9b1966@tlielax.poochiereds.net> <4C24A606.5040001@suse.de> <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <yes> <9822.1277312573@redhat.com> <22697.1277470549@redhat.com> +Cc: dhowells@redhat.com, Suresh Jayaraman <sjayaraman@suse.de>, + Steve French <smfrench@gmail.com>, linux-cifs@vger.kernel.org, + linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, + samba-technical@lists.samba.org +To: Jeff Layton <jlayton@samba.org> +X-From: linux-kernel-owner@vger.kernel.org Fri Jun 25 23:47:07 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OSGjo-0006q8-ME + for glk-linux-kernel-3@lo.gmane.org; Fri, 25 Jun 2010 23:47:05 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932250Ab0FYVqv (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Fri, 25 Jun 2010 17:46:51 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:55406 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932088Ab0FYVqs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Fri, 25 Jun 2010 17:46:48 -0400 +Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5PLkhIG005974 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Fri, 25 Jun 2010 17:46:43 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5PLkd77017768; + Fri, 25 Jun 2010 17:46:40 -0400 +In-Reply-To: <20100625125306.7f9b1966@tlielax.poochiereds.net> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003142> + +Jeff Layton <jlayton@samba.org> wrote: + +> Looks like it mostly uses the ctime. IMO, the mtime would be a better +> choice since it changes less frequently, but I don't guess that it +> matters very much. + +I'd've thought mtime changes more frequently since that's altered when data is +written. ctime is changed when attributes are changed. + +Note that Ext4 appears to have a file creation time field in its inode +(struct ext4_inode::i_crtime[_extra]). Can Samba be made to use that? + +David + + diff --git a/test/corpora/lkml/cur/1382298770.003117:2, b/test/corpora/lkml/cur/1382298770.003117:2, new file mode 100644 index 00000000..7f53e34b --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.003117:2, @@ -0,0 +1,65 @@ +From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and register them +Date: Sat, 26 Jun 2010 00:04:28 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 18 +Message-ID: <20123.1277507068@redhat.com> +References: <20100625182651.36800d06@tlielax.poochiereds.net> <20100625125306.7f9b1966@tlielax.poochiereds.net> <4C24A606.5040001@suse.de> <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <yes> <9822.1277312573@redhat.com> <22697.1277470549@redhat.com> <18628.1277502398@redhat.com> +Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org>, + Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org +To: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Sat Jun 26 01:04:45 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OSHww-0006Jk-NV + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Sat, 26 Jun 2010 01:04:43 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1751807Ab0FYXEl (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Fri, 25 Jun 2010 19:04:41 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:62977 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1752149Ab0FYXEl (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Fri, 25 Jun 2010 19:04:41 -0400 +Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5PN4X40004498 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Fri, 25 Jun 2010 19:04:34 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5PN4Sld008220; + Fri, 25 Jun 2010 19:04:30 -0400 +In-Reply-To: <20100625182651.36800d06-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003153> + +Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> wrote: + +> IIUC, updating mtime for a write is also an attribute change, and that +> affects ctime. According to the stat(2) manpage: + +You're right. Okay, ctime is the more frequently changed. + +> > Note that Ext4 appears to have a file creation time field in its inode +> > (struct ext4_inode::i_crtime[_extra]). Can Samba be made to use that? +> +> Is it exposed to userspace in any (standard) way? It would be handy to +> have that. While we're wishing...it might also be nice to have a +> standard way to get at the i_generation from userspace too. + +Not at present, but it's something that could be exported by ioctl() or +getxattr(). + +David + + diff --git a/test/corpora/lkml/cur/1382298770.003118:2, b/test/corpora/lkml/cur/1382298770.003118:2, new file mode 100644 index 00000000..a1ec438b --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.003118:2, @@ -0,0 +1,122 @@ +From: Steve French <smfrench@gmail.com> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and + register them +Date: Fri, 25 Jun 2010 18:05:30 -0500 +Lines: 51 +Message-ID: <AANLkTilOTrHLvLv4XWYZO6xCnYZgYT7gO2M-oKZ6VvqM@mail.gmail.com> +References: <20100625125306.7f9b1966@tlielax.poochiereds.net> + <4C24A606.5040001@suse.de> + <1277220214-3597-1-git-send-email-sjayaraman@suse.de> + <9822.1277312573@redhat.com> + <22697.1277470549@redhat.com> + <18628.1277502398@redhat.com> + <20100625182651.36800d06@tlielax.poochiereds.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: QUOTED-PRINTABLE +Cc: David Howells <dhowells@redhat.com>, + Suresh Jayaraman <sjayaraman@suse.de>, + linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org, samba-technical@lists.samba.org, + Jeff Layton <jlayton@redhat.com> +To: Jeff Layton <jlayton@samba.org>, + "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>, + Mingming Cao <mcao@us.ibm.com> +X-From: linux-kernel-owner@vger.kernel.org Sat Jun 26 01:05:41 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OSHxs-0006a8-BA + for glk-linux-kernel-3@lo.gmane.org; Sat, 26 Jun 2010 01:05:40 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1756188Ab0FYXFd convert rfc822-to-quoted-printable (ORCPT + <rfc822;glk-linux-kernel-3@m.gmane.org>); + Fri, 25 Jun 2010 19:05:33 -0400 +Received: from mail-qw0-f46.google.com ([209.85.216.46]:51369 "EHLO + mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751575Ab0FYXFb convert rfc822-to-8bit (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Fri, 25 Jun 2010 19:05:31 -0400 +Received: by qwi4 with SMTP id 4so742644qwi.19 + for <multiple recipients>; Fri, 25 Jun 2010 16:05:30 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:mime-version:received:received:in-reply-to + :references:date:message-id:subject:from:to:cc:content-type + :content-transfer-encoding; + bh=6wKQkGOEeUGN4oPR3Nm4SRxtJr/EBwN8ENmpLnfdCDU=; + b=X7L6W0MtpQeW/4iBuj+oDlcP2yCJ3qwUs9lHBq1fRW6WdYblHXjmaN8o++3GDPLAg5 + 0MD07zxbYTGXRSrgCjCrGVm0tT88/6hY2a/rB8g68h/Qso2sIHa7B1iIN8JRR4pPWle0 + sVjp9Xy/bQn2e0uE481Ii1TLHuWYA/QDXZreU= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=mime-version:in-reply-to:references:date:message-id:subject:from:to + :cc:content-type:content-transfer-encoding; + b=B+7qQvdOpN5a/KCRrDbssKZX8D3SnP73VMHd9RpkqP9nCHCmSLAgbeH03+/m6CLVAo + G+NKWqWtknwPBkYqT/bdP2XEak1yr+0rjOqjUaNvaT7AhzsyHEJBkaNnsbS3qaRy39OP + S7OkAyHfmgdeNAHkKnKRF73hfpvgAqR9X4bn8= +Received: by 10.224.59.223 with SMTP id m31mr1130670qah.63.1277507130411; Fri, + 25 Jun 2010 16:05:30 -0700 (PDT) +Received: by 10.229.46.136 with HTTP; Fri, 25 Jun 2010 16:05:30 -0700 (PDT) +In-Reply-To: <20100625182651.36800d06@tlielax.poochiereds.net> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003154> + +On Fri, Jun 25, 2010 at 5:26 PM, Jeff Layton <jlayton@samba.org> wrote: +> +> On Fri, 25 Jun 2010 22:46:38 +0100 +> David Howells <dhowells@redhat.com> wrote: +> +> > Jeff Layton <jlayton@samba.org> wrote: +> > +> > > Looks like it mostly uses the ctime. IMO, the mtime would be a be= +tter +> > > choice since it changes less frequently, but I don't guess that i= +t +> > > matters very much. +> > +> > I'd've thought mtime changes more frequently since that's altered w= +hen data is +> > written. =A0ctime is changed when attributes are changed. +> > +> +> IIUC, updating mtime for a write is also an attribute change, and tha= +t +> affects ctime. According to the stat(2) manpage: +> +> =A0 =A0 =A0 The field st_ctime is changed by writing or by setting =A0= +inode =A0informa- +> =A0 =A0 =A0 tion (i.e., owner, group, link count, mode, etc.). +> +> > Note that Ext4 appears to have a file creation time field in its in= +ode +> > (struct ext4_inode::i_crtime[_extra]). =A0Can Samba be made to use = +that? +> > +> +> Is it exposed to userspace in any (standard) way? It would be handy t= +o +> have that. While we're wishing...it might also be nice to have a +> standard way to get at the i_generation from userspace too. +> + +Yes - I have talked with MingMing and Aneesh about those (NFS may +someday be able to use those too).=A0 An obstacle in the past had been +that samba server stores its own fake creation time in an ndr encoded +xattr which complicates things. + +MingMing/Annesh - +Xattr or other way to get at birth time? + + +-- +Thanks, + +Steve + + diff --git a/test/corpora/lkml/cur/1382298770.003171:2, b/test/corpora/lkml/cur/1382298770.003171:2, new file mode 100644 index 00000000..66e425ef --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.003171:2, @@ -0,0 +1,174 @@ +From: Mingming Cao <mcao@us.ibm.com> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and + register them +Date: Fri, 25 Jun 2010 17:52:24 -0700 +Lines: 92 +Message-ID: <OFB55E8EC7.E8DD23D5-ON8725774E.0004921E-8825774E.0004CC31@us.ibm.com> +References: <20100625125306.7f9b1966@tlielax.poochiereds.net> <4C24A606.5040001@suse.de> + <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <9822.1277312573@redhat.com> + <22697.1277470549@redhat.com> <18628.1277502398@redhat.com> <20100625182651.36800d06@tlielax.poochiereds.net> + <AANLkTilOTrHLvLv4XWYZO6xCnYZgYT7gO2M-oKZ6VvqM@mail.gmail.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: quoted-printable +Cc: linux-cifs@vger.kernel.org, Jeff Layton <jlayton@redhat.com>, + samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, + David Howells <dhowells@redhat.com>, linux-fsdevel@vger.kernel.org, + "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> +To: Steve French <smfrench@gmail.com> +X-From: samba-technical-bounces@lists.samba.org Sat Jun 26 13:36:56 2010 +Return-path: <samba-technical-bounces@lists.samba.org> +Envelope-to: gnsi-samba-technical@m.gmane.org +Received: from fn.samba.org ([216.83.154.106] helo=lists.samba.org) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <samba-technical-bounces@lists.samba.org>) + id 1OSTgu-00025d-6P + for gnsi-samba-technical@m.gmane.org; Sat, 26 Jun 2010 13:36:56 +0200 +Received: from fn.samba.org (localhost [127.0.0.1]) + by lists.samba.org (Postfix) with ESMTP id 1ED11AD2C4; + Sat, 26 Jun 2010 05:36:45 -0600 (MDT) +X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org +X-Spam-Level: +X-Spam-Status: No, score=-6.6 required=3.8 tests=BAYES_00,HTML_MESSAGE, + RCVD_IN_DNSWL_MED,SPF_PASS autolearn=ham version=3.2.5 +X-Original-To: samba-technical@lists.samba.org +Delivered-To: samba-technical@lists.samba.org +Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) + by lists.samba.org (Postfix) with ESMTP id 30F90AD282 + for <samba-technical@lists.samba.org>; + Fri, 25 Jun 2010 18:52:24 -0600 (MDT) +Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com + [9.17.195.226]) + by e34.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o5Q0iN1h017083 + for <samba-technical@lists.samba.org>; Fri, 25 Jun 2010 18:44:23 -0600 +Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) + by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id + o5Q0qQTN175324 + for <samba-technical@lists.samba.org>; Fri, 25 Jun 2010 18:52:26 -0600 +Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) + by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP + id o5Q0qPCF006767 + for <samba-technical@lists.samba.org>; Fri, 25 Jun 2010 18:52:26 -0600 +Received: from d03nm128.boulder.ibm.com (d03nm128.boulder.ibm.com + [9.17.195.32]) + by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id + o5Q0qPrh006760; Fri, 25 Jun 2010 18:52:25 -0600 +In-Reply-To: <AANLkTilOTrHLvLv4XWYZO6xCnYZgYT7gO2M-oKZ6VvqM@mail.gmail.com> +X-KeepSent: B55E8EC7:E8DD23D5-8725774E:0004921E; + type=4; name=$KeepSent +X-Mailer: Lotus Notes Build V852_M2_03302010 March 30, 2010 +X-MIMETrack: Serialize by Router on D03NM128/03/M/IBM(Release 8.0.1|February + 07, 2008) at 06/25/2010 18:52:25 +X-Mailman-Approved-At: Sat, 26 Jun 2010 05:36:42 -0600 +X-Content-Filtered-By: Mailman/MimeDel 2.1.12 +X-BeenThere: samba-technical@lists.samba.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Discussions on Samba internals. For general questions please + subscribe to the list samba@samba.org" + <samba-technical.lists.samba.org> +List-Unsubscribe: <https://lists.samba.org/mailman/options/samba-technical>, + <mailto:samba-technical-request@lists.samba.org?subject=unsubscribe> +List-Archive: <http://lists.samba.org/pipermail/samba-technical> +List-Post: <mailto:samba-technical@lists.samba.org> +List-Help: <mailto:samba-technical-request@lists.samba.org?subject=help> +List-Subscribe: <https://lists.samba.org/mailman/listinfo/samba-technical>, + <mailto:samba-technical-request@lists.samba.org?subject=subscribe> +Sender: samba-technical-bounces@lists.samba.org +Errors-To: samba-technical-bounces@lists.samba.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003208> + + + +Steve French <smfrench@gmail.com> wrote on 06/25/2010 04:05:30 PM: + +> Steve French <smfrench@gmail.com> +> 06/25/2010 04:05 PM +> +> To +> +> Jeff Layton <jlayton@samba.org>, "Aneesh Kumar K.V" +> <aneesh.kumar@linux.vnet.ibm.com>, Mingming Cao/Beaverton/IBM@IBMUS +> +> cc +> +> David Howells <dhowells@redhat.com>, Suresh Jayaraman +> <sjayaraman@suse.de>, linux-cifs@vger.kernel.org, linux- +> fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, samba- +> technical@lists.samba.org, Jeff Layton <jlayton@redhat.com> +> +> Subject +> +> Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and +> register them +> +> On Fri, Jun 25, 2010 at 5:26 PM, Jeff Layton <jlayton@samba.org> wrot= +e: +> > +> > On Fri, 25 Jun 2010 22:46:38 +0100 +> > David Howells <dhowells@redhat.com> wrote: +> > +> > > Jeff Layton <jlayton@samba.org> wrote: +> > > +> > > > Looks like it mostly uses the ctime. IMO, the mtime would be a +better +> > > > choice since it changes less frequently, but I don't guess that= + it +> > > > matters very much. +> > > +> > > I'd've thought mtime changes more frequently since that's +> altered when data is +> > > written. =A0ctime is changed when attributes are changed. +> > > +> > +> > IIUC, updating mtime for a write is also an attribute change, and t= +hat +> > affects ctime. According to the stat(2) manpage: +> > +> > =A0 =A0 =A0 The field st_ctime is changed by writing or by setting +> =A0inode =A0informa- +> > =A0 =A0 =A0 tion (i.e., owner, group, link count, mode, etc.). +> > +> > > Note that Ext4 appears to have a file creation time field in its +inode +> > > (struct ext4_inode::i_crtime[_extra]). =A0Can Samba be made to us= +e +that? +> > > +> > +> > Is it exposed to userspace in any (standard) way? It would be handy= + to +> > have that. While we're wishing...it might also be nice to have a +> > standard way to get at the i_generation from userspace too. +> > +> +> Yes - I have talked with MingMing and Aneesh about those (NFS may +> someday be able to use those too).=A0 An obstacle in the past had bee= +n +> that samba server stores its own fake creation time in an ndr encoded= + +> xattr which complicates things. +> +> MingMing/Annesh - +> Xattr or other way to get at birth time? +> +> + +Not yet, + The ext4 file creation time only accesable from the kernel at the mome= +nt. +There were discussion +to make this information avaliable via xattr before, but was rejected, +since most people +agree that making this info avalibele via stat() is more standard. Howe= +ver +modifying stat() would imply +big interface change. thus no action has been taken yet. + +> -- +> Thanks, +> +> Steve= + + + diff --git a/test/corpora/lkml/cur/1382298770.003317:2, b/test/corpora/lkml/cur/1382298770.003317:2, new file mode 100644 index 00000000..6fce5182 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.003317:2, @@ -0,0 +1,156 @@ +From: "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and register them +Date: Sun, 27 Jun 2010 23:47:21 +0530 +Lines: 100 +Message-ID: <871vbscpce.fsf@linux.vnet.ibm.com> +References: <20100625125306.7f9b1966@tlielax.poochiereds.net> <4C24A606.5040001@suse.de> <1277220214-3597-1-git-send-email-sjayaraman@suse.de> <9822.1277312573@redhat.com> <22697.1277470549@redhat.com> <18628.1277502398@redhat.com> <20100625182651.36800d06@tlielax.poochiereds.net> <AANLkTilOTrHLvLv4XWYZO6xCnYZgYT7gO2M-oKZ6VvqM@mail.gmail.com> <OFB55E8EC7.E8DD23D5-ON8725774E.0004921E-8825774E.0004CC31@us.ibm.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: QUOTED-PRINTABLE +Cc: David Howells <dhowells@redhat.com>, + Jeff Layton <jlayton@redhat.com>, + Jeff Layton <jlayton@samba.org>, linux-cifs@vger.kernel.org, + linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, + samba-technical@lists.samba.org, + Suresh Jayaraman <sjayaraman@suse.de> +To: Mingming Cao <mcao@us.ibm.com>, Steve French <smfrench@gmail.com>, + "DENIEL Philippe" <philippe.deniel@cea.fr> +X-From: linux-kernel-owner@vger.kernel.org Sun Jun 27 20:18:00 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OSwQZ-0003Kh-Vu + for glk-linux-kernel-3@lo.gmane.org; Sun, 27 Jun 2010 20:18:00 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1754631Ab0F0SRq convert rfc822-to-quoted-printable (ORCPT + <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 27 Jun 2010 14:17:46 -0400 +Received: from e23smtp07.au.ibm.com ([202.81.31.140]:52430 "EHLO + e23smtp07.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1753837Ab0F0SRl convert rfc822-to-8bit (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Sun, 27 Jun 2010 14:17:41 -0400 +Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) + by e23smtp07.au.ibm.com (8.14.4/8.13.1) with ESMTP id o5RIHbfJ012483; + Mon, 28 Jun 2010 04:17:37 +1000 +Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) + by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o5RIHW9f1130634; + Mon, 28 Jun 2010 04:17:32 +1000 +Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) + by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o5RIHVcR027534; + Mon, 28 Jun 2010 04:17:32 +1000 +Received: from skywalker.linux.vnet.ibm.com ([9.77.196.78]) + by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o5RIHMFl027485; + Mon, 28 Jun 2010 04:17:24 +1000 +In-Reply-To: <OFB55E8EC7.E8DD23D5-ON8725774E.0004921E-8825774E.0004CC31@us.ibm.com> +User-Agent: Notmuch/ (http://notmuchmail.org) Emacs/24.0.50.1 (i686-pc-linux-gnu) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003357> + +On Fri, 25 Jun 2010 17:52:24 -0700, Mingming Cao <mcao@us.ibm.com> wrot= +e: +>=20 +>=20 +> Steve French <smfrench@gmail.com> wrote on 06/25/2010 04:05:30 PM: +>=20 +> > Steve French <smfrench@gmail.com> +> > 06/25/2010 04:05 PM +> > +> > To +> > +> > Jeff Layton <jlayton@samba.org>, "Aneesh Kumar K.V" +> > <aneesh.kumar@linux.vnet.ibm.com>, Mingming Cao/Beaverton/IBM@IBMUS +> > +> > cc +> > +> > David Howells <dhowells@redhat.com>, Suresh Jayaraman +> > <sjayaraman@suse.de>, linux-cifs@vger.kernel.org, linux- +> > fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, samba- +> > technical@lists.samba.org, Jeff Layton <jlayton@redhat.com> +> > +> > Subject +> > +> > Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and +> > register them +> > +> > On Fri, Jun 25, 2010 at 5:26 PM, Jeff Layton <jlayton@samba.org> wr= +ote: +> > > +> > > On Fri, 25 Jun 2010 22:46:38 +0100 +> > > David Howells <dhowells@redhat.com> wrote: +> > > +> > > > Jeff Layton <jlayton@samba.org> wrote: +> > > > +> > > > > Looks like it mostly uses the ctime. IMO, the mtime would be = +a +> better +> > > > > choice since it changes less frequently, but I don't guess th= +at it +> > > > > matters very much. +> > > > +> > > > I'd've thought mtime changes more frequently since that's +> > altered when data is +> > > > written. =C2=A0ctime is changed when attributes are changed. +> > > > +> > > +> > > IIUC, updating mtime for a write is also an attribute change, and= + that +> > > affects ctime. According to the stat(2) manpage: +> > > +> > > =C2=A0 =C2=A0 =C2=A0 The field st_ctime is changed by writing or = +by setting +> > =C2=A0inode =C2=A0informa- +> > > =C2=A0 =C2=A0 =C2=A0 tion (i.e., owner, group, link count, mode, = +etc.). +> > > +> > > > Note that Ext4 appears to have a file creation time field in it= +s +> inode +> > > > (struct ext4_inode::i_crtime[_extra]). =C2=A0Can Samba be made = +to use +> that? +> > > > +> > > +> > > Is it exposed to userspace in any (standard) way? It would be han= +dy to +> > > have that. While we're wishing...it might also be nice to have a +> > > standard way to get at the i_generation from userspace too. +> > > +> > +> > Yes - I have talked with MingMing and Aneesh about those (NFS may +> > someday be able to use those too).=C2=A0 An obstacle in the past ha= +d been +> > that samba server stores its own fake creation time in an ndr encod= +ed +> > xattr which complicates things. +> > +> > MingMing/Annesh - +> > Xattr or other way to get at birth time? +> > +> > +>=20 +> Not yet, +> The ext4 file creation time only accesable from the kernel at the mo= +ment. +> There were discussion +> to make this information avaliable via xattr before, but was rejected= +, +> since most people +> agree that making this info avalibele via stat() is more standard. Ho= +wever +> modifying stat() would imply +> big interface change. thus no action has been taken yet. + +NFS ganesha pNFS also had a requirement for getting i_generation and +inode number in userspace. So may be we should now look at updating +stat or add a variant syscall that include i_generation and create time +in the return value + +-aneesh + + diff --git a/test/corpora/lkml/cur/1382298770.003318:2, b/test/corpora/lkml/cur/1382298770.003318:2, new file mode 100644 index 00000000..058d1477 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.003318:2, @@ -0,0 +1,66 @@ +From: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> +Subject: Re: [RFC][PATCH 06/10] cifs: define inode-level cache object and + register them +Date: Sun, 27 Jun 2010 14:22:29 -0400 +Lines: 9 +Message-ID: <20100627182229.GA492@infradead.org> +References: <20100625125306.7f9b1966@tlielax.poochiereds.net> + <4C24A606.5040001@suse.de> + <1277220214-3597-1-git-send-email-sjayaraman@suse.de> + <9822.1277312573@redhat.com> + <22697.1277470549@redhat.com> + <18628.1277502398@redhat.com> + <20100625182651.36800d06@tlielax.poochiereds.net> + <AANLkTilOTrHLvLv4XWYZO6xCnYZgYT7gO2M-oKZ6VvqM@mail.gmail.com> + <OFB55E8EC7.E8DD23D5-ON8725774E.0004921E-8825774E.0004CC31@us.ibm.com> + <871vbscpce.fsf@linux.vnet.ibm.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: Mingming Cao <mcao-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>, Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, + DENIEL Philippe <philippe.deniel-KCE40YydGKI@public.gmane.org>, + David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>, + Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>, + Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org, + Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +To: "Aneesh Kumar K. V" <aneesh.kumar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Sun Jun 27 20:22:46 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OSwVB-0005TI-SG + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Sun, 27 Jun 2010 20:22:46 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1752811Ab0F0SWo (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Sun, 27 Jun 2010 14:22:44 -0400 +Received: from bombadil.infradead.org ([18.85.46.34]:55433 "EHLO + bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752728Ab0F0SWn (ORCPT + <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); Sun, 27 Jun 2010 14:22:43 -0400 +Received: from hch by bombadil.infradead.org with local (Exim 4.72 #1 (Red Hat Linux)) + id 1OSwUv-00009z-9N; Sun, 27 Jun 2010 18:22:29 +0000 +Content-Disposition: inline +In-Reply-To: <871vbscpce.fsf-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> +User-Agent: Mutt/1.5.20 (2009-08-17) +X-SRS-Rewrite: SMTP reverse-path rewritten from <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> by bombadil.infradead.org + See http://www.infradead.org/rpr.html +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003358> + +On Sun, Jun 27, 2010 at 11:47:21PM +0530, Aneesh Kumar K. V wrote: +> NFS ganesha pNFS also had a requirement for getting i_generation and +> inode number in userspace. So may be we should now look at updating +> stat or add a variant syscall that include i_generation and create time +> in the return value + +What's missing in knfsd that you feel the sudden urge to move backwards +to a userspace nfsd (one with a horribly crappy codebase, too). + + + diff --git a/test/corpora/lkml/cur/1382298770.003486:2, b/test/corpora/lkml/cur/1382298770.003486:2, new file mode 100644 index 00000000..8831b450 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.003486:2, @@ -0,0 +1,89 @@ +From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> +Subject: Re: [RFC][PATCH 05/10] cifs: define superblock-level cache index + objects and register them +Date: Mon, 28 Jun 2010 18:23:13 +0530 +Lines: 48 +Message-ID: <4C289B39.4060901@suse.de> +References: <22746.1277470713@redhat.com> <4C24A4A0.90408@suse.de> <1277220206-3559-1-git-send-email-sjayaraman@suse.de> <yes> <9720.1277312290@redhat.com> <23204.1277472412@redhat.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 7bit +Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +X-From: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Mon Jun 28 14:53:24 2010 +Return-path: <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1OTDq0-00054Q-At + for glkc-linux-cifs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Mon, 28 Jun 2010 14:53:24 +0200 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1754503Ab0F1MxX (ORCPT <rfc822;glkc-linux-cifs@m.gmane.org>); + Mon, 28 Jun 2010 08:53:23 -0400 +Received: from cantor2.suse.de ([195.135.220.15]:48374 "EHLO mx2.suse.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1754456Ab0F1MxW (ORCPT <rfc822;linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Mon, 28 Jun 2010 08:53:22 -0400 +Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) + by mx2.suse.de (Postfix) with ESMTP id 7BDC18672B; + Mon, 28 Jun 2010 14:53:21 +0200 (CEST) +User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 +In-Reply-To: <23204.1277472412-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> +Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-cifs.vger.kernel.org> +X-Mailing-List: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003530> + +On 06/25/2010 06:56 PM, David Howells wrote: +> David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: +> +>>>> validate the root directory of the share in some way? +>>> +>>> I don't know if there is a way to do this. +>> +>> Is there an inode number or something? Even the creation time might do. +> +> Looking in cifspdu.h, there are a number of things that it might be possible +> to use. +> +> (1) FILE_ALL_INFO: CreationTime, IndexNumber, IndexNumber1, FileName +> (assuming this isn't flattened to '\' or something for the root of a +> share. +> +> (2) FILE_UNIX_BASIC_INFO: DevMajor, DevMinor, UniqueId. +> +> (3) FILE_INFO_STANDARD: CreationDate, CreationTime. +> +> (4) FILE_INFO_BASIC: CreationTime. +> +> (5) FILE_DIRECTORY_INFO: FileIndex, CreationTime, FileName. +> +> (6) SEARCH_ID_FULL_DIR_INFO: FileIndex, CreationTime, UniqueId, FileName. +> +> (7) FILE_BOTH_DIRECTORY_INFO: FileIndex, CreationTime, ShortName, FileName. +> +> (8) OPEN_RSP_EXT: Fid, CreationTime, VolumeGUID, FileId. +> +> You may have to choose different sets of things, depending on what the server +> has on offer. Also, don't forget, if you can't work out whether a share is + +Did you mean we need to validate differently for different servers? + +I just did some testing and it looks like we could rely on CreationTime, +IndexNumber for validating with Windows servers (FileName is relative to +the mapped drive) and UniqueId for validating with Samba servers. I did +not test all possibilities (there could be more). + +> coherent or not from the above, you can always use LastWriteTime, ChangeTime +> and EndOfFile and just discard the whole subtree if they differ. +> + +Thanks, + +-- +Suresh Jayaraman + + diff --git a/test/corpora/lkml/cur/1382298770.003499:2, b/test/corpora/lkml/cur/1382298770.003499:2, new file mode 100644 index 00000000..b10adc4e --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.003499:2, @@ -0,0 +1,63 @@ +From: David Howells <dhowells@redhat.com> +Subject: Re: [RFC][PATCH 05/10] cifs: define superblock-level cache index objects and register them +Date: Mon, 28 Jun 2010 14:24:45 +0100 +Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley + Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United + Kingdom. + Registered in England and Wales under Company Registration No. 3798903 +Lines: 17 +Message-ID: <9513.1277731485@redhat.com> +References: <4C289B39.4060901@suse.de> <22746.1277470713@redhat.com> <4C24A4A0.90408@suse.de> <1277220206-3559-1-git-send-email-sjayaraman@suse.de> <yes> <9720.1277312290@redhat.com> <23204.1277472412@redhat.com> +Cc: dhowells@redhat.com, Steve French <smfrench@gmail.com>, + linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Suresh Jayaraman <sjayaraman@suse.de> +X-From: linux-fsdevel-owner@vger.kernel.org Mon Jun 28 15:24:57 2010 +Return-path: <linux-fsdevel-owner@vger.kernel.org> +Envelope-to: lnx-linux-fsdevel@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-fsdevel-owner@vger.kernel.org>) + id 1OTEKW-00048k-S3 + for lnx-linux-fsdevel@lo.gmane.org; Mon, 28 Jun 2010 15:24:57 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1751608Ab0F1NYz (ORCPT <rfc822;lnx-linux-fsdevel@m.gmane.org>); + Mon, 28 Jun 2010 09:24:55 -0400 +Received: from mx1.redhat.com ([209.132.183.28]:26085 "EHLO mx1.redhat.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751395Ab0F1NYy (ORCPT <rfc822;linux-fsdevel@vger.kernel.org>); + Mon, 28 Jun 2010 09:24:54 -0400 +Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) + by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5SDOmfA019811 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Mon, 28 Jun 2010 09:24:49 -0400 +Received: from redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) + by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5SDOjHf030340; + Mon, 28 Jun 2010 09:24:47 -0400 +In-Reply-To: <4C289B39.4060901@suse.de> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 +Sender: linux-fsdevel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-fsdevel.vger.kernel.org> +X-Mailing-List: linux-fsdevel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1003543> + +Suresh Jayaraman <sjayaraman@suse.de> wrote: + +> Did you mean we need to validate differently for different servers? + +You may need to, yes, as different servers may make different attributes +available. + +This isn't too bad. Each server index record in the cache has freeform +auxiliary data, just as does each file data record. You could, say, stick a +byte at the front that indicates what you've stored in there. + +David +-- +To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298770.004581:2, b/test/corpora/lkml/cur/1382298770.004581:2, new file mode 100644 index 00000000..732bfa09 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.004581:2, @@ -0,0 +1,92 @@ +From: Timur Tabi <timur.tabi@gmail.com> +Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Date: Wed, 30 Jun 2010 15:55:58 -0500 +Lines: 33 +Message-ID: <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> +References: <20100308191005.GE4324@amak.tundra.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: QUOTED-PRINTABLE +Cc: mporter@kernel.crashing.org, linux-kernel@vger.kernel.org, + linuxppc-dev@lists.ozlabs.org, thomas.moll@sysgo.com +To: Alexandre Bounine <abounine@tundra.com> +X-From: linux-kernel-owner@vger.kernel.org Wed Jun 30 22:56:40 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OU4Kl-0005Kf-V4 + for glk-linux-kernel-3@lo.gmane.org; Wed, 30 Jun 2010 22:56:40 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1756668Ab0F3U4b convert rfc822-to-quoted-printable (ORCPT + <rfc822;glk-linux-kernel-3@m.gmane.org>); + Wed, 30 Jun 2010 16:56:31 -0400 +Received: from mail-vw0-f46.google.com ([209.85.212.46]:41333 "EHLO + mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1753416Ab0F3U43 convert rfc822-to-8bit (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Wed, 30 Jun 2010 16:56:29 -0400 +Received: by vws5 with SMTP id 5so1449398vws.19 + for <linux-kernel@vger.kernel.org>; Wed, 30 Jun 2010 13:56:28 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:received:mime-version:received:in-reply-to + :references:from:date:message-id:subject:to:cc:content-type + :content-transfer-encoding; + bh=FTlit9cHTz/9rLGcvA5/pEZlzxAQ5x20v8HE5XYFwYM=; + b=NFbjnxZ4KwcjTy4tFh+BnhWPEGeYTw6z918yIouRaMmbEDph56xq26K9aTBokuYHqe + UgFjBn7XWcxvqJPyCetfsDRG+F3M2XwCq/DSCswSPtXSLsy8WKm7cMXVS3hjiO8sMZ97 + mRMGZkYBJHjWP+ulkBXiq6q7/OQuE8Dkl+rWM= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=mime-version:in-reply-to:references:from:date:message-id:subject:to + :cc:content-type:content-transfer-encoding; + b=r0N6AOAg+TSvY2kPQPahldj4iRU9oUoSLtHA7JXG2QU4CR9O5GBhxAtr2aY99qUPZd + tFS0ZWRAb9cmOgiZhTpNxsBjCJ/e/DQ1ccP5rZ/U40q1SJ1KwN92hqpOoppZ0tkqSB7/ + UlQtsvPSK7a0bYqufEmscfAi98w1+mfZIbK6U= +Received: by 10.220.161.203 with SMTP id s11mr5093041vcx.195.1277931388141; + Wed, 30 Jun 2010 13:56:28 -0700 (PDT) +Received: by 10.220.161.137 with HTTP; Wed, 30 Jun 2010 13:55:58 -0700 (PDT) +In-Reply-To: <20100308191005.GE4324@amak.tundra.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1004632> + +On Mon, Mar 8, 2010 at 2:10 PM, Alexandre Bounine <abounine@tundra.com>= + wrote: +> +> From: Alexandre Bounine <alexandre.bounine@idt.com> +> +> Add Machine Check exception handling into RapidIO port driver +> for Freescale SoCs (MPC85xx). +> +> Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> +> Tested-by: Thomas Moll <thomas.moll@sysgo.com> +=2E.. + +> +static int fsl_rio_mcheck_exception(struct pt_regs *regs) +> +{ +> + =A0 =A0 =A0 const struct exception_table_entry *entry =3D NULL; +> + =A0 =A0 =A0 unsigned long reason =3D (mfspr(SPRN_MCSR) & MCSR_MASK)= +; + +MCSR_MASK is not defined anywhere, so when I compile this code, I get t= +his: + + CC arch/powerpc/sysdev/fsl_rio.o +arch/powerpc/sysdev/fsl_rio.c: In function 'fsl_rio_mcheck_exception': +arch/powerpc/sysdev/fsl_rio.c:248: error: 'MCSR_MASK' undeclared +(first use in this function) +arch/powerpc/sysdev/fsl_rio.c:248: error: (Each undeclared identifier +is reported only once +arch/powerpc/sysdev/fsl_rio.c:248: error: for each function it appears = +in.) + +--=20 +Timur Tabi +Linux kernel developer at Freescale + + diff --git a/test/corpora/lkml/cur/1382298770.004582:2, b/test/corpora/lkml/cur/1382298770.004582:2, new file mode 100644 index 00000000..d149b721 --- /dev/null +++ b/test/corpora/lkml/cur/1382298770.004582:2, @@ -0,0 +1,68 @@ +From: Timur Tabi <timur.tabi@gmail.com> +Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Date: Wed, 30 Jun 2010 16:00:56 -0500 +Lines: 12 +Message-ID: <AANLkTinKbimKyLpvFD7KOvavshu_n8gRcp2BvEJj0XZQ@mail.gmail.com> +References: <20100308191005.GE4324@amak.tundra.com> <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1 +Cc: mporter@kernel.crashing.org, linux-kernel@vger.kernel.org, + linuxppc-dev@lists.ozlabs.org, thomas.moll@sysgo.com +To: Alexandre Bounine <abounine@tundra.com> +X-From: linux-kernel-owner@vger.kernel.org Wed Jun 30 23:01:37 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OU4PZ-0000HS-0T + for glk-linux-kernel-3@lo.gmane.org; Wed, 30 Jun 2010 23:01:37 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1755703Ab0F3VB2 (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Wed, 30 Jun 2010 17:01:28 -0400 +Received: from mail-vw0-f46.google.com ([209.85.212.46]:53141 "EHLO + mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751784Ab0F3VB1 (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Wed, 30 Jun 2010 17:01:27 -0400 +Received: by vws5 with SMTP id 5so1454517vws.19 + for <linux-kernel@vger.kernel.org>; Wed, 30 Jun 2010 14:01:26 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:received:mime-version:received:in-reply-to + :references:from:date:message-id:subject:to:cc:content-type; + bh=+BUKti+Oa03CrnVvRyT591FhcoxqR7S2rzZHtD6WSuY=; + b=O/b04HLJrmTE0aIq2mNCRznQrXxAAGHSMarHR5mrgYptmr68froM6UgmDqTZFLhNiH + BcT8g+AziiqSV1k/ckXjRyVR0s9Jdv4g2phMNtp8NStbPfOPpLDkUKTQadphOTonCfeK + e+ZrLBwh+FCoYNAOjvFioBKj6CxN2Oi5xIhPc= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=mime-version:in-reply-to:references:from:date:message-id:subject:to + :cc:content-type; + b=UcKGhJIXCTTcSvBWwGwLUefPONGygVPsUnTt4nDSl4udB8JKMyi0EghzzgNXUyq4Dz + UCxzZAyxzjvjgsgPS3kzPhSsWG2PRG66pC1OA68RJ5YVOjt55/yOz/yfTqXBVvRSq2fV + QNcKACYHSjkIZ7Uq7ZEW9bEGI5tTKdz++N2UA= +Received: by 10.220.124.73 with SMTP id t9mr5099129vcr.37.1277931686462; Wed, + 30 Jun 2010 14:01:26 -0700 (PDT) +Received: by 10.220.161.137 with HTTP; Wed, 30 Jun 2010 14:00:56 -0700 (PDT) +In-Reply-To: <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1004633> + +On Wed, Jun 30, 2010 at 3:55 PM, Timur Tabi <timur.tabi@gmail.com> wrote: + +> MCSR_MASK is not defined anywhere, so when I compile this code, I get this: + +Never mind. I see that it's been fixed already, and that the patch +that removed MCSR_MASK was posted around the same time that this patch +was posted. + + +-- +Timur Tabi +Linux kernel developer at Freescale + + diff --git a/test/corpora/lkml/cur/1382298775.002830:2, b/test/corpora/lkml/cur/1382298775.002830:2, new file mode 100644 index 00000000..1bf40bcd --- /dev/null +++ b/test/corpora/lkml/cur/1382298775.002830:2, @@ -0,0 +1,60 @@ +From: Michael Neuling <mikey@neuling.org> +Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Date: Tue, 03 Aug 2010 16:06:30 +1000 +Lines: 15 +Message-ID: <4381.1280815590@neuling.org> +References: <20100308191005.GE4324@amak.tundra.com> <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> <AANLkTinKbimKyLpvFD7KOvavshu_n8gRcp2BvEJj0XZQ@mail.gmail.com> +Cc: Alexandre Bounine <abounine@tundra.com>, + linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, + thomas.moll@sysgo.com +To: Timur Tabi <timur.tabi@gmail.com> +X-From: linux-kernel-owner@vger.kernel.org Tue Aug 03 08:06:45 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OgAeD-00087x-ED + for glk-linux-kernel-3@lo.gmane.org; Tue, 03 Aug 2010 08:06:45 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1755287Ab0HCGGf (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 3 Aug 2010 02:06:35 -0400 +Received: from ozlabs.org ([203.10.76.45]:51158 "EHLO ozlabs.org" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1755139Ab0HCGGd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Tue, 3 Aug 2010 02:06:33 -0400 +Received: from localhost.localdomain (localhost [127.0.0.1]) + by ozlabs.org (Postfix) with ESMTP id B7A371007D1; + Tue, 3 Aug 2010 16:06:31 +1000 (EST) +Received: by localhost.localdomain (Postfix, from userid 1000) + id EDBB7C5EB7; Tue, 3 Aug 2010 16:06:30 +1000 (EST) +Received: from neuling.org (localhost [127.0.0.1]) + by localhost.localdomain (Postfix) with ESMTP id E8003C51D3; + Tue, 3 Aug 2010 16:06:30 +1000 (EST) +In-reply-to: <AANLkTinKbimKyLpvFD7KOvavshu_n8gRcp2BvEJj0XZQ@mail.gmail.com> +Comments: In-reply-to Timur Tabi <timur.tabi@gmail.com> + message dated "Wed, 30 Jun 2010 16:00:56 -0500." +X-Mailer: MH-E 8.2; nmh 1.3; GNU Emacs 23.1.1 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1017846> + +> > MCSR_MASK is not defined anywhere, so when I compile this code, I get this: +> +> Never mind. I see that it's been fixed already, and that the patch +> that removed MCSR_MASK was posted around the same time that this patch +> was posted. + +I don't know what happened here but 2.6.35 is broken because of this +problem: + +arch/powerpc/sysdev/fsl_rio.c:248: error: 'MCSR_MASK' undeclared (first use in this function) +arch/powerpc/sysdev/fsl_rio.c:248: error: (Each undeclared identifier is reported only once +arch/powerpc/sysdev/fsl_rio.c:248: error: for each function it appears in.) +arch/powerpc/sysdev/fsl_rio.c:250: error: 'MCSR_BUS_RBERR' undeclared (first use in this function) + +Mikey + + diff --git a/test/corpora/lkml/cur/1382298775.002978:2, b/test/corpora/lkml/cur/1382298775.002978:2, new file mode 100644 index 00000000..21e2a10a --- /dev/null +++ b/test/corpora/lkml/cur/1382298775.002978:2, @@ -0,0 +1,91 @@ +From: "Bounine, Alexandre" <Alexandre.Bounine@idt.com> +Subject: RE: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Date: Tue, 3 Aug 2010 05:17:54 -0700 +Lines: 34 +Message-ID: <0CE8B6BE3C4AD74AB97D9D29BD24E5520114309D@CORPEXCH1.na.ads.idt.com> +References: <20100308191005.GE4324@amak.tundra.com> <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> <AANLkTinKbimKyLpvFD7KOvavshu_n8gRcp2BvEJj0XZQ@mail.gmail.com> <4381.1280815590@neuling.org> +Mime-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 8BIT +Cc: "Alexandre Bounine" <abounine@tundra.com>, + <linuxppc-dev@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>, + <thomas.moll@sysgo.com> +To: "Michael Neuling" <mikey@neuling.org>, + "Timur Tabi" <timur.tabi@gmail.com> +X-From: linux-kernel-owner@vger.kernel.org Tue Aug 03 14:27:12 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OgGaG-0002zE-Fr + for glk-linux-kernel-3@lo.gmane.org; Tue, 03 Aug 2010 14:27:04 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1756073Ab0HCM0x (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 3 Aug 2010 08:26:53 -0400 +Received: from mxout1.idt.com ([157.165.5.25]:35046 "EHLO mxout1.idt.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1756010Ab0HCM0w convert rfc822-to-8bit (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Tue, 3 Aug 2010 08:26:52 -0400 +X-Greylist: delayed 521 seconds by postgrey-1.27 at vger.kernel.org; Tue, 03 Aug 2010 08:26:52 EDT +Received: from mail.idt.com (localhost [127.0.0.1]) + by mxout1.idt.com (8.13.1/8.13.1) with ESMTP id o73CHxil001904; + Tue, 3 Aug 2010 05:17:59 -0700 +Received: from corpml3.corp.idt.com (corpml3.corp.idt.com [157.165.140.25]) + by mail.idt.com (8.13.8/8.13.8) with ESMTP id o73CHvit016488; + Tue, 3 Aug 2010 05:17:57 -0700 (PDT) +Received: from CORPEXCH1.na.ads.idt.com (localhost [127.0.0.1]) + by corpml3.corp.idt.com (8.11.7p1+Sun/8.11.7) with ESMTP id o73CHtN07516; + Tue, 3 Aug 2010 05:17:55 -0700 (PDT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +In-Reply-To: <4381.1280815590@neuling.org> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Thread-Index: Acsy0pTOmhzzm4GETvS4r2R2pYb40wAMtx8w +X-Scanned-By: MIMEDefang 2.43 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1017995> + +This happened after change to book-e definitions. +There are patches that address this issue. + +> -----Original Message----- +> From: Michael Neuling [mailto:mikey@neuling.org] +> Sent: Tuesday, August 03, 2010 2:07 AM +> To: Timur Tabi +> Cc: Alexandre Bounine; linuxppc-dev@lists.ozlabs.org; +linux-kernel@vger.kernel.org; +> thomas.moll@sysgo.com +> Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO +port +> +> > > MCSR_MASK is not defined anywhere, so when I compile this code, I +get this: +> > +> > Never mind. I see that it's been fixed already, and that the patch +> > that removed MCSR_MASK was posted around the same time that this +patch +> > was posted. +> +> I don't know what happened here but 2.6.35 is broken because of this +> problem: +> +> arch/powerpc/sysdev/fsl_rio.c:248: error: 'MCSR_MASK' undeclared +(first use in this function) +> arch/powerpc/sysdev/fsl_rio.c:248: error: (Each undeclared identifier +is reported only once +> arch/powerpc/sysdev/fsl_rio.c:248: error: for each function it appears +in.) +> arch/powerpc/sysdev/fsl_rio.c:250: error: 'MCSR_BUS_RBERR' undeclared +(first use in this function) +> +> Mikey + + diff --git a/test/corpora/lkml/cur/1382298775.002992:2, b/test/corpora/lkml/cur/1382298775.002992:2, new file mode 100644 index 00000000..0f11acd5 --- /dev/null +++ b/test/corpora/lkml/cur/1382298775.002992:2, @@ -0,0 +1,87 @@ +From: Timur Tabi <timur@freescale.com> +Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Date: Tue, 3 Aug 2010 08:01:51 -0500 +Lines: 25 +Message-ID: <AANLkTinpwYnyc1oN1VbtBgUF6bk6E5q_Gq1Dj3WXV3wc@mail.gmail.com> +References: <20100308191005.GE4324@amak.tundra.com> <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> + <AANLkTinKbimKyLpvFD7KOvavshu_n8gRcp2BvEJj0XZQ@mail.gmail.com> + <4381.1280815590@neuling.org> <0CE8B6BE3C4AD74AB97D9D29BD24E5520114309D@CORPEXCH1.na.ads.idt.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1 +Cc: Michael Neuling <mikey@neuling.org>, + Alexandre Bounine <abounine@tundra.com>, + linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, + thomas.moll@sysgo.com, Kumar Gala <galak@kernel.crashing.org> +To: "Bounine, Alexandre" <Alexandre.Bounine@idt.com> +X-From: linux-kernel-owner@vger.kernel.org Tue Aug 03 15:02:39 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OgH8b-0003r0-5v + for glk-linux-kernel-3@lo.gmane.org; Tue, 03 Aug 2010 15:02:33 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1756383Ab0HCNCY (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 3 Aug 2010 09:02:24 -0400 +Received: from mail-qy0-f181.google.com ([209.85.216.181]:47377 "EHLO + mail-qy0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1754253Ab0HCNCX (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Tue, 3 Aug 2010 09:02:23 -0400 +Received: by qyk7 with SMTP id 7so647758qyk.19 + for <linux-kernel@vger.kernel.org>; Tue, 03 Aug 2010 06:02:22 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:received:mime-version:sender:received + :in-reply-to:references:from:date:x-google-sender-auth:message-id + :subject:to:cc:content-type; + bh=vTJghTE4Rwcgvgu1RS/86u/ljjztFlVQ5ODYWXBRkUM=; + b=p7S+ZVc0INWI6uXFwsLVTTEnV8wFAB0u0cDLt5qp0gyuMbF9yqXhukSTbYS8Vf8gCk + UFDmrOGjzC1whtvZnRS+Q80vVTR3+1URt/RTCUqirvalLvgluNrzP6sQ3xccFy4LkdLi + nGsgcNEqVwPPZgg3uSqew6B5UIoH7S00YzAYU= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=mime-version:sender:in-reply-to:references:from:date + :x-google-sender-auth:message-id:subject:to:cc:content-type; + b=qNVeIlTzozhY9MXH5PHYIsAL8T7zOBZ+0hWrBlbEy0PiBHW1AAv9nNd6FspugBZVUW + q7iPmhg0n6Oa3KFBNjs42dInyCPUqiQs10rGTQCJsSVITmZ/NA9sf8FFbI+Dg7xQiJKj + TN/8W0tBK9mUiqVvoO1avTKG1hqyMwTdMqlaM= +Received: by 10.224.73.18 with SMTP id o18mr2669587qaj.354.1280840541149; Tue, + 03 Aug 2010 06:02:21 -0700 (PDT) +Received: by 10.220.112.69 with HTTP; Tue, 3 Aug 2010 06:01:51 -0700 (PDT) +In-Reply-To: <0CE8B6BE3C4AD74AB97D9D29BD24E5520114309D@CORPEXCH1.na.ads.idt.com> +X-Google-Sender-Auth: lBedzmn1VMYh0pQjuCJuDw-lNh8 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1018009> + +On Tue, Aug 3, 2010 at 7:17 AM, Bounine, Alexandre +<Alexandre.Bounine@idt.com> wrote: +> This happened after change to book-e definitions. +> There are patches that address this issue. + +And those patches should have been applied before 2.6.35 was released. + Someone dropped the ball. 2.6.35 is broken for a number of PowerPC +boards: + +$ make mpc85xx_defconfig +... +$ make +... + CC arch/powerpc/sysdev/fsl_rio.o +arch/powerpc/sysdev/fsl_rio.c: In function 'fsl_rio_mcheck_exception': +arch/powerpc/sysdev/fsl_rio.c:248: error: 'MCSR_MASK' undeclared +(first use in this function) +arch/powerpc/sysdev/fsl_rio.c:248: error: (Each undeclared identifier +is reported only once +arch/powerpc/sysdev/fsl_rio.c:248: error: for each function it appears in.) +make[1]: *** [arch/powerpc/sysdev/fsl_rio.o] Error 1 + +-- +Timur Tabi +Linux kernel developer at Freescale + + diff --git a/test/corpora/lkml/cur/1382298775.002999:2, b/test/corpora/lkml/cur/1382298775.002999:2, new file mode 100644 index 00000000..e6456b69 --- /dev/null +++ b/test/corpora/lkml/cur/1382298775.002999:2, @@ -0,0 +1,109 @@ +From: "Bounine, Alexandre" <Alexandre.Bounine@idt.com> +Subject: RE: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Date: Tue, 3 Aug 2010 06:24:47 -0700 +Lines: 40 +Message-ID: <0CE8B6BE3C4AD74AB97D9D29BD24E552011430BC@CORPEXCH1.na.ads.idt.com> +References: <20100308191005.GE4324@amak.tundra.com> + <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> + <AANLkTinKbimKyLpvFD7KOvavshu_n8gRcp2BvEJj0XZQ@mail.gmail.com> + <4381.1280815590@neuling.org> + <0CE8B6BE3C4AD74AB97D9D29BD24E5520114309D@CORPEXCH1.na.ads.idt.com> + <AANLkTinpwYnyc1oN1VbtBgUF6bk6E5q_Gq1Dj3WXV3wc@mail.gmail.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Michael Neuling <mikey@neuling.org>, linux-kernel@vger.kernel.org, + Alexandre Bounine <abounine@tundra.com>, thomas.moll@sysgo.com, + linuxppc-dev@lists.ozlabs.org +To: "Timur Tabi" <timur@freescale.com> +X-From: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Tue Aug 03 15:25:22 2010 +Return-path: <linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org> +Envelope-to: glppe-linuxppc-embedded-2@m.gmane.org +Received: from ozlabs.org ([203.10.76.45]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org>) + id 1OgHUd-0006wG-MW + for glppe-linuxppc-embedded-2@m.gmane.org; Tue, 03 Aug 2010 15:25:20 +0200 +Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) + by ozlabs.org (Postfix) with ESMTP id 54FA51007E4 + for <glppe-linuxppc-embedded-2@m.gmane.org>; Tue, 3 Aug 2010 23:25:09 +1000 (EST) +Received: from mxout1.idt.com (mxout1.idt.com [157.165.5.25]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (Client CN "mxout1.idt.com", Issuer "idt.com" (not verified)) + by ozlabs.org (Postfix) with ESMTPS id 5C917B70A6 + for <linuxppc-dev@lists.ozlabs.org>; + Tue, 3 Aug 2010 23:25:00 +1000 (EST) +Received: from mail.idt.com (localhost [127.0.0.1]) + by mxout1.idt.com (8.13.1/8.13.1) with ESMTP id o73DOrjO005661; + Tue, 3 Aug 2010 06:24:54 -0700 +Received: from corpml1.corp.idt.com (corpml1.corp.idt.com [157.165.140.20]) + by mail.idt.com (8.13.8/8.13.8) with ESMTP id o73DOndw022603; + Tue, 3 Aug 2010 06:24:50 -0700 (PDT) +Received: from CORPEXCH1.na.ads.idt.com (localhost [127.0.0.1]) + by corpml1.corp.idt.com (8.11.7p1+Sun/8.11.7) with ESMTP id + o73DOml00291; Tue, 3 Aug 2010 06:24:48 -0700 (PDT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +In-Reply-To: <AANLkTinpwYnyc1oN1VbtBgUF6bk6E5q_Gq1Dj3WXV3wc@mail.gmail.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Thread-Index: AcszC8UElBYHaZlHSsmvZEE2KBL+0wAAhg7A +X-Scanned-By: MIMEDefang 2.43 +X-BeenThere: linuxppc-dev@lists.ozlabs.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org> +List-Unsubscribe: <https://lists.ozlabs.org/options/linuxppc-dev>, + <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe> +List-Archive: <http://lists.ozlabs.org/pipermail/linuxppc-dev> +List-Post: <mailto:linuxppc-dev@lists.ozlabs.org> +List-Help: <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help> +List-Subscribe: <https://lists.ozlabs.org/listinfo/linuxppc-dev>, + <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe> +Sender: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org +Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1018016> + +Yang Li pointed to these patches in his post from July 23, 2010. +It would be nice to have these patches in mainline code. + +> -----Original Message----- +> From: timur.tabi@gmail.com [mailto:timur.tabi@gmail.com] On Behalf Of +Timur Tabi +> Sent: Tuesday, August 03, 2010 9:02 AM +> To: Bounine, Alexandre +> Cc: Michael Neuling; Alexandre Bounine; linuxppc-dev@lists.ozlabs.org; +linux-kernel@vger.kernel.org; +> thomas.moll@sysgo.com; Kumar Gala +> Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO +port +> +> On Tue, Aug 3, 2010 at 7:17 AM, Bounine, Alexandre +> <Alexandre.Bounine@idt.com> wrote: +> > This happened after change to book-e definitions. +> > There are patches that address this issue. +> +> And those patches should have been applied before 2.6.35 was released. +> Someone dropped the ball. 2.6.35 is broken for a number of PowerPC +> boards: +> +> $ make mpc85xx_defconfig +> .... +> $ make +> .... +> CC arch/powerpc/sysdev/fsl_rio.o +> arch/powerpc/sysdev/fsl_rio.c: In function 'fsl_rio_mcheck_exception': +> arch/powerpc/sysdev/fsl_rio.c:248: error: 'MCSR_MASK' undeclared +> (first use in this function) +> arch/powerpc/sysdev/fsl_rio.c:248: error: (Each undeclared identifier +> is reported only once +> arch/powerpc/sysdev/fsl_rio.c:248: error: for each function it appears +in.) +> make[1]: *** [arch/powerpc/sysdev/fsl_rio.o] Error 1 +> +> -- +> Timur Tabi +> Linux kernel developer at Freescale + + diff --git a/test/corpora/lkml/cur/1382298775.003976:2, b/test/corpora/lkml/cur/1382298775.003976:2, new file mode 100644 index 00000000..a6ff6296 --- /dev/null +++ b/test/corpora/lkml/cur/1382298775.003976:2, @@ -0,0 +1,96 @@ +From: Michael Neuling <mikey@neuling.org> +Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Date: Thu, 05 Aug 2010 13:34:20 +1000 +Lines: 50 +Message-ID: <26581.1280979260@neuling.org> +References: <20100308191005.GE4324@amak.tundra.com> <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> <AANLkTinKbimKyLpvFD7KOvavshu_n8gRcp2BvEJj0XZQ@mail.gmail.com> <4381.1280815590@neuling.org> <0CE8B6BE3C4AD74AB97D9D29BD24E5520114309D@CORPEXCH1.na.ads.idt.com> <AANLkTinpwYnyc1oN1VbtBgUF6bk6E5q_Gq1Dj3WXV3wc@mail.gmail.com> <0CE8B6BE3C4AD74AB97D9D29BD24E552011430BC@CORPEXCH1.na.ads.idt.com> +Cc: "Timur Tabi" <timur@freescale.com>, + "Alexandre Bounine" <abounine@tundra.com>, + linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, + thomas.moll@sysgo.com, "Kumar Gala" <galak@kernel.crashing.org> +To: "Bounine, Alexandre" <Alexandre.Bounine@idt.com> +X-From: linux-kernel-owner@vger.kernel.org Thu Aug 05 05:34:37 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1OgrE1-00024O-Bh + for glk-linux-kernel-3@lo.gmane.org; Thu, 05 Aug 2010 05:34:33 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1758775Ab0HEDeX (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Wed, 4 Aug 2010 23:34:23 -0400 +Received: from ozlabs.org ([203.10.76.45]:40810 "EHLO ozlabs.org" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1758704Ab0HEDeV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Wed, 4 Aug 2010 23:34:21 -0400 +Received: from localhost.localdomain (localhost [127.0.0.1]) + by ozlabs.org (Postfix) with ESMTP id 97995B70D8; + Thu, 5 Aug 2010 13:34:20 +1000 (EST) +Received: by localhost.localdomain (Postfix, from userid 1000) + id 456CDCC199; Thu, 5 Aug 2010 13:34:20 +1000 (EST) +Received: from neuling.org (localhost [127.0.0.1]) + by localhost.localdomain (Postfix) with ESMTP id 404C8C6123; + Thu, 5 Aug 2010 13:34:20 +1000 (EST) +In-reply-to: <0CE8B6BE3C4AD74AB97D9D29BD24E552011430BC@CORPEXCH1.na.ads.idt.com> +Comments: In-reply-to "Bounine, Alexandre" <Alexandre.Bounine@idt.com> + message dated "Tue, 03 Aug 2010 06:24:47 -0700." +X-Mailer: MH-E 8.2; nmh 1.3; GNU Emacs 23.1.1 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1019004> + + + +In message <0CE8B6BE3C4AD74AB97D9D29BD24E552011430BC@CORPEXCH1.na.ads.idt.com> you wrote: +> Yang Li pointed to these patches in his post from July 23, 2010. +> It would be nice to have these patches in mainline code.=20 + +This is still broken in Kumar's latest tree. Do you guys wanna repost +them so Kumar can pick them up easily? + +Mikey + +> +> > -----Original Message----- +> > From: timur.tabi@gmail.com [mailto:timur.tabi@gmail.com] On Behalf Of +> Timur Tabi +> > Sent: Tuesday, August 03, 2010 9:02 AM +> > To: Bounine, Alexandre +> > Cc: Michael Neuling; Alexandre Bounine; linuxppc-dev@lists.ozlabs.org; +> linux-kernel@vger.kernel.org; +> > thomas.moll@sysgo.com; Kumar Gala +> > Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO +> port +> >=20 +> > On Tue, Aug 3, 2010 at 7:17 AM, Bounine, Alexandre +> > <Alexandre.Bounine@idt.com> wrote: +> > > This happened after change to book-e definitions. +> > > There are patches that address this issue. +> >=20 +> > And those patches should have been applied before 2.6.35 was released. +> > Someone dropped the ball. 2.6.35 is broken for a number of PowerPC +> > boards: +> >=20 +> > $ make mpc85xx_defconfig +> > .... +> > $ make +> > .... +> > CC arch/powerpc/sysdev/fsl_rio.o +> > arch/powerpc/sysdev/fsl_rio.c: In function 'fsl_rio_mcheck_exception': +> > arch/powerpc/sysdev/fsl_rio.c:248: error: 'MCSR_MASK' undeclared +> > (first use in this function) +> > arch/powerpc/sysdev/fsl_rio.c:248: error: (Each undeclared identifier +> > is reported only once +> > arch/powerpc/sysdev/fsl_rio.c:248: error: for each function it appears +> in.) +> > make[1]: *** [arch/powerpc/sysdev/fsl_rio.o] Error 1 +> >=20 +> > -- +> > Timur Tabi +> > Linux kernel developer at Freescale +> + + diff --git a/test/corpora/lkml/cur/1382298775.004354:2, b/test/corpora/lkml/cur/1382298775.004354:2, new file mode 100644 index 00000000..2d69a129 --- /dev/null +++ b/test/corpora/lkml/cur/1382298775.004354:2, @@ -0,0 +1,170 @@ +From: "Bounine, Alexandre" <Alexandre.Bounine@idt.com> +Subject: RE: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Date: Thu, 5 Aug 2010 10:25:18 -0700 +Lines: 99 +Message-ID: <0CE8B6BE3C4AD74AB97D9D29BD24E552011935BD@CORPEXCH1.na.ads.idt.com> +References: <20100308191005.GE4324@amak.tundra.com> + <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> + <AANLkTinKbimKyLpvFD7KOvavshu_n8gRcp2BvEJj0XZQ@mail.gmail.com> + <4381.1280815590@neuling.org> + <0CE8B6BE3C4AD74AB97D9D29BD24E5520114309D@CORPEXCH1.na.ads.idt.com> + <AANLkTinpwYnyc1oN1VbtBgUF6bk6E5q_Gq1Dj3WXV3wc@mail.gmail.com> + <0CE8B6BE3C4AD74AB97D9D29BD24E552011430BC@CORPEXCH1.na.ads.idt.com> + <26581.1280979260@neuling.org> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Li Yang-R58472 <r58472@freescale.com>, linux-kernel@vger.kernel.org, + Alexandre Bounine <abounine@tundra.com>, thomas.moll@sysgo.com, + linuxppc-dev@lists.ozlabs.org, Timur Tabi <timur@freescale.com> +To: "Michael Neuling" <mikey@neuling.org> +X-From: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Thu Aug 05 19:25:54 2010 +Return-path: <linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org> +Envelope-to: glppe-linuxppc-embedded-2@m.gmane.org +Received: from ozlabs.org ([203.10.76.45]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org>) + id 1Oh4CX-0002Xd-Hu + for glppe-linuxppc-embedded-2@m.gmane.org; Thu, 05 Aug 2010 19:25:54 +0200 +Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) + by ozlabs.org (Postfix) with ESMTP id ED044100873 + for <glppe-linuxppc-embedded-2@m.gmane.org>; Fri, 6 Aug 2010 03:25:45 +1000 (EST) +Received: from mxout1.idt.com (mxout1.idt.com [157.165.5.25]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (Client CN "mxout1.idt.com", Issuer "idt.com" (not verified)) + by ozlabs.org (Postfix) with ESMTPS id 43F72B6EEA + for <linuxppc-dev@lists.ozlabs.org>; + Fri, 6 Aug 2010 03:25:34 +1000 (EST) +Received: from mail.idt.com (localhost [127.0.0.1]) + by mxout1.idt.com (8.13.1/8.13.1) with ESMTP id o75HPQdX013269; + Thu, 5 Aug 2010 10:25:26 -0700 +Received: from corpml1.corp.idt.com (corpml1.corp.idt.com [157.165.140.20]) + by mail.idt.com (8.13.8/8.13.8) with ESMTP id o75HPMOi016437; + Thu, 5 Aug 2010 10:25:23 -0700 (PDT) +Received: from CORPEXCH1.na.ads.idt.com (localhost [127.0.0.1]) + by corpml1.corp.idt.com (8.11.7p1+Sun/8.11.7) with ESMTP id + o75HPKp19185; Thu, 5 Aug 2010 10:25:21 -0700 (PDT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +In-Reply-To: <26581.1280979260@neuling.org> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Thread-Index: Acs0TsVj0+lZKwxtSsOT8qDn1XxpJAAdBmhA +X-Scanned-By: MIMEDefang 2.43 +X-BeenThere: linuxppc-dev@lists.ozlabs.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org> +List-Unsubscribe: <https://lists.ozlabs.org/options/linuxppc-dev>, + <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe> +List-Archive: <http://lists.ozlabs.org/pipermail/linuxppc-dev> +List-Post: <mailto:linuxppc-dev@lists.ozlabs.org> +List-Help: <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help> +List-Subscribe: <https://lists.ozlabs.org/listinfo/linuxppc-dev>, + <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe> +Sender: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org +Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1019383> + +Below is a copy of Leo's message with pointers to the patches. + +Alex. + +>Subject: [PATCH] RapidIO,powerpc/85xx: remove MCSR_MASK in fsl_rio +> +>Fixes compile problem caused by MCSR_MASK removal from book-E +definitions. + +Hi Alex, + +Only with your patch, there will still be problem on SRIO platforms +other than MPC85xx. + +I have posted a patch series to fix this together with several +compatibility issues a month before. + +http://patchwork.ozlabs.org/patch/56135/ +http://patchwork.ozlabs.org/patch/56136/ +http://patchwork.ozlabs.org/patch/56138/ +http://patchwork.ozlabs.org/patch/56137/ + + +Can anyone pick the patch series quickly as currently there is a compile +error when SRIO is enabled. + +- Leo + + +> -----Original Message----- +> From: Michael Neuling [mailto:mikey@neuling.org] +> Sent: Wednesday, August 04, 2010 11:34 PM +> To: Bounine, Alexandre +> Cc: Timur Tabi; Alexandre Bounine; linuxppc-dev@lists.ozlabs.org; +linux-kernel@vger.kernel.org; +> thomas.moll@sysgo.com; Kumar Gala +> Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO +port +> +> +> +> In message +<0CE8B6BE3C4AD74AB97D9D29BD24E552011430BC@CORPEXCH1.na.ads.idt.com> you +wrote: +> > Yang Li pointed to these patches in his post from July 23, 2010. +> > It would be nice to have these patches in mainline code.=20 +> +> This is still broken in Kumar's latest tree. Do you guys wanna repost +> them so Kumar can pick them up easily? +> +> Mikey +> +> > +> > > -----Original Message----- +> > > From: timur.tabi@gmail.com [mailto:timur.tabi@gmail.com] On Behalf +Of +> > Timur Tabi +> > > Sent: Tuesday, August 03, 2010 9:02 AM +> > > To: Bounine, Alexandre +> > > Cc: Michael Neuling; Alexandre Bounine; +linuxppc-dev@lists.ozlabs.org; +> > linux-kernel@vger.kernel.org; +> > > thomas.moll@sysgo.com; Kumar Gala +> > > Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for +SRIO +> > port +> > >=20 +> > > On Tue, Aug 3, 2010 at 7:17 AM, Bounine, Alexandre +> > > <Alexandre.Bounine@idt.com> wrote: +> > > > This happened after change to book-e definitions. +> > > > There are patches that address this issue. +> > >=20 +> > > And those patches should have been applied before 2.6.35 was +released. +> > > Someone dropped the ball. 2.6.35 is broken for a number of +PowerPC +> > > boards: +> > >=20 +> > > $ make mpc85xx_defconfig +> > > .... +> > > $ make +> > > .... +> > > CC arch/powerpc/sysdev/fsl_rio.o +> > > arch/powerpc/sysdev/fsl_rio.c: In function +'fsl_rio_mcheck_exception': +> > > arch/powerpc/sysdev/fsl_rio.c:248: error: 'MCSR_MASK' undeclared +> > > (first use in this function) +> > > arch/powerpc/sysdev/fsl_rio.c:248: error: (Each undeclared +identifier +> > > is reported only once +> > > arch/powerpc/sysdev/fsl_rio.c:248: error: for each function it +appears +> > in.) +> > > make[1]: *** [arch/powerpc/sysdev/fsl_rio.o] Error 1 +> > >=20 +> > > -- +> > > Timur Tabi +> > > Linux kernel developer at Freescale +> > + + diff --git a/test/corpora/lkml/cur/1382298775.004363:2, b/test/corpora/lkml/cur/1382298775.004363:2, new file mode 100644 index 00000000..f4198fb4 --- /dev/null +++ b/test/corpora/lkml/cur/1382298775.004363:2, @@ -0,0 +1,95 @@ +From: Kumar Gala <galak@kernel.crashing.org> +Subject: Re: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Date: Thu, 5 Aug 2010 12:53:03 -0500 +Lines: 34 +Message-ID: <C9528078-D64C-4944-B960-0E985B3EE0BA@kernel.crashing.org> +References: <20100308191005.GE4324@amak.tundra.com> + <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> + <AANLkTinKbimKyLpvFD7KOvavshu_n8gRcp2BvEJj0XZQ@mail.gmail.com> + <4381.1280815590@neuling.org> + <0CE8B6BE3C4AD74AB97D9D29BD24E5520114309D@CORPEXCH1.na.ads.idt.com> + <AANLkTinpwYnyc1oN1VbtBgUF6bk6E5q_Gq1Dj3WXV3wc@mail.gmail.com> + <0CE8B6BE3C4AD74AB97D9D29BD24E552011430BC@CORPEXCH1.na.ads.idt.com> + <26581.1280979260@neuling.org> + <0CE8B6BE3C4AD74AB97D9D29BD24E552011935BD@CORPEXCH1.na.ads.idt.com> +Mime-Version: 1.0 (Apple Message framework v1081) +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Michael Neuling <mikey@neuling.org>, Li Yang-R58472 <r58472@freescale.com>, + linux-kernel@vger.kernel.org, + Alexandre Bounine <abounine@tundra.com>, thomas.moll@sysgo.com, + linuxppc-dev@lists.ozlabs.org, Timur Tabi <timur@freescale.com> +To: "Bounine, Alexandre" <Alexandre.Bounine@IDT.COM> +X-From: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Thu Aug 05 19:53:49 2010 +Return-path: <linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org> +Envelope-to: glppe-linuxppc-embedded-2@m.gmane.org +Received: from ozlabs.org ([203.10.76.45]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org>) + id 1Oh4dY-0000mU-OI + for glppe-linuxppc-embedded-2@m.gmane.org; Thu, 05 Aug 2010 19:53:49 +0200 +Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) + by ozlabs.org (Postfix) with ESMTP id C0974B71BD + for <glppe-linuxppc-embedded-2@m.gmane.org>; Fri, 6 Aug 2010 03:53:41 +1000 (EST) +Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by ozlabs.org (Postfix) with ESMTPS id 707ADB6EF1 + for <linuxppc-dev@lists.ozlabs.org>; + Fri, 6 Aug 2010 03:53:31 +1000 (EST) +Received: from [IPv6:::1] (localhost.localdomain [127.0.0.1]) + by gate.crashing.org (8.14.1/8.13.8) with ESMTP id o75Hr4pE020296; + Thu, 5 Aug 2010 12:53:05 -0500 +In-Reply-To: <0CE8B6BE3C4AD74AB97D9D29BD24E552011935BD@CORPEXCH1.na.ads.idt.com> +X-Mailer: Apple Mail (2.1081) +X-BeenThere: linuxppc-dev@lists.ozlabs.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org> +List-Unsubscribe: <https://lists.ozlabs.org/options/linuxppc-dev>, + <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe> +List-Archive: <http://lists.ozlabs.org/pipermail/linuxppc-dev> +List-Post: <mailto:linuxppc-dev@lists.ozlabs.org> +List-Help: <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help> +List-Subscribe: <https://lists.ozlabs.org/listinfo/linuxppc-dev>, + <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe> +Sender: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org +Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1019393> + + +On Aug 5, 2010, at 12:25 PM, Bounine, Alexandre wrote: + +> Below is a copy of Leo's message with pointers to the patches. +> +> Alex. +> +>> Subject: [PATCH] RapidIO,powerpc/85xx: remove MCSR_MASK in fsl_rio +>> +>> Fixes compile problem caused by MCSR_MASK removal from book-E +> definitions. +> +> Hi Alex, +> +> Only with your patch, there will still be problem on SRIO platforms +> other than MPC85xx. +> +> I have posted a patch series to fix this together with several +> compatibility issues a month before. +> +> http://patchwork.ozlabs.org/patch/56135/ +> http://patchwork.ozlabs.org/patch/56136/ +> http://patchwork.ozlabs.org/patch/56138/ +> http://patchwork.ozlabs.org/patch/56137/ +> +> +> Can anyone pick the patch series quickly as currently there is a compile +> error when SRIO is enabled. +> +> - Leo + +I'm looking at this now and wondering what we added the mcheck handler for in the first place and what its trying to accomplish. + +- k + + diff --git a/test/corpora/lkml/cur/1382298775.004374:2, b/test/corpora/lkml/cur/1382298775.004374:2, new file mode 100644 index 00000000..48558ad6 --- /dev/null +++ b/test/corpora/lkml/cur/1382298775.004374:2, @@ -0,0 +1,75 @@ +From: "Bounine, Alexandre" <Alexandre.Bounine@idt.com> +Subject: RE: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Date: Thu, 5 Aug 2010 11:17:58 -0700 +Lines: 18 +Message-ID: <0CE8B6BE3C4AD74AB97D9D29BD24E55201193609@CORPEXCH1.na.ads.idt.com> +References: <20100308191005.GE4324@amak.tundra.com> <AANLkTine3pc2Ai2Woj81Y9fS_KgGs1sIMb2NMR6G74ww@mail.gmail.com> <AANLkTinKbimKyLpvFD7KOvavshu_n8gRcp2BvEJj0XZQ@mail.gmail.com> <4381.1280815590@neuling.org> <0CE8B6BE3C4AD74AB97D9D29BD24E5520114309D@CORPEXCH1.na.ads.idt.com> <AANLkTinpwYnyc1oN1VbtBgUF6bk6E5q_Gq1Dj3WXV3wc@mail.gmail.com> <0CE8B6BE3C4AD74AB97D9D29BD24E552011430BC@CORPEXCH1.na.ads.idt.com> <26581.1280979260@neuling.org> <0CE8B6BE3C4AD74AB97D9D29BD24E552011935BD@CORPEXCH1.na.ads.idt.com> <C9528078-D64C-4944-B960-0E985B3EE0BA@kernel.crashing.org> +Mime-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 8BIT +Cc: "Michael Neuling" <mikey@neuling.org>, + "Timur Tabi" <timur@freescale.com>, + "Alexandre Bounine" <abounine@tundra.com>, + <linuxppc-dev@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>, + <thomas.moll@sysgo.com>, "Li Yang-R58472" <r58472@freescale.com> +To: "Kumar Gala" <galak@kernel.crashing.org> +X-From: linux-kernel-owner@vger.kernel.org Thu Aug 05 20:18:33 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1Oh51V-00075S-1W + for glk-linux-kernel-3@lo.gmane.org; Thu, 05 Aug 2010 20:18:33 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S934019Ab0HESSU (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Thu, 5 Aug 2010 14:18:20 -0400 +Received: from mxout1.idt.com ([157.165.5.25]:47318 "EHLO mxout1.idt.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S933252Ab0HESSS convert rfc822-to-8bit (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Thu, 5 Aug 2010 14:18:18 -0400 +Received: from mail.idt.com (localhost [127.0.0.1]) + by mxout1.idt.com (8.13.1/8.13.1) with ESMTP id o75II315017058; + Thu, 5 Aug 2010 11:18:03 -0700 +Received: from corpml1.corp.idt.com (corpml1.corp.idt.com [157.165.140.20]) + by mail.idt.com (8.13.8/8.13.8) with ESMTP id o75II1Ek021771; + Thu, 5 Aug 2010 11:18:01 -0700 (PDT) +Received: from CORPEXCH1.na.ads.idt.com (localhost [127.0.0.1]) + by corpml1.corp.idt.com (8.11.7p1+Sun/8.11.7) with ESMTP id o75II0M19896; + Thu, 5 Aug 2010 11:18:00 -0700 (PDT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +In-Reply-To: <C9528078-D64C-4944-B960-0E985B3EE0BA@kernel.crashing.org> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PATCH v2 5/7] powerpc/85xx: Add MChk handler for SRIO port +Thread-Index: Acs0x5rSJ4s7P9ssRjKYVWxFQe3GMgAARQEw +X-Scanned-By: MIMEDefang 2.43 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1019404> + +> I'm looking at this now and wondering what we added the mcheck handler +for in the first place and what +> its trying to accomplish. +> +> - k + +This protects system from hanging if RIO link fails or enters error +state. In some situations following maintenance read may initiate link +recovery from error state. + +As it is now, MCheck mostly prevents system from hanging, but it also +adds sense to return status of maintenance read routine. I am using +return status in my new set of patches to check if RIO link is valid +during error recovery. + +Alex. + + + + diff --git a/test/corpora/lkml/cur/1382298793.002253:2, b/test/corpora/lkml/cur/1382298793.002253:2, new file mode 100644 index 00000000..cbd67e82 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002253:2, @@ -0,0 +1,208 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 00/44] remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:19 -0800 +Lines: 158 +Message-ID: <cover.1289789604.git.joe@perches.com> +Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, + linux-tegra@vger.kernel.org, microblaze-uclinux@itee.uq.edu.au, + user-mode-linux-devel@lists.sourceforge.net, + user-mode-linux-user@lists.sourceforge.net, + cpufreq@vger.kernel.org, linux-i2c@vger.kernel.org, + netdev@vger.kernel.org, linux-media@vger.kernel.org, + linux-mmc@vger.kernel.org, e1000-devel@lists.sourceforge.net, + linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, + platform-driver-x86@vger.kernel.org, + ibm-acpi-devel@lists.sourceforge.net, linux-s390@vger.kernel.org, + linux-scsi@vger.kernel.org, + spi-devel-general@lists.sourceforge.net, + devel@driverdev.osuosl.org, linux-usb@vger.kernel.org, + xen-devel@lists.xensource.com, virtualization@lists.osdl.org, + v9fs-developer@lists.sourceforge.net, ceph-devel@vger.kernel.org, + logfs@logfs.org, linux-nfs@vger.kernel.org, + ocfs2-devel@oss.oracle.com, linu +To: Jiri Kosina <trivial@kernel.org> +X-From: cpufreq-owner@vger.kernel.org Mon Nov 15 04:05:30 2010 +Return-path: <cpufreq-owner@vger.kernel.org> +Envelope-to: glkc-cpufreq2@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <cpufreq-owner@vger.kernel.org>) + id 1PHpNp-0000PT-Vh + for glkc-cpufreq2@lo.gmane.org; Mon, 15 Nov 2010 04:05:30 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1754566Ab0KODF2 (ORCPT <rfc822;glkc-cpufreq2@m.gmane.org>); + Sun, 14 Nov 2010 22:05:28 -0500 +Received: from mail.perches.com ([173.55.12.10]:1118 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751901Ab0KODF1 (ORCPT <rfc822;cpufreq@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:27 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 0D82A24368; + Sun, 14 Nov 2010 19:03:52 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +Sender: cpufreq-owner@vger.kernel.org +Precedence: bulk +List-ID: <cpufreq.vger.kernel.org> +X-Mailing-List: cpufreq@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062272> + +ya trivial series... + +Joe Perches (44): + arch/arm: Remove unnecessary semicolons + arch/microblaze: Remove unnecessary semicolons + arch/um: Remove unnecessary semicolons + drivers/cpufreq: Remove unnecessary semicolons + drivers/gpio: Remove unnecessary semicolons + drivers/i2c: Remove unnecessary semicolons + drivers/isdn: Remove unnecessary semicolons + drivers/leds: Remove unnecessary semicolons + drivers/media/video: Remove unnecessary semicolons + drivers/misc: Remove unnecessary semicolons + drivers/mmc: Remove unnecessary semicolons + drivers/net/bnx2x: Remove unnecessary semicolons + drivers/net/e1000e: Remove unnecessary semicolons + drivers/net/ixgbe: Remove unnecessary semicolons + drivers/net/vxge: Remove unnecessary semicolons + drivers/net/wireless/ath: Remove unnecessary semicolons + drivers/net/wireless/iwlwifi: Remove unnecessary semicolons + drivers/net/cnic.c: Remove unnecessary semicolons + drivers/platform/x86: Remove unnecessary semicolons + drivers/power: Remove unnecessary semicolons + drivers/s390/net: Remove unnecessary semicolons + drivers/scsi/be2iscsi: Remove unnecessary semicolons + drivers/scsi/bfa: Remove unnecessary semicolons + drivers/scsi/lpfc: Remove unnecessary semicolons + drivers/scsi/pm8001: Remove unnecessary semicolons + drivers/scsi/qla2xxx: Remove unnecessary semicolons + drivers/serial: Remove unnecessary semicolons + drivers/spi: Remove unnecessary semicolons + drivers/staging: Remove unnecessary semicolons + drivers/usb/gadget: Remove unnecessary semicolons + drivers/xen: Remove unnecessary semicolons + fs/9p: Remove unnecessary semicolons + fs/ceph: Remove unnecessary semicolons + fs/logfs: Remove unnecessary semicolons + fs/nfs: Remove unnecessary semicolons + fs/ocfs2: Remove unnecessary semicolons + fs/ubifs: Remove unnecessary semicolons + include/linux/if_macvlan.h: Remove unnecessary semicolons + include/net/caif/cfctrl.h: Remove unnecessary semicolons + mm/hugetlb.c: Remove unnecessary semicolons + net/ipv6/mcast.c: Remove unnecessary semicolons + net/sunrpc/addr.c: Remove unnecessary semicolons + sound/core/pcm_lib.c: Remove unnecessary semicolons + sound/soc/codecs: Remove unnecessary semicolons + + arch/arm/mach-at91/at91cap9_devices.c | 2 +- + arch/arm/mach-at91/at91sam9g45_devices.c | 2 +- + arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- + arch/arm/mach-nuc93x/time.c | 2 +- + arch/arm/mach-tegra/tegra2_clocks.c | 2 +- + arch/arm/mach-w90x900/cpu.c | 2 +- + arch/arm/plat-mxc/irq.c | 2 +- + arch/microblaze/lib/memmove.c | 2 +- + arch/um/drivers/mmapper_kern.c | 2 +- + drivers/cpufreq/cpufreq_conservative.c | 2 +- + drivers/gpio/langwell_gpio.c | 2 +- + drivers/i2c/busses/i2c-designware.c | 2 +- + drivers/isdn/hardware/mISDN/mISDNinfineon.c | 4 ++-- + drivers/isdn/hardware/mISDN/mISDNisar.c | 2 +- + drivers/leds/leds-mc13783.c | 2 +- + drivers/media/video/cx88/cx88-blackbird.c | 2 +- + drivers/media/video/davinci/vpfe_capture.c | 2 +- + drivers/media/video/em28xx/em28xx-cards.c | 2 +- + drivers/misc/bmp085.c | 2 +- + drivers/misc/isl29020.c | 2 +- + drivers/mmc/host/davinci_mmc.c | 2 +- + drivers/net/bnx2x/bnx2x_link.c | 4 ++-- + drivers/net/bnx2x/bnx2x_main.c | 2 +- + drivers/net/cnic.c | 2 +- + drivers/net/e1000e/netdev.c | 2 +- + drivers/net/ixgbe/ixgbe_sriov.c | 2 +- + drivers/net/vxge/vxge-main.c | 2 +- + drivers/net/wireless/ath/ath9k/htc.h | 2 +- + drivers/net/wireless/iwlwifi/iwl-agn.c | 2 +- + drivers/platform/x86/classmate-laptop.c | 2 +- + drivers/platform/x86/thinkpad_acpi.c | 2 +- + drivers/power/intel_mid_battery.c | 2 +- + drivers/s390/net/qeth_core_sys.c | 2 +- + drivers/scsi/be2iscsi/be_main.c | 4 ++-- + drivers/scsi/bfa/bfa_fcs_lport.c | 2 +- + drivers/scsi/lpfc/lpfc_bsg.c | 2 +- + drivers/scsi/pm8001/pm8001_init.c | 2 +- + drivers/scsi/qla2xxx/qla_isr.c | 4 ++-- + drivers/scsi/qla2xxx/qla_nx.c | 2 +- + drivers/serial/mrst_max3110.c | 2 +- + drivers/spi/amba-pl022.c | 2 +- + drivers/spi/spi_nuc900.c | 2 +- + .../staging/ath6kl/hif/sdio/linux_sdio/src/hif.c | 2 +- + drivers/staging/ath6kl/os/linux/ar6000_drv.c | 2 +- + drivers/staging/bcm/InterfaceInit.c | 2 +- + drivers/staging/bcm/InterfaceIsr.c | 2 +- + drivers/staging/bcm/Misc.c | 4 ++-- + .../comedi/drivers/addi-data/APCI1710_Tor.c | 2 +- + .../comedi/drivers/addi-data/hwdrv_apci1500.c | 2 +- + .../comedi/drivers/addi-data/hwdrv_apci1516.c | 2 +- + .../comedi/drivers/addi-data/hwdrv_apci3501.c | 2 +- + drivers/staging/comedi/drivers/amplc_pci230.c | 2 +- + drivers/staging/comedi/drivers/cb_das16_cs.c | 2 +- + drivers/staging/comedi/drivers/comedi_bond.c | 2 +- + drivers/staging/crystalhd/crystalhd_hw.c | 2 +- + drivers/staging/go7007/go7007-driver.c | 2 +- + drivers/staging/iio/accel/lis3l02dq_ring.c | 2 +- + .../staging/intel_sst/intel_sst_drv_interface.c | 4 ++-- + drivers/staging/keucr/smilmain.c | 4 ++-- + drivers/staging/keucr/smilsub.c | 4 ++-- + drivers/staging/msm/lcdc_toshiba_wvga_pt.c | 2 +- + drivers/staging/rt2860/common/cmm_data_pci.c | 4 ++-- + drivers/staging/rt2860/rt_linux.c | 2 +- + drivers/staging/rt2860/rtmp.h | 2 +- + drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c | 2 +- + drivers/staging/rtl8192e/r819xE_phy.c | 2 +- + drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 2 +- + drivers/staging/rtl8192u/r8192U_core.c | 2 +- + drivers/staging/rtl8192u/r819xU_phy.c | 2 +- + drivers/staging/rtl8712/rtl8712_efuse.c | 2 +- + drivers/staging/rtl8712/rtl8712_xmit.c | 2 +- + drivers/staging/rtl8712/rtl871x_xmit.c | 2 +- + drivers/staging/tidspbridge/core/tiomap3430.c | 4 ++-- + drivers/staging/tidspbridge/rmgr/nldr.c | 2 +- + drivers/staging/vt6655/card.c | 2 +- + drivers/staging/vt6655/iwctl.c | 2 +- + drivers/staging/vt6655/wpa2.c | 4 ++-- + drivers/staging/vt6656/baseband.c | 2 +- + drivers/staging/vt6656/iwctl.c | 2 +- + drivers/staging/vt6656/power.c | 2 +- + drivers/staging/vt6656/wpa2.c | 4 ++-- + drivers/usb/gadget/f_fs.c | 2 +- + drivers/xen/swiotlb-xen.c | 2 +- + fs/9p/acl.c | 2 +- + fs/9p/xattr.c | 2 +- + fs/ceph/mds_client.c | 2 +- + fs/logfs/readwrite.c | 2 +- + fs/nfs/getroot.c | 2 +- + fs/ocfs2/refcounttree.c | 2 +- + fs/ubifs/scan.c | 2 +- + include/linux/if_macvlan.h | 2 +- + include/net/caif/cfctrl.h | 2 +- + mm/hugetlb.c | 2 +- + net/ipv6/mcast.c | 2 +- + net/sunrpc/addr.c | 2 +- + sound/core/pcm_lib.c | 2 +- + sound/soc/codecs/wm8904.c | 2 +- + sound/soc/codecs/wm8940.c | 1 - + sound/soc/codecs/wm8993.c | 2 +- + sound/soc/codecs/wm_hubs.c | 2 +- + 100 files changed, 111 insertions(+), 112 deletions(-) + +-- +1.7.3.1.g432b3.dirty + +-- +To unsubscribe from this list: send the line "unsubscribe cpufreq" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298793.002254:2, b/test/corpora/lkml/cur/1382298793.002254:2, new file mode 100644 index 00000000..b4959129 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002254:2, @@ -0,0 +1,100 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 13/44] drivers/net/e1000e: Remove unnecessary + semicolons +Date: Sun, 14 Nov 2010 19:04:32 -0800 +Lines: 34 +Message-ID: <e5cf92d50de7924930d660a5865c3d60d9cd9dc5.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: e1000-devel@lists.sourceforge.net, Bruce Allan <bruce.w.allan@intel.com>, + Jesse Brandeburg <jesse.brandeburg@intel.com>, + linux-kernel@vger.kernel.org, Greg Rose <gregory.v.rose@intel.com>, + John Ronciak <john.ronciak@intel.com>, + Jeff Kirsher <jeffrey.t.kirsher@intel.com>, netdev@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: e1000-devel-bounces@lists.sourceforge.net Mon Nov 15 04:05:53 2010 +Return-path: <e1000-devel-bounces@lists.sourceforge.net> +Envelope-to: glded-e1000-devel@m.gmane.org +Received: from lists.sourceforge.net ([216.34.181.88]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <e1000-devel-bounces@lists.sourceforge.net>) + id 1PHpOD-0000a9-4r + for glded-e1000-devel@m.gmane.org; Mon, 15 Nov 2010 04:05:53 +0100 +Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) + by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) + (envelope-from <e1000-devel-bounces@lists.sourceforge.net>) + id 1PHpO5-0002a8-SR; Mon, 15 Nov 2010 03:05:45 +0000 +Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] + helo=mx.sourceforge.net) + by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) + (envelope-from <joe@perches.com>) id 1PHpO5-0002Zz-D2 + for e1000-devel@lists.sourceforge.net; Mon, 15 Nov 2010 03:05:45 +0000 +X-ACL-Warn: +Received: from mail.perches.com ([173.55.12.10]) + by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.69) + id 1PHpO1-0002b4-4y + for e1000-devel@lists.sourceforge.net; Mon, 15 Nov 2010 03:05:45 +0000 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 462EB24376; + Sun, 14 Nov 2010 19:04:03 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +X-Spam-Score: 0.1 (/) +X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. + See http://spamassassin.org/tag/ for more details. + -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay + domain 0.1 AWL AWL: From: address is in the auto white-list +X-Headers-End: 1PHpO1-0002b4-4y +X-BeenThere: e1000-devel@lists.sourceforge.net +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "e100/e1000\(e\)/ixgb/igb/ixgbe development and discussion" + <e1000-devel.lists.sourceforge.net> +List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/e1000-devel>, + <mailto:e1000-devel-request@lists.sourceforge.net?subject=unsubscribe> +List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=e1000-devel> +List-Post: <mailto:e1000-devel@lists.sourceforge.net> +List-Help: <mailto:e1000-devel-request@lists.sourceforge.net?subject=help> +List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/e1000-devel>, + <mailto:e1000-devel-request@lists.sourceforge.net?subject=subscribe> +Errors-To: e1000-devel-bounces@lists.sourceforge.net +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062273> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/net/e1000e/netdev.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c +index c4ca162..a6d54e4 100644 +--- a/drivers/net/e1000e/netdev.c ++++ b/drivers/net/e1000e/netdev.c +@@ -4595,7 +4595,7 @@ dma_error: + i += tx_ring->count; + i--; + buffer_info = &tx_ring->buffer_info[i]; +- e1000_put_txbuf(adapter, buffer_info);; ++ e1000_put_txbuf(adapter, buffer_info); + } + + return 0; +-- +1.7.3.1.g432b3.dirty + + +------------------------------------------------------------------------------ +Centralized Desktop Delivery: Dell and VMware Reference Architecture +Simplifying enterprise desktop deployment and management using +Dell EqualLogic storage and VMware View: A highly scalable, end-to-end +client virtualization framework. Read more! +http://p.sf.net/sfu/dell-eql-dev2dev +_______________________________________________ +E1000-devel mailing list +E1000-devel@lists.sourceforge.net +https://lists.sourceforge.net/lists/listinfo/e1000-devel +To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired + + + diff --git a/test/corpora/lkml/cur/1382298793.002255:2, b/test/corpora/lkml/cur/1382298793.002255:2, new file mode 100644 index 00000000..1c158be8 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002255:2, @@ -0,0 +1,100 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 14/44] drivers/net/ixgbe: Remove unnecessary + semicolons +Date: Sun, 14 Nov 2010 19:04:33 -0800 +Lines: 34 +Message-ID: <7d2c334daa75c5221946a17d45c9de1901cf06e7.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: e1000-devel@lists.sourceforge.net, Bruce Allan <bruce.w.allan@intel.com>, + Jesse Brandeburg <jesse.brandeburg@intel.com>, + linux-kernel@vger.kernel.org, Greg Rose <gregory.v.rose@intel.com>, + John Ronciak <john.ronciak@intel.com>, + Jeff Kirsher <jeffrey.t.kirsher@intel.com>, netdev@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: e1000-devel-bounces@lists.sourceforge.net Mon Nov 15 04:05:55 2010 +Return-path: <e1000-devel-bounces@lists.sourceforge.net> +Envelope-to: glded-e1000-devel@m.gmane.org +Received: from lists.sourceforge.net ([216.34.181.88]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <e1000-devel-bounces@lists.sourceforge.net>) + id 1PHpOE-0000bY-KU + for glded-e1000-devel@m.gmane.org; Mon, 15 Nov 2010 04:05:54 +0100 +Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) + by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) + (envelope-from <e1000-devel-bounces@lists.sourceforge.net>) + id 1PHpO6-0004H7-Hr; Mon, 15 Nov 2010 03:05:46 +0000 +Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] + helo=mx.sourceforge.net) + by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) + (envelope-from <joe@perches.com>) id 1PHpO6-0004H2-2t + for e1000-devel@lists.sourceforge.net; Mon, 15 Nov 2010 03:05:46 +0000 +X-ACL-Warn: +Received: from mail.perches.com ([173.55.12.10]) + by sog-mx-4.v43.ch3.sourceforge.com with esmtp (Exim 4.69) + id 1PHpO1-0006jE-SS + for e1000-devel@lists.sourceforge.net; Mon, 15 Nov 2010 03:05:46 +0000 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 0D6062436F; + Sun, 14 Nov 2010 19:04:04 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +X-Spam-Score: 0.1 (/) +X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. + See http://spamassassin.org/tag/ for more details. + -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay + domain 0.1 AWL AWL: From: address is in the auto white-list +X-Headers-End: 1PHpO1-0006jE-SS +X-BeenThere: e1000-devel@lists.sourceforge.net +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "e100/e1000\(e\)/ixgb/igb/ixgbe development and discussion" + <e1000-devel.lists.sourceforge.net> +List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/e1000-devel>, + <mailto:e1000-devel-request@lists.sourceforge.net?subject=unsubscribe> +List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=e1000-devel> +List-Post: <mailto:e1000-devel@lists.sourceforge.net> +List-Help: <mailto:e1000-devel-request@lists.sourceforge.net?subject=help> +List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/e1000-devel>, + <mailto:e1000-devel-request@lists.sourceforge.net?subject=subscribe> +Errors-To: e1000-devel-bounces@lists.sourceforge.net +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062274> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/net/ixgbe/ixgbe_sriov.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/net/ixgbe/ixgbe_sriov.c b/drivers/net/ixgbe/ixgbe_sriov.c +index 5428153..93f40bc 100644 +--- a/drivers/net/ixgbe/ixgbe_sriov.c ++++ b/drivers/net/ixgbe/ixgbe_sriov.c +@@ -68,7 +68,7 @@ static int ixgbe_set_vf_multicasts(struct ixgbe_adapter *adapter, + * addresses + */ + for (i = 0; i < entries; i++) { +- vfinfo->vf_mc_hashes[i] = hash_list[i];; ++ vfinfo->vf_mc_hashes[i] = hash_list[i]; + } + + for (i = 0; i < vfinfo->num_vf_mc_hashes; i++) { +-- +1.7.3.1.g432b3.dirty + + +------------------------------------------------------------------------------ +Centralized Desktop Delivery: Dell and VMware Reference Architecture +Simplifying enterprise desktop deployment and management using +Dell EqualLogic storage and VMware View: A highly scalable, end-to-end +client virtualization framework. Read more! +http://p.sf.net/sfu/dell-eql-dev2dev +_______________________________________________ +E1000-devel mailing list +E1000-devel@lists.sourceforge.net +https://lists.sourceforge.net/lists/listinfo/e1000-devel +To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired + + + diff --git a/test/corpora/lkml/cur/1382298793.002256:2, b/test/corpora/lkml/cur/1382298793.002256:2, new file mode 100644 index 00000000..8626b813 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002256:2, @@ -0,0 +1,89 @@ +From: Joe Perches <joe@perches.com> +Subject: [uml-user] [PATCH 03/44] arch/um: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:22 -0800 +Lines: 28 +Message-ID: <9ab60a1761dde357ebc028c525dae7572e072588.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Jeff Dike <jdike@addtoit.com>, user-mode-linux-user@lists.sourceforge.net, + user-mode-linux-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: user-mode-linux-user-bounces@lists.sourceforge.net Mon Nov 15 04:06:03 2010 +Return-path: <user-mode-linux-user-bounces@lists.sourceforge.net> +Envelope-to: gluu-user-mode-linux-user-592@gmane.org +Received: from lists.sourceforge.net ([216.34.181.88]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <user-mode-linux-user-bounces@lists.sourceforge.net>) + id 1PHpOM-0000er-Jl + for gluu-user-mode-linux-user-592@gmane.org; Mon, 15 Nov 2010 04:06:02 +0100 +Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) + by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) + (envelope-from <user-mode-linux-user-bounces@lists.sourceforge.net>) + id 1PHpNz-0002ZS-PM; Mon, 15 Nov 2010 03:05:39 +0000 +Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] + helo=mx.sourceforge.net) + by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) + (envelope-from <joe@perches.com>) + id 1PHpNy-0002ZA-Q9; Mon, 15 Nov 2010 03:05:38 +0000 +X-ACL-Warn: +Received: from mail.perches.com ([173.55.12.10]) + by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.69) + id 1PHpNu-0002aj-Ks; Mon, 15 Nov 2010 03:05:38 +0000 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 845BB2436D; + Sun, 14 Nov 2010 19:03:56 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +X-Spam-Score: 0.1 (/) +X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. + See http://spamassassin.org/tag/ for more details. + -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay + domain 0.1 AWL AWL: From: address is in the auto white-list +X-Headers-End: 1PHpNu-0002aj-Ks +X-BeenThere: user-mode-linux-user@lists.sourceforge.net +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: The user-mode Linux user list + <user-mode-linux-user.lists.sourceforge.net> +List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user>, + <mailto:user-mode-linux-user-request@lists.sourceforge.net?subject=unsubscribe> +List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=user-mode-linux-user> +List-Post: <mailto:user-mode-linux-user@lists.sourceforge.net> +List-Help: <mailto:user-mode-linux-user-request@lists.sourceforge.net?subject=help> +List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user>, + <mailto:user-mode-linux-user-request@lists.sourceforge.net?subject=subscribe> +Errors-To: user-mode-linux-user-bounces@lists.sourceforge.net +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062275> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + arch/um/drivers/mmapper_kern.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c +index 8501e7d..6256fa9 100644 +--- a/arch/um/drivers/mmapper_kern.c ++++ b/arch/um/drivers/mmapper_kern.c +@@ -122,7 +122,7 @@ static int __init mmapper_init(void) + if (err) { + printk(KERN_ERR "mmapper - misc_register failed, err = %d\n", + err); +- return err;; ++ return err; + } + return 0; + } +-- +1.7.3.1.g432b3.dirty + + +------------------------------------------------------------------------------ +Centralized Desktop Delivery: Dell and VMware Reference Architecture +Simplifying enterprise desktop deployment and management using +Dell EqualLogic storage and VMware View: A highly scalable, end-to-end +client virtualization framework. Read more! +http://p.sf.net/sfu/dell-eql-dev2dev + + diff --git a/test/corpora/lkml/cur/1382298793.002257:2, b/test/corpora/lkml/cur/1382298793.002257:2, new file mode 100644 index 00000000..849da33e --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002257:2, @@ -0,0 +1,81 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 40/44] mm/hugetlb.c: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:59 -0800 +Lines: 28 +Message-ID: <59705f848d35b12ace640f92afcffea02cee0976.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: linux-mm@kvack.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: owner-linux-mm@kvack.org Mon Nov 15 04:06:05 2010 +Return-path: <owner-linux-mm@kvack.org> +Envelope-to: glkm-linux-mm-2@m.gmane.org +Received: from kanga.kvack.org ([205.233.56.17]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <owner-linux-mm@kvack.org>) + id 1PHpOO-0000gl-5U + for glkm-linux-mm-2@m.gmane.org; Mon, 15 Nov 2010 04:06:04 +0100 +Received: by kanga.kvack.org (Postfix) + id 6220A8D003C; Sun, 14 Nov 2010 22:06:03 -0500 (EST) +Delivered-To: linux-mm-outgoing@kvack.org +Received: by kanga.kvack.org (Postfix, from userid 40) + id 5D2638D0017; Sun, 14 Nov 2010 22:06:03 -0500 (EST) +X-Original-To: int-list-linux-mm@kvack.org +Delivered-To: int-list-linux-mm@kvack.org +Received: by kanga.kvack.org (Postfix, from userid 63042) + id 427128D003C; Sun, 14 Nov 2010 22:06:03 -0500 (EST) +X-Original-To: linux-mm@kvack.org +Delivered-To: linux-mm@kvack.org +Received: from mail203.messagelabs.com (mail203.messagelabs.com [216.82.254.243]) + by kanga.kvack.org (Postfix) with SMTP id C08B98D0017 + for <linux-mm@kvack.org>; Sun, 14 Nov 2010 22:06:02 -0500 (EST) +X-VirusChecked: Checked +X-Env-Sender: joe@perches.com +X-Msg-Ref: server-4.tower-203.messagelabs.com!1289790361!41887937!1 +X-StarScan-Version: 6.2.9; banners=-,-,- +X-Originating-IP: [173.55.12.10] +X-SpamReason: No, hits=0.0 required=7.0 tests= +Received: (qmail 4485 invoked from network); 15 Nov 2010 03:06:01 -0000 +Received: from mail.perches.com (HELO mail.perches.com) (173.55.12.10) + by server-4.tower-203.messagelabs.com with SMTP; 15 Nov 2010 03:06:01 -0000 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id EB70E2436B; + Sun, 14 Nov 2010 19:04:28 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.2 +Sender: owner-linux-mm@kvack.org +Precedence: bulk +X-Loop: owner-majordomo@kvack.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062276> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + mm/hugetlb.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/mm/hugetlb.c b/mm/hugetlb.c +index c4a3558..8875242 100644 +--- a/mm/hugetlb.c ++++ b/mm/hugetlb.c +@@ -540,7 +540,7 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, + + /* If reserves cannot be used, ensure enough pages are in the pool */ + if (avoid_reserve && h->free_huge_pages - h->resv_huge_pages == 0) +- goto err;; ++ goto err; + + for_each_zone_zonelist_nodemask(zone, z, zonelist, + MAX_NR_ZONES - 1, nodemask) { +-- +1.7.3.1.g432b3.dirty + +-- +To unsubscribe, send a message with 'unsubscribe linux-mm' in +the body to majordomo@kvack.org. For more info on Linux MM, +see: http://www.linux-mm.org/ . +Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ +Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> + + + diff --git a/test/corpora/lkml/cur/1382298793.002258:2, b/test/corpora/lkml/cur/1382298793.002258:2, new file mode 100644 index 00000000..271136b8 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002258:2, @@ -0,0 +1,86 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 31/44] drivers/xen: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:50 -0800 +Lines: 20 +Message-ID: <b3f95cd997859d5d714de322ce17810fe73460cd.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: virtualization@lists.osdl.org, + Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>, + xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org, + Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> +To: Jiri Kosina <trivial@kernel.org> +X-From: xen-devel-bounces@lists.xensource.com Mon Nov 15 04:06:05 2010 +Return-path: <xen-devel-bounces@lists.xensource.com> +Envelope-to: gcvxd-xen-devel@m.gmane.org +Received: from lists.colo.xensource.com ([70.42.241.110] helo=lists.xensource.com) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <xen-devel-bounces@lists.xensource.com>) + id 1PHpON-0000fV-A9 + for gcvxd-xen-devel@m.gmane.org; Mon, 15 Nov 2010 04:06:03 +0100 +Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) + by lists.xensource.com with esmtp (Exim 4.43) + id 1PHpOK-0008Sa-VZ; Sun, 14 Nov 2010 19:06:01 -0800 +Received: from spam.xensource.com ([70.42.241.90]) + by lists.xensource.com with esmtp (Exim 4.43) id 1PHpOG-0008R4-01 + for xen-devel@lists.xensource.com; Sun, 14 Nov 2010 19:05:56 -0800 +X-ASG-Debug-ID: 1289790355-0739cd1c0001-8pertM +Received: from mail.perches.com (mail.perches.com [173.55.12.10]) by + spam.xensource.com with ESMTP id XhkGr3VGEwXLx5vl for + <xen-devel@lists.xensource.com>; + Sun, 14 Nov 2010 19:05:55 -0800 (PST) +X-Barracuda-Envelope-From: joe@perches.com +X-Barracuda-Apparent-Source-IP: 173.55.12.10 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 044672436E; + Sun, 14 Nov 2010 19:04:23 -0800 (PST) +X-ASG-Orig-Subj: [PATCH 31/44] drivers/xen: Remove unnecessary semicolons +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +X-Barracuda-Connect: mail.perches.com[173.55.12.10] +X-Barracuda-Start-Time: 1289790355 +X-Barracuda-URL: http://spam.xensource.com:8000/cgi-mod/mark.cgi +X-Virus-Scanned: by bsmtpd at xensource.com +X-Barracuda-Spam-Score: 0.00 +X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=3.5 + QUARANTINE_LEVEL=6.0 KILL_LEVEL=1000.0 tests= +X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.46657 + Rule breakdown below + pts rule name description + ---- ---------------------- + -------------------------------------------------- +X-BeenThere: xen-devel@lists.xensource.com +X-Mailman-Version: 2.1.5 +Precedence: list +List-Id: Xen developer discussion <xen-devel.lists.xensource.com> +List-Unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, + <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> +List-Post: <mailto:xen-devel@lists.xensource.com> +List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> +List-Subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, + <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> +Sender: xen-devel-bounces@lists.xensource.com +Errors-To: xen-devel-bounces@lists.xensource.com +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062277> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/xen/swiotlb-xen.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c +index 54469c3..65ea21a 100644 +--- a/drivers/xen/swiotlb-xen.c ++++ b/drivers/xen/swiotlb-xen.c +@@ -54,7 +54,7 @@ u64 start_dma_addr; + + static dma_addr_t xen_phys_to_bus(phys_addr_t paddr) + { +- return phys_to_machine(XPADDR(paddr)).maddr;; ++ return phys_to_machine(XPADDR(paddr)).maddr; + } + + static phys_addr_t xen_bus_to_phys(dma_addr_t baddr) +-- +1.7.3.1.g432b3.dirty + + diff --git a/test/corpora/lkml/cur/1382298793.002259:2, b/test/corpora/lkml/cur/1382298793.002259:2, new file mode 100644 index 00000000..de8e4275 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002259:2, @@ -0,0 +1,58 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 11/44] drivers/mmc: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:30 -0800 +Lines: 21 +Message-ID: <6391af02ba7ec4a76c5c5f462d8013fc1f52f999.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Chris Ball <cjb@laptop.org>, linux-mmc@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:06:20 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpOe-0000ny-CV + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:06:20 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932688Ab0KODFg (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:05:36 -0500 +Received: from mail.perches.com ([173.55.12.10]:1153 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932652Ab0KODFe (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:34 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id DD07924374; + Sun, 14 Nov 2010 19:04:01 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062278> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/mmc/host/davinci_mmc.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c +index e15547c..b643dde 100644 +--- a/drivers/mmc/host/davinci_mmc.c ++++ b/drivers/mmc/host/davinci_mmc.c +@@ -480,7 +480,7 @@ static void mmc_davinci_send_dma_request(struct mmc_davinci_host *host, + struct scatterlist *sg; + unsigned sg_len; + unsigned bytes_left = host->bytes_left; +- const unsigned shift = ffs(rw_threshold) - 1;; ++ const unsigned shift = ffs(rw_threshold) - 1; + + if (host->data_dir == DAVINCI_MMC_DATADIR_WRITE) { + template = &host->tx_template; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002260:2, b/test/corpora/lkml/cur/1382298793.002260:2, new file mode 100644 index 00000000..2b5145ff --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002260:2, @@ -0,0 +1,57 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 20/44] drivers/power: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:39 -0800 +Lines: 21 +Message-ID: <2f2ed8aa6745be23063fed55243313839d7ba523.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:06:22 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpOe-0000ny-TB + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:06:21 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932773Ab0KODFm (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:05:42 -0500 +Received: from mail.perches.com ([173.55.12.10]:1185 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932746Ab0KODFk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:40 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 3664A2436B; + Sun, 14 Nov 2010 19:04:08 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062279> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/power/intel_mid_battery.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/power/intel_mid_battery.c b/drivers/power/intel_mid_battery.c +index 2a10cd3..8397978 100644 +--- a/drivers/power/intel_mid_battery.c ++++ b/drivers/power/intel_mid_battery.c +@@ -522,7 +522,7 @@ static int pmic_battery_set_charger(struct pmic_power_module_info *pbi, + if (retval) { + dev_warn(pbi->dev, "%s(): ipc pmic read failed\n", + __func__); +- return retval;; ++ return retval; + } + + return 0; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002261:2, b/test/corpora/lkml/cur/1382298793.002261:2, new file mode 100644 index 00000000..28aac74d --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002261:2, @@ -0,0 +1,58 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 02/44] arch/microblaze: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:21 -0800 +Lines: 21 +Message-ID: <5d57b90b488b4338bcdc3f0fbf5f6996842bd44d.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Michal Simek <monstr@monstr.eu>, microblaze-uclinux@itee.uq.edu.au, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:06:22 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpOd-0000ny-SE + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:06:20 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932624Ab0KODFc (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:05:32 -0500 +Received: from mail.perches.com ([173.55.12.10]:1127 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1757330Ab0KODF3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:29 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id EF7FB2436C; + Sun, 14 Nov 2010 19:03:55 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062280> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + arch/microblaze/lib/memmove.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/arch/microblaze/lib/memmove.c b/arch/microblaze/lib/memmove.c +index 123e361..810fd68 100644 +--- a/arch/microblaze/lib/memmove.c ++++ b/arch/microblaze/lib/memmove.c +@@ -182,7 +182,7 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) + for (; c >= 4; c -= 4) { + value = *--i_src; + *--i_dst = buf_hold | ((value & 0xFF000000)>> 24); +- buf_hold = (value & 0xFFFFFF) << 8;; ++ buf_hold = (value & 0xFFFFFF) << 8; + } + #endif + /* Realign the source */ +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002262:2, b/test/corpora/lkml/cur/1382298793.002262:2, new file mode 100644 index 00000000..b931922c --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002262:2, @@ -0,0 +1,59 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 25/44] drivers/scsi/pm8001: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:44 -0800 +Lines: 21 +Message-ID: <20b352f91642ca45ad730d8eeec0bbd323d26626.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: jack_wang@usish.com, lindar_liu@usish.com, + "James E.J. Bottomley" <James.Bottomley@suse.de>, + linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:06:22 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpOf-0000ny-V3 + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:06:22 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932817Ab0KODFp (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:05:45 -0500 +Received: from mail.perches.com ([173.55.12.10]:1198 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932690Ab0KODFn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:43 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 22C0624374; + Sun, 14 Nov 2010 19:04:11 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062281> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/scsi/pm8001/pm8001_init.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c +index f8c86b2..be210dd 100644 +--- a/drivers/scsi/pm8001/pm8001_init.c ++++ b/drivers/scsi/pm8001/pm8001_init.c +@@ -160,7 +160,7 @@ static void pm8001_free(struct pm8001_hba_info *pm8001_ha) + static void pm8001_tasklet(unsigned long opaque) + { + struct pm8001_hba_info *pm8001_ha; +- pm8001_ha = (struct pm8001_hba_info *)opaque;; ++ pm8001_ha = (struct pm8001_hba_info *)opaque; + if (unlikely(!pm8001_ha)) + BUG_ON(1); + PM8001_CHIP_DISP->isr(pm8001_ha); +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002263:2, b/test/corpora/lkml/cur/1382298793.002263:2, new file mode 100644 index 00000000..4014b080 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002263:2, @@ -0,0 +1,58 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 43/44] sound/core/pcm_lib.c: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:05:02 -0800 +Lines: 21 +Message-ID: <9fa8e193ce125ef4fd19a952792629c5ee84953f.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:06:24 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpOg-0000ny-Vl + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:06:23 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933024Ab0KODGF (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:06:05 -0500 +Received: from mail.perches.com ([173.55.12.10]:1272 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932998Ab0KODGD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:06:03 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id E309C24378; + Sun, 14 Nov 2010 19:04:30 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062282> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + sound/core/pcm_lib.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c +index a1707cc..b75db8e 100644 +--- a/sound/core/pcm_lib.c ++++ b/sound/core/pcm_lib.c +@@ -223,7 +223,7 @@ static void xrun_log(struct snd_pcm_substream *substream, + entry->jiffies = jiffies; + entry->pos = pos; + entry->period_size = runtime->period_size; +- entry->buffer_size = runtime->buffer_size;; ++ entry->buffer_size = runtime->buffer_size; + entry->old_hw_ptr = runtime->status->hw_ptr; + entry->hw_ptr_base = runtime->hw_ptr_base; + log->idx = (log->idx + 1) % XRUN_LOG_CNT; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002264:2, b/test/corpora/lkml/cur/1382298793.002264:2, new file mode 100644 index 00000000..17d8127a --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002264:2, @@ -0,0 +1,103 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 44/44] sound/soc/codecs: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:05:03 -0800 +Lines: 62 +Message-ID: <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk>, + Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:06:24 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpOh-0000ny-G0 + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:06:23 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933041Ab0KODGR (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:06:17 -0500 +Received: from mail.perches.com ([173.55.12.10]:1275 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932999Ab0KODGE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:06:04 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 2AAD92436C; + Sun, 14 Nov 2010 19:04:32 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062283> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + sound/soc/codecs/wm8904.c | 2 +- + sound/soc/codecs/wm8940.c | 1 - + sound/soc/codecs/wm8993.c | 2 +- + sound/soc/codecs/wm_hubs.c | 2 +- + 4 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c +index 33be84e..99ae66d 100644 +--- a/sound/soc/codecs/wm8904.c ++++ b/sound/soc/codecs/wm8904.c +@@ -1590,7 +1590,7 @@ static int wm8904_hw_params(struct snd_pcm_substream *substream, + - wm8904->fs); + for (i = 1; i < ARRAY_SIZE(clk_sys_rates); i++) { + cur_val = abs((wm8904->sysclk_rate / +- clk_sys_rates[i].ratio) - wm8904->fs);; ++ clk_sys_rates[i].ratio) - wm8904->fs); + if (cur_val < best_val) { + best = i; + best_val = cur_val; +diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c +index 2cb16f8..e3f3572 100644 +--- a/sound/soc/codecs/wm8940.c ++++ b/sound/soc/codecs/wm8940.c +@@ -735,7 +735,6 @@ static int wm8940_probe(struct snd_soc_codec *codec) + return ret; + + return ret; +-; + } + + static int wm8940_remove(struct snd_soc_codec *codec) +diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c +index 589e3fa..74af9c5 100644 +--- a/sound/soc/codecs/wm8993.c ++++ b/sound/soc/codecs/wm8993.c +@@ -1225,7 +1225,7 @@ static int wm8993_hw_params(struct snd_pcm_substream *substream, + - wm8993->fs); + for (i = 1; i < ARRAY_SIZE(clk_sys_rates); i++) { + cur_val = abs((wm8993->sysclk_rate / +- clk_sys_rates[i].ratio) - wm8993->fs);; ++ clk_sys_rates[i].ratio) - wm8993->fs); + if (cur_val < best_val) { + best = i; + best_val = cur_val; +diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c +index 19ca782..2afbc7a 100644 +--- a/sound/soc/codecs/wm_hubs.c ++++ b/sound/soc/codecs/wm_hubs.c +@@ -112,7 +112,7 @@ static void calibrate_dc_servo(struct snd_soc_codec *codec) + switch (hubs->dcs_readback_mode) { + case 0: + reg_l = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_1) +- & WM8993_DCS_INTEG_CHAN_0_MASK;; ++ & WM8993_DCS_INTEG_CHAN_0_MASK; + reg_r = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_2) + & WM8993_DCS_INTEG_CHAN_1_MASK; + break; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002265:2, b/test/corpora/lkml/cur/1382298793.002265:2, new file mode 100644 index 00000000..c4c55c78 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002265:2, @@ -0,0 +1,76 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 19/44] drivers/platform/x86: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:38 -0800 +Lines: 35 +Message-ID: <eda82bcfaad265fc5cd3901bc4f41bfcfac2403b.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>, + Daniel Oliveira Nascimento <don@syst.com.br>, + Matthew Garrett <mjg@redhat.com>, + Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>, + platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, + ibm-acpi-devel@lists.sourceforge.net +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:06:22 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpOf-0000ny-DL + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:06:21 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932793Ab0KODFn (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:05:43 -0500 +Received: from mail.perches.com ([173.55.12.10]:1183 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932690Ab0KODFk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:40 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 96EF224372; + Sun, 14 Nov 2010 19:04:07 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062284> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/platform/x86/classmate-laptop.c | 2 +- + drivers/platform/x86/thinkpad_acpi.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c +index 341cbfe..d2b7720 100644 +--- a/drivers/platform/x86/classmate-laptop.c ++++ b/drivers/platform/x86/classmate-laptop.c +@@ -653,7 +653,7 @@ static void cmpc_keys_handler(struct acpi_device *dev, u32 event) + + if ((event & 0x0F) < ARRAY_SIZE(cmpc_keys_codes)) + code = cmpc_keys_codes[event & 0x0F]; +- inputdev = dev_get_drvdata(&dev->dev);; ++ inputdev = dev_get_drvdata(&dev->dev); + input_report_key(inputdev, code, !(event & 0x10)); + } + +diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c +index 2d61186..3cd7814 100644 +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -6345,7 +6345,7 @@ static int __init brightness_init(struct ibm_init_struct *iibm) + "as change notification\n"); + tpacpi_hotkey_driver_mask_set(hotkey_driver_mask + | TP_ACPI_HKEY_BRGHTUP_MASK +- | TP_ACPI_HKEY_BRGHTDWN_MASK);; ++ | TP_ACPI_HKEY_BRGHTDWN_MASK); + return 0; + } + +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002266:2, b/test/corpora/lkml/cur/1382298793.002266:2, new file mode 100644 index 00000000..cc365317 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002266:2, @@ -0,0 +1,75 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 28/44] drivers/spi: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:47 -0800 +Lines: 35 +Message-ID: <fe5e5e0efbd97eaa32530eef5ed47efdc3252dad.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: David Brownell <dbrownell@users.sourceforge.net>, + Grant Likely <grant.likely@secretlab.ca>, + Wan ZongShun <mcuos.com@gmail.com>, + spi-devel-general@lists.sourceforge.net, + linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:06:22 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpOg-0000ny-FJ + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:06:22 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932836Ab0KODFr (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:05:47 -0500 +Received: from mail.perches.com ([173.55.12.10]:1208 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932690Ab0KODFq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:46 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 454B624375; + Sun, 14 Nov 2010 19:04:13 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062285> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/spi/amba-pl022.c | 2 +- + drivers/spi/spi_nuc900.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c +index fb3d1b3..2e50631 100644 +--- a/drivers/spi/amba-pl022.c ++++ b/drivers/spi/amba-pl022.c +@@ -956,7 +956,7 @@ static int configure_dma(struct pl022 *pl022) + tx_conf.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; + break; + case WRITING_U32: +- tx_conf.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;; ++ tx_conf.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + break; + } + +diff --git a/drivers/spi/spi_nuc900.c b/drivers/spi/spi_nuc900.c +index dff63be..d5be18b 100644 +--- a/drivers/spi/spi_nuc900.c ++++ b/drivers/spi/spi_nuc900.c +@@ -449,7 +449,7 @@ err_iomap: + release_mem_region(hw->res->start, resource_size(hw->res)); + kfree(hw->ioarea); + err_pdata: +- spi_master_put(hw->master);; ++ spi_master_put(hw->master); + + err_nomem: + return err; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002267:2, b/test/corpora/lkml/cur/1382298793.002267:2, new file mode 100644 index 00000000..d3acae54 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002267:2, @@ -0,0 +1,773 @@ +From: Joe Perches <joe@perches.com> +Subject: =?UTF-8?q?=5BPATCH=2029/44=5D=20drivers/staging=3A=20Remove=20unnecessary=20semicolons?= +Date: Sun, 14 Nov 2010 19:04:48 -0800 +Lines: 724 +Message-ID: <3246dc176a2c553078e73332f02d802dd8ef7942.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: multipart/mixed; boundary="===============1088501263==" +Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman <gregkh@suse.de>, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: devel-bounces@linuxdriverproject.org Mon Nov 15 04:06:51 2010 +Return-path: <devel-bounces@linuxdriverproject.org> +Envelope-to: glddd-devel@m.gmane.org +Received: from driverdev.linuxdriverproject.org ([140.211.166.17]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <devel-bounces@linuxdriverproject.org>) + id 1PHpP7-000137-TU + for glddd-devel@m.gmane.org; Mon, 15 Nov 2010 04:06:50 +0100 +Received: from driverdev.linuxdriverproject.org (localhost [127.0.0.1]) + by driverdev.linuxdriverproject.org (Postfix) with ESMTP id 01FCE460C4; + Sun, 14 Nov 2010 19:05:00 -0800 (PST) +X-Original-To: devel@driverdev.osuosl.org +Delivered-To: devel@driverdev.osuosl.org +Received: from mail.perches.com (mail.perches.com [173.55.12.10]) + by driverdev.linuxdriverproject.org (Postfix) with ESMTP id 8F70A460C6 + for <devel@driverdev.osuosl.org>; Sun, 14 Nov 2010 19:04:05 -0800 (PST) +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id C136B2436B; + Sun, 14 Nov 2010 19:04:21 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +X-BeenThere: devel@linuxdriverproject.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: Linux Driver Project Developer List <devel.linuxdriverproject.org> +List-Unsubscribe: <http://driverdev.linuxdriverproject.org/mailman/options/devel>, + <mailto:devel-request@linuxdriverproject.org?subject=unsubscribe> +List-Archive: <http://driverdev.linuxdriverproject.org/pipermail/devel> +List-Post: <mailto:devel@linuxdriverproject.org> +List-Help: <mailto:devel-request@linuxdriverproject.org?subject=help> +List-Subscribe: <http://driverdev.linuxdriverproject.org/mailman/listinfo/devel>, + <mailto:devel-request@linuxdriverproject.org?subject=subscribe> +Sender: devel-bounces@linuxdriverproject.org +Errors-To: devel-bounces@linuxdriverproject.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062286> + +--===============1088501263== +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable + +Signed-off-by: Joe Perches <joe@perches.com> +--- + .../staging/ath6kl/hif/sdio/linux_sdio/src/hif.c | 2 +- + drivers/staging/ath6kl/os/linux/ar6000_drv.c | 2 +- + drivers/staging/bcm/InterfaceInit.c | 2 +- + drivers/staging/bcm/InterfaceIsr.c | 2 +- + drivers/staging/bcm/Misc.c | 4 ++-- + .../comedi/drivers/addi-data/APCI1710_Tor.c | 2 +- + .../comedi/drivers/addi-data/hwdrv_apci1500.c | 2 +- + .../comedi/drivers/addi-data/hwdrv_apci1516.c | 2 +- + .../comedi/drivers/addi-data/hwdrv_apci3501.c | 2 +- + drivers/staging/comedi/drivers/amplc_pci230.c | 2 +- + drivers/staging/comedi/drivers/cb_das16_cs.c | 2 +- + drivers/staging/comedi/drivers/comedi_bond.c | 2 +- + drivers/staging/crystalhd/crystalhd_hw.c | 2 +- + drivers/staging/go7007/go7007-driver.c | 2 +- + drivers/staging/iio/accel/lis3l02dq_ring.c | 2 +- + .../staging/intel_sst/intel_sst_drv_interface.c | 4 ++-- + drivers/staging/keucr/smilmain.c | 4 ++-- + drivers/staging/keucr/smilsub.c | 4 ++-- + drivers/staging/msm/lcdc_toshiba_wvga_pt.c | 2 +- + drivers/staging/rt2860/common/cmm_data_pci.c | 4 ++-- + drivers/staging/rt2860/rt_linux.c | 2 +- + drivers/staging/rt2860/rtmp.h | 2 +- + drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c | 2 +- + drivers/staging/rtl8192e/r819xE_phy.c | 2 +- + drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 2 +- + drivers/staging/rtl8192u/r8192U_core.c | 2 +- + drivers/staging/rtl8192u/r819xU_phy.c | 2 +- + drivers/staging/rtl8712/rtl8712_efuse.c | 2 +- + drivers/staging/rtl8712/rtl8712_xmit.c | 2 +- + drivers/staging/rtl8712/rtl871x_xmit.c | 2 +- + drivers/staging/tidspbridge/core/tiomap3430.c | 4 ++-- + drivers/staging/tidspbridge/rmgr/nldr.c | 2 +- + drivers/staging/vt6655/card.c | 2 +- + drivers/staging/vt6655/iwctl.c | 2 +- + drivers/staging/vt6655/wpa2.c | 4 ++-- + drivers/staging/vt6656/baseband.c | 2 +- + drivers/staging/vt6656/iwctl.c | 2 +- + drivers/staging/vt6656/power.c | 2 +- + drivers/staging/vt6656/wpa2.c | 4 ++-- + 39 files changed, 47 insertions(+), 47 deletions(-) + +diff --git a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c b/drive= +rs/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c +index c307a55..3963038 100644 +--- a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c ++++ b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c +@@ -876,7 +876,7 @@ HIFAckInterrupt(HIF_DEVICE *device) + void + HIFUnMaskInterrupt(HIF_DEVICE *device) + { +- int ret;; ++ int ret; +=20 + AR_DEBUG_ASSERT(device !=3D NULL); + AR_DEBUG_ASSERT(device->func !=3D NULL); +diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/stagi= +ng/ath6kl/os/linux/ar6000_drv.c +index a659f70..126a36a 100644 +--- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c ++++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c +@@ -4439,7 +4439,7 @@ skip_key: + for (i =3D assoc_req_ie_pos; i < assoc_req_ie_pos + assocReqLen = +- 4; i++) { + AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("%2.2x ", assocInfo[= +i])); + sprintf(pos, "%2.2x", assocInfo[i]); +- pos +=3D 2;; ++ pos +=3D 2; + } + AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("\n")); +=20 +diff --git a/drivers/staging/bcm/InterfaceInit.c b/drivers/staging/bcm/In= +terfaceInit.c +index 824f9a4..a368011 100644 +--- a/drivers/staging/bcm/InterfaceInit.c ++++ b/drivers/staging/bcm/InterfaceInit.c +@@ -265,7 +265,7 @@ usbbcm_device_probe(struct usb_interface *intf, const= + struct usb_device_id *id) + uint32_t uiNackZeroLengthInt=3D4; + if(wrmalt(psAdapter, DISABLE_USB_ZERO_LEN_INT, &uiNackZeroLengthInt, s= +izeof(uiNackZeroLengthInt))) + { +- return -EIO;; ++ return -EIO; + } + } +=20 +diff --git a/drivers/staging/bcm/InterfaceIsr.c b/drivers/staging/bcm/Int= +erfaceIsr.c +index f928fe4..604d07f 100644 +--- a/drivers/staging/bcm/InterfaceIsr.c ++++ b/drivers/staging/bcm/InterfaceIsr.c +@@ -87,7 +87,7 @@ static void read_int_callback(struct urb *urb/*, struct= + pt_regs *regs*/) + BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Int= +errupt IN endPoint has got halted/stalled...need to clear this"); + Adapter->bEndPointHalted =3D TRUE ; + wake_up(&Adapter->tx_packet_wait_queue); +- urb->status =3D STATUS_SUCCESS ;; ++ urb->status =3D STATUS_SUCCESS ; + return; + } + /* software-driven interface shutdown */ +diff --git a/drivers/staging/bcm/Misc.c b/drivers/staging/bcm/Misc.c +index 22550f7..cd14fec 100644 +--- a/drivers/staging/bcm/Misc.c ++++ b/drivers/staging/bcm/Misc.c +@@ -764,7 +764,7 @@ void SendIdleModeResponse(PMINI_ADAPTER Adapter) +=20 + /* Wake the LED Thread with IDLEMODE_ENTER State */ + Adapter->DriverState =3D LOWPOWER_MODE_ENTER; +- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL,"LED Thread = +is Running..Hence Setting LED Event as IDLEMODE_ENTER jiffies:%ld",jiffie= +s);; ++ BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL,"LED Thread = +is Running..Hence Setting LED Event as IDLEMODE_ENTER jiffies:%ld",jiffie= +s); + wake_up(&Adapter->LEDInfo.notify_led_event); +=20 + /* Wait for 1 SEC for LED to OFF */ +@@ -1410,7 +1410,7 @@ int bcm_parse_target_params(PMINI_ADAPTER Adapter) +=20 + void beceem_parse_target_struct(PMINI_ADAPTER Adapter) + { +- UINT uiHostDrvrCfg6 =3D0, uiEEPROMFlag =3D 0;; ++ UINT uiHostDrvrCfg6 =3D0, uiEEPROMFlag =3D 0; +=20 + if(ntohl(Adapter->pstargetparams->m_u32PhyParameter2) & AUTO_SYNC_DISAB= +LE) + { +diff --git a/drivers/staging/comedi/drivers/addi-data/APCI1710_Tor.c b/dr= +ivers/staging/comedi/drivers/addi-data/APCI1710_Tor.c +index 7361d50..0e6affd 100644 +--- a/drivers/staging/comedi/drivers/addi-data/APCI1710_Tor.c ++++ b/drivers/staging/comedi/drivers/addi-data/APCI1710_Tor.c +@@ -1008,7 +1008,7 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(str= +uct comedi_device *dev, + b_ExternGate =3D (unsigned char) data[3]; + b_CycleMode =3D (unsigned char) data[4]; + b_InterruptEnable =3D (unsigned char) data[5]; +- i_ReturnValue =3D insn->n;; ++ i_ReturnValue =3D insn->n; + devpriv->tsk_Current =3D current; /* Save the current process task str= +ucture */ + /**************************/ + /* Test the module number */ +diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c b/= +drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c +index 2a8a6c7..62f421a 100644 +--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c ++++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c +@@ -2850,7 +2850,7 @@ static int i_APCI1500_Reset(struct comedi_device *d= +ev) + i_Logic =3D 0; + i_CounterLogic =3D 0; + i_InterruptMask =3D 0; +- i_InputChannel =3D 0;; ++ i_InputChannel =3D 0; + i_TimerCounter1Enabled =3D 0; + i_TimerCounter2Enabled =3D 0; + i_WatchdogCounter3Enabled =3D 0; +diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c b/= +drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c +index 12fcc35..8a584a0 100644 +--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c ++++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c +@@ -335,7 +335,7 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_devic= +e *dev, struct comedi_subde + return -EINVAL; + } /* if else data[3]=3D=3D1) */ + } /* if else data[3]=3D=3D0) */ +- return (insn->n);; ++ return (insn->n); + } +=20 + /* +diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c b/= +drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c +index 356a189..acaceb0 100644 +--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c ++++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c +@@ -339,7 +339,7 @@ int i_APCI3501_ConfigAnalogOutput(struct comedi_devic= +e *dev, struct comedi_subde + int i_APCI3501_WriteAnalogOutput(struct comedi_device *dev, struct comed= +i_subdevice *s, + struct comedi_insn *insn, unsigned int *data) + { +- unsigned int ul_Command1 =3D 0, ul_Channel_no, ul_Polarity, ul_DAC_Read= +y =3D 0;; ++ unsigned int ul_Command1 =3D 0, ul_Channel_no, ul_Polarity, ul_DAC_Read= +y =3D 0; +=20 + ul_Channel_no =3D CR_CHAN(insn->chanspec); +=20 +diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/stag= +ing/comedi/drivers/amplc_pci230.c +index 5d06457..7edeb11 100644 +--- a/drivers/staging/comedi/drivers/amplc_pci230.c ++++ b/drivers/staging/comedi/drivers/amplc_pci230.c +@@ -971,7 +971,7 @@ static int pci230_attach(struct comedi_device *dev, s= +truct comedi_devconfig *it) + if (thisboard->ao_chans > 0) { + s->type =3D COMEDI_SUBD_AO; + s->subdev_flags =3D SDF_WRITABLE | SDF_GROUND; +- s->n_chan =3D thisboard->ao_chans;; ++ s->n_chan =3D thisboard->ao_chans; + s->maxdata =3D (1 << thisboard->ao_bits) - 1; + s->range_table =3D &pci230_ao_range; + s->insn_write =3D &pci230_ao_winsn; +diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/stagi= +ng/comedi/drivers/cb_das16_cs.c +index 0345b4c..bb93685 100644 +--- a/drivers/staging/comedi/drivers/cb_das16_cs.c ++++ b/drivers/staging/comedi/drivers/cb_das16_cs.c +@@ -169,7 +169,7 @@ static int das16cs_attach(struct comedi_device *dev, + if (!link) + return -EIO; +=20 +- dev->iobase =3D link->resource[0]->start;; ++ dev->iobase =3D link->resource[0]->start; + printk("I/O base=3D0x%04lx ", dev->iobase); +=20 + printk("fingerprint:\n"); +diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/stagi= +ng/comedi/drivers/comedi_bond.c +index cfcbd9b..d8aefb2 100644 +--- a/drivers/staging/comedi/drivers/comedi_bond.c ++++ b/drivers/staging/comedi/drivers/comedi_bond.c +@@ -370,7 +370,7 @@ static int doDevConfig(struct comedi_device *dev, str= +uct comedi_devconfig *it) + struct comedi_device *devs_opened[COMEDI_NUM_BOARD_MINORS]; +=20 + memset(devs_opened, 0, sizeof(devs_opened)); +- devpriv->name[0] =3D 0;; ++ devpriv->name[0] =3D 0; + /* Loop through all comedi devices specified on the command-line, + building our device list */ + for (i =3D 0; i < COMEDI_NDEVCONFOPTS && (!i || it->options[i]); ++i) { +diff --git a/drivers/staging/crystalhd/crystalhd_hw.c b/drivers/staging/c= +rystalhd/crystalhd_hw.c +index f631857..153ddbf 100644 +--- a/drivers/staging/crystalhd/crystalhd_hw.c ++++ b/drivers/staging/crystalhd/crystalhd_hw.c +@@ -1711,7 +1711,7 @@ enum BC_STATUS crystalhd_download_fw(struct crystal= +hd_adp *adp, void *buffer, ui + } +=20 + BCMLOG(BCMLOG_INFO, "Firmware Downloaded Successfully\n"); +- return BC_STS_SUCCESS;; ++ return BC_STS_SUCCESS; + } +=20 + enum BC_STATUS crystalhd_do_fw_cmd(struct crystalhd_hw *hw, +diff --git a/drivers/staging/go7007/go7007-driver.c b/drivers/staging/go7= +007/go7007-driver.c +index b3f42f3..8426a02 100644 +--- a/drivers/staging/go7007/go7007-driver.c ++++ b/drivers/staging/go7007/go7007-driver.c +@@ -624,7 +624,7 @@ struct go7007 *go7007_alloc(struct go7007_board_info = +*board, struct device *dev) + go->dvd_mode =3D 0; + go->interlace_coding =3D 0; + for (i =3D 0; i < 4; ++i) +- go->modet[i].enable =3D 0;; ++ go->modet[i].enable =3D 0; + for (i =3D 0; i < 1624; ++i) + go->modet_map[i] =3D 0; + go->audio_deliver =3D NULL; +diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c b/drivers/staging= +/iio/accel/lis3l02dq_ring.c +index 330d5d6..1fd088a 100644 +--- a/drivers/staging/iio/accel/lis3l02dq_ring.c ++++ b/drivers/staging/iio/accel/lis3l02dq_ring.c +@@ -517,7 +517,7 @@ int lis3l02dq_configure_ring(struct iio_dev *indio_de= +v) +=20 + ret =3D iio_alloc_pollfunc(indio_dev, NULL, &lis3l02dq_poll_func_th); + if (ret) +- goto error_iio_sw_rb_free;; ++ goto error_iio_sw_rb_free; + indio_dev->modes |=3D INDIO_RING_TRIGGERED; + return 0; +=20 +diff --git a/drivers/staging/intel_sst/intel_sst_drv_interface.c b/driver= +s/staging/intel_sst/intel_sst_drv_interface.c +index 669e298..6443fbd 100644 +--- a/drivers/staging/intel_sst/intel_sst_drv_interface.c ++++ b/drivers/staging/intel_sst/intel_sst_drv_interface.c +@@ -171,9 +171,9 @@ static int sst_get_sfreq(struct snd_sst_params *str_p= +aram) + case SST_CODEC_TYPE_MP3: + return str_param->sparams.uc.mp3_params.sfreq; + case SST_CODEC_TYPE_AAC: +- return str_param->sparams.uc.aac_params.sfreq;; ++ return str_param->sparams.uc.aac_params.sfreq; + case SST_CODEC_TYPE_WMA9: +- return str_param->sparams.uc.wma_params.sfreq;; ++ return str_param->sparams.uc.wma_params.sfreq; + default: + return 0; + } +diff --git a/drivers/staging/keucr/smilmain.c b/drivers/staging/keucr/smi= +lmain.c +index bdfbf76..2cbe9f8 100644 +--- a/drivers/staging/keucr/smilmain.c ++++ b/drivers/staging/keucr/smilmain.c +@@ -153,9 +153,9 @@ int Media_D_ReadSector(struct us_data *us, DWORD star= +t,WORD count,BYTE *buf) + WORD len, bn; +=20 + //if (Check_D_MediaPower()) ; =A6b 6250 don't care +- // return(ErrCode); ; ++ // return(ErrCode); + //if (Check_D_MediaFmt(fdoExt)) ; +- // return(ErrCode); ; ++ // return(ErrCode); + if (Conv_D_MediaAddr(us, start)) + return(ErrCode); +=20 +diff --git a/drivers/staging/keucr/smilsub.c b/drivers/staging/keucr/smil= +sub.c +index 1b52535..ce10cf2 100644 +--- a/drivers/staging/keucr/smilsub.c ++++ b/drivers/staging/keucr/smilsub.c +@@ -763,8 +763,8 @@ int Ssfdc_D_WriteSectForCopy(struct us_data *us, BYTE= + *buf, BYTE *redundant) + bcb->CDB[7] =3D (BYTE)addr; + bcb->CDB[6] =3D (BYTE)(addr/0x0100); + bcb->CDB[5] =3D Media.Zone/2; +- bcb->CDB[8] =3D *(redundant+REDT_ADDR1H);; +- bcb->CDB[9] =3D *(redundant+REDT_ADDR1L);; ++ bcb->CDB[8] =3D *(redundant+REDT_ADDR1H); ++ bcb->CDB[9] =3D *(redundant+REDT_ADDR1L); +=20 + result =3D ENE_SendScsiCmd(us, FDIR_WRITE, buf, 0); + if (result !=3D USB_STOR_XFER_GOOD) +diff --git a/drivers/staging/msm/lcdc_toshiba_wvga_pt.c b/drivers/staging= +/msm/lcdc_toshiba_wvga_pt.c +index 864d7c1..edba78a 100644 +--- a/drivers/staging/msm/lcdc_toshiba_wvga_pt.c ++++ b/drivers/staging/msm/lcdc_toshiba_wvga_pt.c +@@ -77,7 +77,7 @@ static void toshiba_spi_write(char cmd, uint32 data, in= +t num) +=20 + /* followed by parameter bytes */ + if (num) { +- bp =3D (char *)&data;; ++ bp =3D (char *)&data; + bp +=3D (num - 1); + while (num) { + toshiba_spi_write_byte(1, *bp); +diff --git a/drivers/staging/rt2860/common/cmm_data_pci.c b/drivers/stagi= +ng/rt2860/common/cmm_data_pci.c +index 43d73a0..7af59ff 100644 +--- a/drivers/staging/rt2860/common/cmm_data_pci.c ++++ b/drivers/staging/rt2860/common/cmm_data_pci.c +@@ -137,7 +137,7 @@ u16 RtmpPCI_WriteSingleTxResource(struct rt_rtmp_adap= +ter *pAd, +=20 + pTxD->SDPtr0 =3D BufBasePaLow; + pTxD->SDLen0 =3D TXINFO_SIZE + TXWI_SIZE + hwHeaderLen; /* include padd= +ing */ +- pTxD->SDPtr1 =3D PCI_MAP_SINGLE(pAd, pTxBlk, 0, 1, PCI_DMA_TODEVICE);; ++ pTxD->SDPtr1 =3D PCI_MAP_SINGLE(pAd, pTxBlk, 0, 1, PCI_DMA_TODEVICE); + pTxD->SDLen1 =3D pTxBlk->SrcBufLen; + pTxD->LastSec0 =3D 0; + pTxD->LastSec1 =3D (bIsLast) ? 1 : 0; +@@ -215,7 +215,7 @@ u16 RtmpPCI_WriteMultiTxResource(struct rt_rtmp_adapt= +er *pAd, +=20 + pTxD->SDPtr0 =3D BufBasePaLow; + pTxD->SDLen0 =3D firstDMALen; /* include padding */ +- pTxD->SDPtr1 =3D PCI_MAP_SINGLE(pAd, pTxBlk, 0, 1, PCI_DMA_TODEVICE);; ++ pTxD->SDPtr1 =3D PCI_MAP_SINGLE(pAd, pTxBlk, 0, 1, PCI_DMA_TODEVICE); + pTxD->SDLen1 =3D pTxBlk->SrcBufLen; + pTxD->LastSec0 =3D 0; + pTxD->LastSec1 =3D (bIsLast) ? 1 : 0; +diff --git a/drivers/staging/rt2860/rt_linux.c b/drivers/staging/rt2860/r= +t_linux.c +index abfeea1..7dad6ee 100644 +--- a/drivers/staging/rt2860/rt_linux.c ++++ b/drivers/staging/rt2860/rt_linux.c +@@ -854,7 +854,7 @@ void send_monitor_packets(struct rt_rtmp_adapter *pAd= +, struct rt_rx_blk *pRxBlk) + RSSI1, + RSSI_1), + ConvertToRssi(pAd, pRxBlk->pRxWI->RSSI2, +- RSSI_2));; ++ RSSI_2)); +=20 + ph->signal.did =3D DIDmsg_lnxind_wlansniffrm_signal; + ph->signal.status =3D 0; +diff --git a/drivers/staging/rt2860/rtmp.h b/drivers/staging/rt2860/rtmp.= +h +index ca54e53..26cc823 100644 +--- a/drivers/staging/rt2860/rtmp.h ++++ b/drivers/staging/rt2860/rtmp.h +@@ -2978,7 +2978,7 @@ void LinkDown(struct rt_rtmp_adapter *pAd, IN BOOLE= +AN IsReqFromAP); +=20 + void IterateOnBssTab(struct rt_rtmp_adapter *pAd); +=20 +-void IterateOnBssTab2(struct rt_rtmp_adapter *pAd);; ++void IterateOnBssTab2(struct rt_rtmp_adapter *pAd); +=20 + void JoinParmFill(struct rt_rtmp_adapter *pAd, + struct rt_mlme_join_req *JoinReq, unsigned long BssIdx); +diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c b/drivers/= +staging/rtl8192e/ieee80211/ieee80211_tx.c +index dd8a221..b26b5a8 100644 +--- a/drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c +@@ -822,7 +822,7 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct ne= +t_device *dev) + { + txb->queue_index =3D UP2AC(skb->priority); + } else { +- txb->queue_index =3D WME_AC_BK;; ++ txb->queue_index =3D WME_AC_BK; + } +=20 +=20 +diff --git a/drivers/staging/rtl8192e/r819xE_phy.c b/drivers/staging/rtl8= +192e/r819xE_phy.c +index d83bcbc..50cd0e5 100644 +--- a/drivers/staging/rtl8192e/r819xE_phy.c ++++ b/drivers/staging/rtl8192e/r819xE_phy.c +@@ -2596,7 +2596,7 @@ u8 rtl8192_phy_ConfigRFWithHeaderFile(struct net_de= +vice* dev, RF90_RADIO_PATH_E + break; + } +=20 +- return ret;; ++ return ret; +=20 + } + /***********************************************************************= +******* +diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/= +staging/rtl8192u/ieee80211/ieee80211_tx.c +index 81aa2ed..ec7845e 100644 +--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c ++++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +@@ -754,7 +754,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_de= +vice *dev) + { + txb->queue_index =3D UP2AC(skb->priority); + } else { +- txb->queue_index =3D WME_AC_BK;; ++ txb->queue_index =3D WME_AC_BK; + } +=20 +=20 +diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl= +8192u/r8192U_core.c +index 494f180..1139a27 100644 +--- a/drivers/staging/rtl8192u/r8192U_core.c ++++ b/drivers/staging/rtl8192u/r8192U_core.c +@@ -5085,7 +5085,7 @@ static void rtl8192_query_rxphystatus( + //Get Rx snr value in DB + tmp_rxsnr =3D pofdm_buf->rxsnr_X[i]; + rx_snrX =3D (char)(tmp_rxsnr); +- //rx_snrX >>=3D 1;; ++ //rx_snrX >>=3D 1; + rx_snrX /=3D 2; + priv->stats.rxSNRdB[i] =3D (long)rx_snrX; +=20 +diff --git a/drivers/staging/rtl8192u/r819xU_phy.c b/drivers/staging/rtl8= +192u/r819xU_phy.c +index a3adaed..8e10992 100644 +--- a/drivers/staging/rtl8192u/r819xU_phy.c ++++ b/drivers/staging/rtl8192u/r819xU_phy.c +@@ -1011,7 +1011,7 @@ u8 rtl8192_phy_ConfigRFWithHeaderFile(struct net_de= +vice* dev, RF90_RADIO_PATH_E + break; + } +=20 +- return ret;; ++ return ret; +=20 + } + /***********************************************************************= +******* +diff --git a/drivers/staging/rtl8712/rtl8712_efuse.c b/drivers/staging/rt= +l8712/rtl8712_efuse.c +index 9730ae1..1dc12b7 100644 +--- a/drivers/staging/rtl8712/rtl8712_efuse.c ++++ b/drivers/staging/rtl8712/rtl8712_efuse.c +@@ -428,7 +428,7 @@ u8 r8712_efuse_access(struct _adapter *padapter, u8 b= +Read, u16 start_addr, + u16 cnts, u8 *data) + { + int i; +- u8 res =3D true;; ++ u8 res =3D true; +=20 + if (start_addr > EFUSE_MAX_SIZE) + return false; +diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl= +8712/rtl8712_xmit.c +index 8edc518..88a1504 100644 +--- a/drivers/staging/rtl8712/rtl8712_xmit.c ++++ b/drivers/staging/rtl8712/rtl8712_xmit.c +@@ -148,7 +148,7 @@ static u32 get_ff_hwaddr(struct xmit_frame *pxmitfram= +e) + case 0x11: + case 0x12: + case 0x13: +- addr =3D RTL8712_DMA_H2CCMD;; ++ addr =3D RTL8712_DMA_H2CCMD; + break; + default: + addr =3D RTL8712_DMA_BEQ;/*RTL8712_EP_LO;*/ +diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl= +8712/rtl871x_xmit.c +index b8195e3..75f1a6b 100644 +--- a/drivers/staging/rtl8712/rtl871x_xmit.c ++++ b/drivers/staging/rtl8712/rtl871x_xmit.c +@@ -372,7 +372,7 @@ static sint xmitframe_addmic(struct _adapter *padapte= +r, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0}; + datalen =3D pattrib->pktlen - pattrib->hdrlen; +- pframe =3D pxmitframe->buf_addr + TXDESC_OFFSET;; ++ pframe =3D pxmitframe->buf_addr + TXDESC_OFFSET; + if (bmcst) { + if (!memcmp(psecuritypriv->XGrptxmickey + [psecuritypriv->XGrpKeyid].skey, +diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/stag= +ing/tidspbridge/core/tiomap3430.c +index 1be081f..a3b0a18 100644 +--- a/drivers/staging/tidspbridge/core/tiomap3430.c ++++ b/drivers/staging/tidspbridge/core/tiomap3430.c +@@ -596,7 +596,7 @@ static int bridge_brd_start(struct bridge_dev_context= + *dev_ctxt, + dev_dbg(bridge, "DSP c_int00 Address =3D 0x%x\n", dsp_addr); + if (dsp_debug) + while (__raw_readw(dw_sync_addr)) +- ;; ++ ; +=20 + /* Wait for DSP to clear word in shared memory */ + /* Read the Location */ +@@ -1671,7 +1671,7 @@ static int pte_set(struct pg_table_attrs *pt, u32 p= +a, u32 va, + /* Find a free L2 PT. */ + for (i =3D 0; (i < pt->l2_num_pages) && + (pt->pg_info[i].num_entries !=3D 0); i++) +- ;; ++ ; + if (i < pt->l2_num_pages) { + l2_page_num =3D i; + l2_base_pa =3D pt->l2_base_pa + (l2_page_num * +diff --git a/drivers/staging/tidspbridge/rmgr/nldr.c b/drivers/staging/ti= +dspbridge/rmgr/nldr.c +index a6ae007..28354bb 100644 +--- a/drivers/staging/tidspbridge/rmgr/nldr.c ++++ b/drivers/staging/tidspbridge/rmgr/nldr.c +@@ -943,7 +943,7 @@ static int add_ovly_info(void *handle, struct dbll_se= +ct_info *sect_info, +=20 + /* Determine which phase this section belongs to */ + for (pch =3D sect_name + 1; *pch && *pch !=3D seps; pch++) +- ;; ++ ; +=20 + if (*pch) { + pch++; /* Skip over the ':' */ +diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.= +c +index 32d095c..951a3a8 100644 +--- a/drivers/staging/vt6655/card.c ++++ b/drivers/staging/vt6655/card.c +@@ -2058,7 +2058,7 @@ bool CARDbSoftwareReset (void *pDeviceHandler) + QWORD CARDqGetTSFOffset (unsigned char byRxRate, QWORD qwTSF1, QWORD qwT= +SF2) + { + QWORD qwTSFOffset; +- unsigned short wRxBcnTSFOffst=3D 0;; ++ unsigned short wRxBcnTSFOffst=3D 0; +=20 + HIDWORD(qwTSFOffset) =3D 0; + LODWORD(qwTSFOffset) =3D 0; +diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwct= +l.c +index 92e3399..5e425d1 100644 +--- a/drivers/staging/vt6655/iwctl.c ++++ b/drivers/staging/vt6655/iwctl.c +@@ -2073,7 +2073,7 @@ int iwctl_giwencodeext(struct net_device *dev, + struct iw_point *wrq, + char *extra) + { +- return -EOPNOTSUPP;; ++ return -EOPNOTSUPP; + } +=20 + int iwctl_siwmlme(struct net_device *dev, +diff --git a/drivers/staging/vt6655/wpa2.c b/drivers/staging/vt6655/wpa2.= +c +index 805164b..744799c 100644 +--- a/drivers/staging/vt6655/wpa2.c ++++ b/drivers/staging/vt6655/wpa2.c +@@ -216,7 +216,7 @@ WPA2vParseRSN ( + m =3D *((unsigned short *) &(pRSN->abyRSN[4])); +=20 + if (pRSN->len >=3D 10+m*4) { // ver(2) + GK(4) + PK count(2) + P= +KS(4*m) + AKMSS count(2) +- pBSSNode->wAKMSSAuthCount =3D *((unsigned short *) &(pRSN->a= +byRSN[6+4*m]));; ++ pBSSNode->wAKMSSAuthCount =3D *((unsigned short *) &(pRSN->a= +byRSN[6+4*m])); + j =3D 0; + pbyOUI =3D &(pRSN->abyRSN[8+4*m]); + for (i =3D 0; (i < pBSSNode->wAKMSSAuthCount) && (j < sizeof= +(pBSSNode->abyAKMSSAuthType)/sizeof(unsigned char)); i++) { +@@ -235,7 +235,7 @@ WPA2vParseRSN ( + pBSSNode->wAKMSSAuthCount =3D (unsigned short)j; + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAKMSSAuthCount: %d\n", p= +BSSNode->wAKMSSAuthCount); +=20 +- n =3D *((unsigned short *) &(pRSN->abyRSN[6+4*m]));; ++ n =3D *((unsigned short *) &(pRSN->abyRSN[6+4*m])); + if (pRSN->len >=3D 12+4*m+4*n) { // ver(2)+GK(4)+PKCnt(2)+PK= +S(4*m)+AKMSSCnt(2)+AKMSS(4*n)+Cap(2) + pBSSNode->sRSNCapObj.bRSNCapExist =3D true; + pBSSNode->sRSNCapObj.wRSNCap =3D *((unsigned short *) &(= +pRSN->abyRSN[8+4*m+4*n])); +diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/b= +aseband.c +index e5add20..0d11147 100644 +--- a/drivers/staging/vt6656/baseband.c ++++ b/drivers/staging/vt6656/baseband.c +@@ -963,7 +963,7 @@ BBvSetAntennaMode (PSDevice pDevice, BYTE byAntennaMo= +de) + break; + case ANT_RXB: + pDevice->byBBRxConf &=3D 0xFE; +- pDevice->byBBRxConf |=3D 0x02;; ++ pDevice->byBBRxConf |=3D 0x02; + break; + } +=20 +diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwct= +l.c +index 0004be8..2121205 100644 +--- a/drivers/staging/vt6656/iwctl.c ++++ b/drivers/staging/vt6656/iwctl.c +@@ -1883,7 +1883,7 @@ int iwctl_giwencodeext(struct net_device *dev, + struct iw_point *wrq, + char *extra) + { +- return -EOPNOTSUPP;; ++ return -EOPNOTSUPP; + } +=20 + int iwctl_siwmlme(struct net_device *dev, +diff --git a/drivers/staging/vt6656/power.c b/drivers/staging/vt6656/powe= +r.c +index 0c12fd3..e8c1b35 100644 +--- a/drivers/staging/vt6656/power.c ++++ b/drivers/staging/vt6656/power.c +@@ -192,7 +192,7 @@ BOOL PSbConsiderPowerDown(void *hDeviceContext, + // check if already in Doze mode + ControlvReadByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PSCTL, &by= +Data); + if ( (byData & PSCTL_PS) !=3D 0 ) +- return TRUE;; ++ return TRUE; +=20 + if (pMgmt->eCurrMode !=3D WMAC_MODE_IBSS_STA) { + // check if in TIM wake period +diff --git a/drivers/staging/vt6656/wpa2.c b/drivers/staging/vt6656/wpa2.= +c +index 6d13190..d4f3f75 100644 +--- a/drivers/staging/vt6656/wpa2.c ++++ b/drivers/staging/vt6656/wpa2.c +@@ -215,7 +215,7 @@ WPA2vParseRSN ( + m =3D *((PWORD) &(pRSN->abyRSN[4])); +=20 + if (pRSN->len >=3D 10+m*4) { // ver(2) + GK(4) + PK count(2) + P= +KS(4*m) + AKMSS count(2) +- pBSSNode->wAKMSSAuthCount =3D *((PWORD) &(pRSN->abyRSN[6+4*m= +]));; ++ pBSSNode->wAKMSSAuthCount =3D *((PWORD) &(pRSN->abyRSN[6+4*m= +])); + j =3D 0; + pbyOUI =3D &(pRSN->abyRSN[8+4*m]); + for (i =3D 0; (i < pBSSNode->wAKMSSAuthCount) && (j < sizeof= +(pBSSNode->abyAKMSSAuthType)/sizeof(BYTE)); i++) { +@@ -234,7 +234,7 @@ WPA2vParseRSN ( + pBSSNode->wAKMSSAuthCount =3D (WORD)j; + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAKMSSAuthCount: %d\n", p= +BSSNode->wAKMSSAuthCount); +=20 +- n =3D *((PWORD) &(pRSN->abyRSN[6+4*m]));; ++ n =3D *((PWORD) &(pRSN->abyRSN[6+4*m])); + if (pRSN->len >=3D 12+4*m+4*n) { // ver(2)+GK(4)+PKCnt(2)+PK= +S(4*m)+AKMSSCnt(2)+AKMSS(4*n)+Cap(2) + pBSSNode->sRSNCapObj.bRSNCapExist =3D TRUE; + pBSSNode->sRSNCapObj.wRSNCap =3D *((PWORD) &(pRSN->abyRS= +N[8+4*m+4*n])); +--=20 +1.7.3.1.g432b3.dirty + + +--===============1088501263== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +_______________________________________________ +devel mailing list +devel@linuxdriverproject.org +http://driverdev.linuxdriverproject.org/mailman/listinfo/devel + +--===============1088501263==-- + + + diff --git a/test/corpora/lkml/cur/1382298793.002268:2, b/test/corpora/lkml/cur/1382298793.002268:2, new file mode 100644 index 00000000..116de343 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002268:2, @@ -0,0 +1,66 @@ +From: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org> +Subject: [PATCH 42/44] net/sunrpc/addr.c: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:05:01 -0800 +Lines: 26 +Message-ID: <aca92092a705e0d21176b5ac7d3581c4f9140dbc.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: "J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>, + Neil Brown <neilb-l3A5Bk7waGM@public.gmane.org>, + Trond Myklebust <Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>, + "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, + netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Jiri Kosina <trivial-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> +X-From: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Mon Nov 15 04:07:25 2010 +Return-path: <linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glN-linux-nfs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1PHpPh-0001H8-D9 + for glN-linux-nfs-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Mon, 15 Nov 2010 04:07:25 +0100 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S932828Ab0KODGd (ORCPT <rfc822;glN-linux-nfs@m.gmane.org>); + Sun, 14 Nov 2010 22:06:33 -0500 +Received: from mail.perches.com ([173.55.12.10]:1267 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932988Ab0KODGD (ORCPT <rfc822;linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Sun, 14 Nov 2010 22:06:03 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 3EB452436E; + Sun, 14 Nov 2010 19:04:30 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org> +Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-nfs.vger.kernel.org> +X-Mailing-List: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062287> + +Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org> +--- + net/sunrpc/addr.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c +index 1419d0c..4195233 100644 +--- a/net/sunrpc/addr.c ++++ b/net/sunrpc/addr.c +@@ -151,7 +151,7 @@ static size_t rpc_pton4(const char *buf, const size_t buflen, + return 0; + + sin->sin_family = AF_INET; +- return sizeof(struct sockaddr_in);; ++ return sizeof(struct sockaddr_in); + } + + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +-- +1.7.3.1.g432b3.dirty + +-- +To unsubscribe from this list: send the line "unsubscribe linux-nfs" in +the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298793.002269:2, b/test/corpora/lkml/cur/1382298793.002269:2, new file mode 100644 index 00000000..2e2652ac --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002269:2, @@ -0,0 +1,74 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 32/44] fs/9p: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:51 -0800 +Lines: 35 +Message-ID: <f6ae29dfdd0b9ad401f5eb77ae670212689ee921.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Eric Van Hensbergen <ericvh@gmail.com>, + Ron Minnich <rminnich@sandia.gov>, + Latchesar Ionkov <lucho@ionkov.net>, + v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:07:26 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpPg-0001H8-Sy + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:07:25 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932992Ab0KODGD (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:06:03 -0500 +Received: from mail.perches.com ([173.55.12.10]:1227 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932846Ab0KODF4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:56 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id C9F2E2436F; + Sun, 14 Nov 2010 19:04:23 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062288> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + fs/9p/acl.c | 2 +- + fs/9p/xattr.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/fs/9p/acl.c b/fs/9p/acl.c +index 12d6023..bc4da9a 100644 +--- a/fs/9p/acl.c ++++ b/fs/9p/acl.c +@@ -28,7 +28,7 @@ static struct posix_acl *__v9fs_get_acl(struct p9_fid *fid, char *name) + { + ssize_t size; + void *value = NULL; +- struct posix_acl *acl = NULL;; ++ struct posix_acl *acl = NULL; + + size = v9fs_fid_xattr_get(fid, name, NULL, 0); + if (size > 0) { +diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c +index 43ec7df..d288773 100644 +--- a/fs/9p/xattr.c ++++ b/fs/9p/xattr.c +@@ -133,7 +133,7 @@ int v9fs_xattr_set(struct dentry *dentry, const char *name, + "p9_client_xattrcreate failed %d\n", retval); + goto error; + } +- msize = fid->clnt->msize;; ++ msize = fid->clnt->msize; + while (value_len) { + if (value_len > (msize - P9_IOHDRSZ)) + write_count = msize - P9_IOHDRSZ; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002270:2, b/test/corpora/lkml/cur/1382298793.002270:2, new file mode 100644 index 00000000..8e093063 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002270:2, @@ -0,0 +1,68 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 41/44] net/ipv6/mcast.c: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:05:00 -0800 +Lines: 26 +Message-ID: <1f3e1f7e454f3c62b66fc5f3e1e1ed90d62b7fb0.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: "David S. Miller" <davem@davemloft.net>, + Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>, + "Pekka Savola (ipv6)" <pekkas@netcore.fi>, + James Morris <jmorris@namei.org>, + Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>, + Patrick McHardy <kaber@trash.net>, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: netdev-owner@vger.kernel.org Mon Nov 15 04:07:30 2010 +Return-path: <netdev-owner@vger.kernel.org> +Envelope-to: linux-netdev-2@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <netdev-owner@vger.kernel.org>) + id 1PHpPi-0001H8-UT + for linux-netdev-2@lo.gmane.org; Mon, 15 Nov 2010 04:07:27 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933051Ab0KODGq (ORCPT <rfc822;linux-netdev-2@m.gmane.org>); + Sun, 14 Nov 2010 22:06:46 -0500 +Received: from mail.perches.com ([173.55.12.10]:1258 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932980Ab0KODGC (ORCPT <rfc822;netdev@vger.kernel.org>); + Sun, 14 Nov 2010 22:06:02 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 8F37A24377; + Sun, 14 Nov 2010 19:04:29 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: netdev-owner@vger.kernel.org +Precedence: bulk +List-ID: <netdev.vger.kernel.org> +X-Mailing-List: netdev@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062289> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + net/ipv6/mcast.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c +index d1444b9..9c50745 100644 +--- a/net/ipv6/mcast.c ++++ b/net/ipv6/mcast.c +@@ -257,7 +257,7 @@ static struct inet6_dev *ip6_mc_find_dev_rcu(struct net *net, + return NULL; + idev = __in6_dev_get(dev); + if (!idev) +- return NULL;; ++ return NULL; + read_lock_bh(&idev->lock); + if (idev->dead) { + read_unlock_bh(&idev->lock); +-- +1.7.3.1.g432b3.dirty + +-- +To unsubscribe from this list: send the line "unsubscribe netdev" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298793.002271:2, b/test/corpora/lkml/cur/1382298793.002271:2, new file mode 100644 index 00000000..144fc890 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002271:2, @@ -0,0 +1,58 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 38/44] include/linux/if_macvlan.h: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:57 -0800 +Lines: 21 +Message-ID: <186ca914f887b2354ea3178696edc81cacbb28c6.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Patrick McHardy <kaber@trash.net>, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:08:18 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpQX-0001fQ-U4 + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:08:18 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933080Ab0KODHz (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:07:55 -0500 +Received: from mail.perches.com ([173.55.12.10]:1249 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932730Ab0KODGA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:06:00 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id AAEDA24375; + Sun, 14 Nov 2010 19:04:27 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062290> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + include/linux/if_macvlan.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h +index 8a2fd66..ac96a2d 100644 +--- a/include/linux/if_macvlan.h ++++ b/include/linux/if_macvlan.h +@@ -69,7 +69,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, + rx_stats = this_cpu_ptr(vlan->rx_stats); + if (likely(success)) { + u64_stats_update_begin(&rx_stats->syncp); +- rx_stats->rx_packets++;; ++ rx_stats->rx_packets++; + rx_stats->rx_bytes += len; + if (multicast) + rx_stats->rx_multicast++; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002272:2, b/test/corpora/lkml/cur/1382298793.002272:2, new file mode 100644 index 00000000..f276bb4b --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002272:2, @@ -0,0 +1,59 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 37/44] fs/ubifs: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:56 -0800 +Lines: 21 +Message-ID: <902d76520da2f65e5dc44339dccb07159947f23d.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Artem Bityutskiy <dedekind1@gmail.com>, + Adrian Hunter <adrian.hunter@nokia.com>, + linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:08:19 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpQY-0001fQ-EH + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:08:18 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933129Ab0KODH5 (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:07:57 -0500 +Received: from mail.perches.com ([173.55.12.10]:1247 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932907Ab0KODF7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:59 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 0CF9424374; + Sun, 14 Nov 2010 19:04:27 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062291> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + fs/ubifs/scan.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c +index 3e1ee57..36216b4 100644 +--- a/fs/ubifs/scan.c ++++ b/fs/ubifs/scan.c +@@ -328,7 +328,7 @@ struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum, + if (!quiet) + ubifs_err("empty space starts at non-aligned offset %d", + offs); +- goto corrupted;; ++ goto corrupted; + } + + ubifs_end_scan(c, sleb, lnum, offs); +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002273:2, b/test/corpora/lkml/cur/1382298793.002273:2, new file mode 100644 index 00000000..d5eca3bb --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002273:2, @@ -0,0 +1,64 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 39/44] include/net/caif/cfctrl.h: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:58 -0800 +Lines: 26 +Message-ID: <35914cfea1bd0ab3963e632d02b1fdd52a9d2bc8.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Sjur Braendeland <sjur.brandeland@stericsson.com>, + "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: netdev-owner@vger.kernel.org Mon Nov 15 04:08:21 2010 +Return-path: <netdev-owner@vger.kernel.org> +Envelope-to: linux-netdev-2@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <netdev-owner@vger.kernel.org>) + id 1PHpQW-0001fQ-TC + for linux-netdev-2@lo.gmane.org; Mon, 15 Nov 2010 04:08:17 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932988Ab0KODHd (ORCPT <rfc822;linux-netdev-2@m.gmane.org>); + Sun, 14 Nov 2010 22:07:33 -0500 +Received: from mail.perches.com ([173.55.12.10]:1252 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932944Ab0KODGB (ORCPT <rfc822;netdev@vger.kernel.org>); + Sun, 14 Nov 2010 22:06:01 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 4F8E124376; + Sun, 14 Nov 2010 19:04:28 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: netdev-owner@vger.kernel.org +Precedence: bulk +List-ID: <netdev.vger.kernel.org> +X-Mailing-List: netdev@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062292> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + include/net/caif/cfctrl.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h +index 9402543..e54f639 100644 +--- a/include/net/caif/cfctrl.h ++++ b/include/net/caif/cfctrl.h +@@ -51,7 +51,7 @@ struct cfctrl_rsp { + void (*restart_rsp)(void); + void (*radioset_rsp)(void); + void (*reject_rsp)(struct cflayer *layer, u8 linkid, +- struct cflayer *client_layer);; ++ struct cflayer *client_layer); + }; + + /* Link Setup Parameters for CAIF-Links. */ +-- +1.7.3.1.g432b3.dirty + +-- +To unsubscribe from this list: send the line "unsubscribe netdev" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298793.002274:2, b/test/corpora/lkml/cur/1382298793.002274:2, new file mode 100644 index 00000000..087ddf20 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002274:2, @@ -0,0 +1,59 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 30/44] drivers/usb/gadget: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:49 -0800 +Lines: 21 +Message-ID: <cdc48b6ab9446585f304c801cca45a2a9d1e37ec.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: David Brownell <dbrownell@users.sourceforge.net>, + Greg Kroah-Hartman <gregkh@suse.de>, linux-usb@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:08:56 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpR9-0001sn-P6 + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:08:56 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932917Ab0KODF7 (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:05:59 -0500 +Received: from mail.perches.com ([173.55.12.10]:1216 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932842Ab0KODFz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:55 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 6C4A92436C; + Sun, 14 Nov 2010 19:04:22 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062293> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/usb/gadget/f_fs.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c +index 4a830df..38bb200 100644 +--- a/drivers/usb/gadget/f_fs.c ++++ b/drivers/usb/gadget/f_fs.c +@@ -2096,7 +2096,7 @@ static int __ffs_func_bind_do_descs(enum ffs_entity_type type, u8 *valuep, + ep = usb_ep_autoconfig(func->gadget, ds); + if (unlikely(!ep)) + return -ENOTSUPP; +- ep->driver_data = func->eps + idx;; ++ ep->driver_data = func->eps + idx; + + req = usb_ep_alloc_request(ep, GFP_KERNEL); + if (unlikely(!req)) +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002275:2, b/test/corpora/lkml/cur/1382298793.002275:2, new file mode 100644 index 00000000..32fa526f --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002275:2, @@ -0,0 +1,59 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 36/44] fs/ocfs2: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:55 -0800 +Lines: 21 +Message-ID: <e32409b17aaa1a54fec85f3654583ef08fcf851c.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Mark Fasheh <mfasheh@suse.com>, + Joel Becker <joel.becker@oracle.com>, + ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:08:57 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpRA-0001sn-Pm + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:08:57 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933007Ab0KODI2 (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:08:28 -0500 +Received: from mail.perches.com ([173.55.12.10]:1239 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932884Ab0KODF7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:59 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 54CEB24372; + Sun, 14 Nov 2010 19:04:26 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062294> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + fs/ocfs2/refcounttree.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c +index b5f9160..da14a42 100644 +--- a/fs/ocfs2/refcounttree.c ++++ b/fs/ocfs2/refcounttree.c +@@ -3704,7 +3704,7 @@ int ocfs2_refcount_cow_xattr(struct inode *inode, + context->cow_start = cow_start; + context->cow_len = cow_len; + context->ref_tree = ref_tree; +- context->ref_root_bh = ref_root_bh;; ++ context->ref_root_bh = ref_root_bh; + context->cow_object = xv; + + context->cow_duplicate_clusters = ocfs2_duplicate_clusters_by_jbd; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002276:2, b/test/corpora/lkml/cur/1382298793.002276:2, new file mode 100644 index 00000000..9e318aaf --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002276:2, @@ -0,0 +1,58 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 35/44] fs/nfs: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:54 -0800 +Lines: 21 +Message-ID: <ec29c2321578915d1d219f5ad00b876a3ff1a105.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Trond Myklebust <Trond.Myklebust@netapp.com>, + linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:09:03 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpRB-0001sn-9x + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:08:57 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933153Ab0KODIl (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:08:41 -0500 +Received: from mail.perches.com ([173.55.12.10]:1236 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932876Ab0KODF6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:58 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 8DCD324371; + Sun, 14 Nov 2010 19:04:25 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062295> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + fs/nfs/getroot.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c +index ac7b814..e17f628 100644 +--- a/fs/nfs/getroot.c ++++ b/fs/nfs/getroot.c +@@ -190,7 +190,7 @@ struct dentry *nfs4_get_root(struct super_block *sb, struct nfs_fh *mntfh) + + fattr = nfs_alloc_fattr(); + if (fattr == NULL) +- return ERR_PTR(-ENOMEM);; ++ return ERR_PTR(-ENOMEM); + + /* get the actual root for this mount */ + error = server->nfs_client->rpc_ops->getattr(server, mntfh, fattr); +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002277:2, b/test/corpora/lkml/cur/1382298793.002277:2, new file mode 100644 index 00000000..7fb2d9a4 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002277:2, @@ -0,0 +1,58 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 34/44] fs/logfs: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:53 -0800 +Lines: 21 +Message-ID: <0c990bdacb2f9bf256acbb06ca59130585f600b7.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Joern Engel <joern@logfs.org>, logfs@logfs.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:09:34 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpRl-000297-1j + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:09:33 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933187Ab0KODI4 (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:08:56 -0500 +Received: from mail.perches.com ([173.55.12.10]:1234 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932859Ab0KODF5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:57 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 0339024370; + Sun, 14 Nov 2010 19:04:25 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062296> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + fs/logfs/readwrite.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/fs/logfs/readwrite.c b/fs/logfs/readwrite.c +index 6127baf..b4304f2 100644 +--- a/fs/logfs/readwrite.c ++++ b/fs/logfs/readwrite.c +@@ -481,7 +481,7 @@ static int inode_write_alias(struct super_block *sb, + val = inode_val0(inode); + break; + case INODE_USED_OFS: +- val = cpu_to_be64(li->li_used_bytes);; ++ val = cpu_to_be64(li->li_used_bytes); + break; + case INODE_SIZE_OFS: + val = cpu_to_be64(i_size_read(inode)); +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002278:2, b/test/corpora/lkml/cur/1382298793.002278:2, new file mode 100644 index 00000000..3048c162 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002278:2, @@ -0,0 +1,63 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 33/44] fs/ceph: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:52 -0800 +Lines: 26 +Message-ID: <e01252afc842668a94fb0549e2d1833d77a6411f.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Sage Weil <sage@newdream.net>, ceph-devel@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: ceph-devel-owner@vger.kernel.org Mon Nov 15 04:09:34 2010 +Return-path: <ceph-devel-owner@vger.kernel.org> +Envelope-to: gcfcd-ceph-devel3-2@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <ceph-devel-owner@vger.kernel.org>) + id 1PHpRl-000297-Hx + for gcfcd-ceph-devel3-2@lo.gmane.org; Mon, 15 Nov 2010 04:09:33 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932690Ab0KODJN (ORCPT <rfc822;gcfcd-ceph-devel3-2@m.gmane.org>); + Sun, 14 Nov 2010 22:09:13 -0500 +Received: from mail.perches.com ([173.55.12.10]:1231 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932849Ab0KODF5 (ORCPT <rfc822;ceph-devel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:57 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 69DEF2436B; + Sun, 14 Nov 2010 19:04:24 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: ceph-devel-owner@vger.kernel.org +Precedence: bulk +List-ID: <ceph-devel.vger.kernel.org> +X-Mailing-List: ceph-devel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062297> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + fs/ceph/mds_client.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c +index 3142b15..931124c 100644 +--- a/fs/ceph/mds_client.c ++++ b/fs/ceph/mds_client.c +@@ -2023,7 +2023,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) + } else { + struct ceph_inode_info *ci = ceph_inode(req->r_inode); + struct ceph_cap *cap = +- ceph_get_cap_for_mds(ci, req->r_mds);; ++ ceph_get_cap_for_mds(ci, req->r_mds); + + dout("already using auth"); + if ((!cap || cap != ci->i_auth_cap) || +-- +1.7.3.1.g432b3.dirty + +-- +To unsubscribe from this list: send the line "unsubscribe ceph-devel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298793.002279:2, b/test/corpora/lkml/cur/1382298793.002279:2, new file mode 100644 index 00000000..1dbe4c33 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002279:2, @@ -0,0 +1,88 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 26/44] drivers/scsi/qla2xxx: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:45 -0800 +Lines: 49 +Message-ID: <40854ce1b1e958e2c0bb9b79911d89b45b5e5f27.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>, + linux-driver@qlogic.com, + "James E.J. Bottomley" <James.Bottomley@suse.de>, + linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-scsi-owner@vger.kernel.org Mon Nov 15 04:10:09 2010 +Return-path: <linux-scsi-owner@vger.kernel.org> +Envelope-to: lnx-linux-scsi@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-scsi-owner@vger.kernel.org>) + id 1PHpSK-0002RT-EP + for lnx-linux-scsi@lo.gmane.org; Mon, 15 Nov 2010 04:10:08 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932860Ab0KODJt (ORCPT <rfc822;lnx-linux-scsi@m.gmane.org>); + Sun, 14 Nov 2010 22:09:49 -0500 +Received: from mail.perches.com ([173.55.12.10]:1202 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932797Ab0KODFo (ORCPT <rfc822;linux-scsi@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:44 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id E65A02436B; + Sun, 14 Nov 2010 19:04:11 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-scsi-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-scsi.vger.kernel.org> +X-Mailing-List: linux-scsi@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062298> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/scsi/qla2xxx/qla_isr.c | 4 ++-- + drivers/scsi/qla2xxx/qla_nx.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c +index 1f06ddd..59c4870 100644 +--- a/drivers/scsi/qla2xxx/qla_isr.c ++++ b/drivers/scsi/qla2xxx/qla_isr.c +@@ -1049,7 +1049,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req, + } + DEBUG2(qla2x00_dump_buffer((uint8_t *)pkt, sizeof(*pkt))); + } else { +- bsg_job->reply->result = DID_OK << 16;; ++ bsg_job->reply->result = DID_OK << 16; + bsg_job->reply->reply_payload_rcv_len = + bsg_job->reply_payload.payload_len; + bsg_job->reply_len = 0; +@@ -1144,7 +1144,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req, + DEBUG2(qla2x00_dump_buffer((uint8_t *)pkt, sizeof(*pkt))); + } + else { +- bsg_job->reply->result = DID_OK << 16;; ++ bsg_job->reply->result = DID_OK << 16; + bsg_job->reply->reply_payload_rcv_len = bsg_job->reply_payload.payload_len; + bsg_job->reply_len = 0; + } +diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c +index 8d9edfb..de2d1eb 100644 +--- a/drivers/scsi/qla2xxx/qla_nx.c ++++ b/drivers/scsi/qla2xxx/qla_nx.c +@@ -1022,7 +1022,7 @@ ql82xx_rom_lock_d(struct qla_hw_data *ha) + qla_printk(KERN_WARNING, ha, "ROM lock failed\n"); + return -1; + } +- return 0;; ++ return 0; + } + + static int +-- +1.7.3.1.g432b3.dirty + +-- +To unsubscribe from this list: send the line "unsubscribe linux-scsi" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298793.002280:2, b/test/corpora/lkml/cur/1382298793.002280:2, new file mode 100644 index 00000000..f8961e73 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002280:2, @@ -0,0 +1,57 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 27/44] drivers/serial: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:46 -0800 +Lines: 21 +Message-ID: <57c2393ee99b62bca43fa1c510cae832795069ba.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:10:10 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpSJ-0002RT-DE + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:10:07 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932970Ab0KODJh (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:09:37 -0500 +Received: from mail.perches.com ([173.55.12.10]:1204 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932802Ab0KODFp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:45 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 7FB8224371; + Sun, 14 Nov 2010 19:04:12 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062299> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/serial/mrst_max3110.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/serial/mrst_max3110.c b/drivers/serial/mrst_max3110.c +index b62857b..00d284c 100644 +--- a/drivers/serial/mrst_max3110.c ++++ b/drivers/serial/mrst_max3110.c +@@ -56,7 +56,7 @@ struct uart_max3110 { + wait_queue_head_t wq; + struct task_struct *main_thread; + struct task_struct *read_thread; +- struct mutex thread_mutex;; ++ struct mutex thread_mutex; + + u32 baud; + u16 cur_conf; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002281:2, b/test/corpora/lkml/cur/1382298793.002281:2, new file mode 100644 index 00000000..a1349a92 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002281:2, @@ -0,0 +1,59 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 24/44] drivers/scsi/lpfc: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:43 -0800 +Lines: 21 +Message-ID: <1a0612305d3b141f85a6aeef6d91cd6829a80bae.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: James Smart <james.smart@emulex.com>, + "James E.J. Bottomley" <James.Bottomley@suse.de>, + linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:10:40 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpSn-0002jF-BC + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:10:37 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933110Ab0KODKE (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:10:04 -0500 +Received: from mail.perches.com ([173.55.12.10]:1195 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932782Ab0KODFn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:43 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 86AD42436E; + Sun, 14 Nov 2010 19:04:10 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062300> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/scsi/lpfc/lpfc_bsg.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c +index 7260c3a..9e2c652 100644 +--- a/drivers/scsi/lpfc/lpfc_bsg.c ++++ b/drivers/scsi/lpfc/lpfc_bsg.c +@@ -617,7 +617,7 @@ lpfc_bsg_rport_els(struct fc_bsg_job *job) + dd_data->context_un.iocb.cmdiocbq = cmdiocbq; + dd_data->context_un.iocb.rspiocbq = rspiocbq; + dd_data->context_un.iocb.set_job = job; +- dd_data->context_un.iocb.bmp = NULL;; ++ dd_data->context_un.iocb.bmp = NULL; + dd_data->context_un.iocb.ndlp = ndlp; + + if (phba->cfg_poll & DISABLE_FCP_RING_INT) { +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002282:2, b/test/corpora/lkml/cur/1382298793.002282:2, new file mode 100644 index 00000000..49db1225 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002282:2, @@ -0,0 +1,59 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 23/44] drivers/scsi/bfa: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:42 -0800 +Lines: 21 +Message-ID: <71d0d7db4197f7b6f6b946a295648dc18bd559e0.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Jing Huang <huangj@brocade.com>, + "James E.J. Bottomley" <James.Bottomley@suse.de>, + linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:10:53 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpT0-0002p1-2I + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:10:50 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932981Ab0KODKh (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:10:37 -0500 +Received: from mail.perches.com ([173.55.12.10]:1192 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932746Ab0KODFm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:42 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id EFB872436B; + Sun, 14 Nov 2010 19:04:09 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062301> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/scsi/bfa/bfa_fcs_lport.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c +index 377cbff..55b3f74 100644 +--- a/drivers/scsi/bfa/bfa_fcs_lport.c ++++ b/drivers/scsi/bfa/bfa_fcs_lport.c +@@ -1683,7 +1683,7 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld) + memcpy(attr->value, fcs_hba_attr->driver_version, attr->len); + attr->len = fc_roundup(attr->len, sizeof(u32)); + curr_ptr += sizeof(attr->type) + sizeof(attr->len) + attr->len; +- len += attr->len;; ++ len += attr->len; + count++; + attr->len = cpu_to_be16(attr->len + sizeof(attr->type) + + sizeof(attr->len)); +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002283:2, b/test/corpora/lkml/cur/1382298793.002283:2, new file mode 100644 index 00000000..6b6c9393 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002283:2, @@ -0,0 +1,68 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 22/44] drivers/scsi/be2iscsi: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:41 -0800 +Lines: 30 +Message-ID: <7d4fbb8d3ac34861808dac24efeebe05011f6b0c.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Jayamohan Kallickal <jayamohank@serverengines.com>, + "James E.J. Bottomley" <James.Bottomley@suse.de>, + linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:10:52 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpSz-0002p1-Hv + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:10:49 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932862Ab0KODKi (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:10:38 -0500 +Received: from mail.perches.com ([173.55.12.10]:1188 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932757Ab0KODFm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:42 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 610FF24371; + Sun, 14 Nov 2010 19:04:09 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062302> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/scsi/be2iscsi/be_main.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c +index 75a85aa..db60563 100644 +--- a/drivers/scsi/be2iscsi/be_main.c ++++ b/drivers/scsi/be2iscsi/be_main.c +@@ -618,7 +618,7 @@ static void beiscsi_get_params(struct beiscsi_hba *phba) + + BE2_NOPOUT_REQ)); + phba->params.cxns_per_ctrl = phba->fw_config.iscsi_cid_count; + phba->params.asyncpdus_per_ctrl = phba->fw_config.iscsi_cid_count * 2; +- phba->params.icds_per_ctrl = phba->fw_config.iscsi_icd_count;; ++ phba->params.icds_per_ctrl = phba->fw_config.iscsi_icd_count; + phba->params.num_sge_per_io = BE2_SGE; + phba->params.defpdu_hdr_sz = BE2_DEFPDU_HDR_SZ; + phba->params.defpdu_data_sz = BE2_DEFPDU_DATA_SZ; +@@ -781,7 +781,7 @@ static irqreturn_t be_isr(int irq, void *dev_id) + int isr; + + phba = dev_id; +- ctrl = &phba->ctrl;; ++ ctrl = &phba->ctrl; + isr = ioread32(ctrl->csr + CEV_ISR0_OFFSET + + (PCI_FUNC(ctrl->pdev->devfn) * CEV_ISR_SIZE)); + if (!isr) +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002284:2, b/test/corpora/lkml/cur/1382298793.002284:2, new file mode 100644 index 00000000..315c1be8 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002284:2, @@ -0,0 +1,61 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 15/44] drivers/net/vxge: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:34 -0800 +Lines: 21 +Message-ID: <e86e79a18106cc38715136bfb2e880b38f5ac764.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Ramkrishna Vepa <ramkrishna.vepa@exar.com>, + Sivakumar Subramani <sivakumar.subramani@exar.com>, + Sreenivasa Honnur <sreenivasa.honnur@exar.com>, + Jon Mason <jon.mason@exar.com>, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:11:16 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpTP-00032R-QK + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:11:16 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932740Ab0KODFk (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:05:40 -0500 +Received: from mail.perches.com ([173.55.12.10]:1166 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932690Ab0KODFh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:37 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id BAAD824377; + Sun, 14 Nov 2010 19:04:04 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062303> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/net/vxge/vxge-main.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c +index 813829f..93e80c5 100644 +--- a/drivers/net/vxge/vxge-main.c ++++ b/drivers/net/vxge/vxge-main.c +@@ -2062,7 +2062,7 @@ static irqreturn_t vxge_isr_napi(int irq, void *dev_id) + struct __vxge_hw_device *hldev; + u64 reason; + enum vxge_hw_status status; +- struct vxgedev *vdev = (struct vxgedev *) dev_id;; ++ struct vxgedev *vdev = (struct vxgedev *)dev_id; + + vxge_debug_intr(VXGE_TRACE, "%s:%d", __func__, __LINE__); + +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002285:2, b/test/corpora/lkml/cur/1382298793.002285:2, new file mode 100644 index 00000000..80ec0f90 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002285:2, @@ -0,0 +1,61 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 21/44] drivers/s390/net: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:40 -0800 +Lines: 21 +Message-ID: <ea09773876fb36a52a9a750110b381d20767ac12.1289789605.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Ursula Braun <ursula.braun@de.ibm.com>, + Frank Blaschka <blaschka@linux.vnet.ibm.com>, + linux390@de.ibm.com, Martin Schwidefsky <schwidefsky@de.ibm.com>, + Heiko Carstens <heiko.carstens@de.ibm.com>, + linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:11:19 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpTR-00032R-T3 + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:11:18 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932825Ab0KODLK (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:11:10 -0500 +Received: from mail.perches.com ([173.55.12.10]:1186 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932749Ab0KODFl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:41 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id C07A924370; + Sun, 14 Nov 2010 19:04:08 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062304> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/s390/net/qeth_core_sys.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c +index 42fa783..b5e967c 100644 +--- a/drivers/s390/net/qeth_core_sys.c ++++ b/drivers/s390/net/qeth_core_sys.c +@@ -372,7 +372,7 @@ static ssize_t qeth_dev_performance_stats_store(struct device *dev, + i = simple_strtoul(buf, &tmp, 16); + if ((i == 0) || (i == 1)) { + if (i == card->options.performance_stats) +- goto out;; ++ goto out; + card->options.performance_stats = i; + if (i == 0) + memset(&card->perf_stats, 0, +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002286:2, b/test/corpora/lkml/cur/1382298793.002286:2, new file mode 100644 index 00000000..9045476b --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002286:2, @@ -0,0 +1,62 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 17/44] drivers/net/wireless/iwlwifi: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:36 -0800 +Lines: 21 +Message-ID: <6beaab935c2c511a5833e855db527976ef05e2dc.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Reinette Chatre <reinette.chatre@intel.com>, + Wey-Yi Guy <wey-yi.w.guy@intel.com>, + Intel Linux Wireless <ilw@linux.intel.com>, + "John W. Linville" <linville@tuxdriver.com>, + linux-wireless@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:11:41 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpTn-0003Ei-3m + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:11:39 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933222Ab0KODLe (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:11:34 -0500 +Received: from mail.perches.com ([173.55.12.10]:1174 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932718Ab0KODFj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:39 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 3C0E524379; + Sun, 14 Nov 2010 19:04:06 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062305> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/net/wireless/iwlwifi/iwl-agn.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c +index c2636a7..f293fb6 100644 +--- a/drivers/net/wireless/iwlwifi/iwl-agn.c ++++ b/drivers/net/wireless/iwlwifi/iwl-agn.c +@@ -2420,7 +2420,7 @@ static const char *desc_lookup(u32 num) + max = ARRAY_SIZE(advanced_lookup) - 1; + for (i = 0; i < max; i++) { + if (advanced_lookup[i].num == num) +- break;; ++ break; + } + return advanced_lookup[i].name; + } +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002287:2, b/test/corpora/lkml/cur/1382298793.002287:2, new file mode 100644 index 00000000..4fa3cef9 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002287:2, @@ -0,0 +1,57 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 18/44] drivers/net/cnic.c: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:37 -0800 +Lines: 21 +Message-ID: <950331e47b16c2ad28d73502f30f5a0f017b5493.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:12:07 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpUF-0003Pl-09 + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:12:07 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933052Ab0KODLd (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:11:33 -0500 +Received: from mail.perches.com ([173.55.12.10]:1176 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932652Ab0KODFj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:39 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id D093A24378; + Sun, 14 Nov 2010 19:04:06 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062306> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/net/cnic.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c +index 92bac19..594ca9c 100644 +--- a/drivers/net/cnic.c ++++ b/drivers/net/cnic.c +@@ -1695,7 +1695,7 @@ static int cnic_bnx2x_iscsi_ofld1(struct cnic_dev *dev, struct kwqe *wqes[], + *work = num; + return -EINVAL; + } +- *work = 2 + req2->num_additional_wqes;; ++ *work = 2 + req2->num_additional_wqes; + + l5_cid = req1->iscsi_conn_id; + if (l5_cid >= MAX_ISCSI_TBL_SZ) +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002288:2, b/test/corpora/lkml/cur/1382298793.002288:2, new file mode 100644 index 00000000..5b1515ac --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002288:2, @@ -0,0 +1,63 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 16/44] drivers/net/wireless/ath: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:35 -0800 +Lines: 21 +Message-ID: <c375cdc1175018f00066e2220f1d659ca70cde16.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: "Luis R. Rodriguez" <lrodriguez@atheros.com>, + Jouni Malinen <jmalinen@atheros.com>, + Vasanthakumar Thiagarajan <vasanth@atheros.com>, + Senthil Balasubramanian <senthilkumar@atheros.com>, + "John W. Linville" <linville@tuxdriver.com>, + linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, + netdev@vger.kernel.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:12:48 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpUt-0003ie-NF + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:12:48 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932786Ab0KODMQ (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:12:16 -0500 +Received: from mail.perches.com ([173.55.12.10]:1169 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932695Ab0KODFi (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:38 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 6AD192437A; + Sun, 14 Nov 2010 19:04:05 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062307> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/net/wireless/ath/ath9k/htc.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h +index 75ecf6a..4c98b93 100644 +--- a/drivers/net/wireless/ath/ath9k/htc.h ++++ b/drivers/net/wireless/ath/ath9k/htc.h +@@ -434,7 +434,7 @@ void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb, + + void ath9k_htc_station_work(struct work_struct *work); + void ath9k_htc_aggr_work(struct work_struct *work); +-void ath9k_ani_work(struct work_struct *work);; ++void ath9k_ani_work(struct work_struct *work); + + int ath9k_tx_init(struct ath9k_htc_priv *priv); + void ath9k_tx_tasklet(unsigned long data); +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002289:2, b/test/corpora/lkml/cur/1382298793.002289:2, new file mode 100644 index 00000000..a6111d47 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002289:2, @@ -0,0 +1,86 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 09/44] drivers/media/video: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:28 -0800 +Lines: 49 +Message-ID: <d7cec5e05200050ee2c7f624eef8c571193b4d92.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Mauro Carvalho Chehab <mchehab@infradead.org>, + linux-media@vger.kernel.org, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-media-owner@vger.kernel.org Mon Nov 15 04:13:25 2010 +Return-path: <linux-media-owner@vger.kernel.org> +Envelope-to: gldv-linux-media@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-media-owner@vger.kernel.org>) + id 1PHpVT-00042L-DI + for gldv-linux-media@lo.gmane.org; Mon, 15 Nov 2010 04:13:23 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932630Ab0KODFd (ORCPT <rfc822;gldv-linux-media@m.gmane.org>); + Sun, 14 Nov 2010 22:05:33 -0500 +Received: from mail.perches.com ([173.55.12.10]:1148 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932627Ab0KODFd (ORCPT <rfc822;linux-media@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:33 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 873E324371; + Sun, 14 Nov 2010 19:04:00 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-media-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-media.vger.kernel.org> +X-Mailing-List: linux-media@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062308> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/media/video/cx88/cx88-blackbird.c | 2 +- + drivers/media/video/davinci/vpfe_capture.c | 2 +- + drivers/media/video/em28xx/em28xx-cards.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c +index 417d1d5..14b2546 100644 +--- a/drivers/media/video/cx88/cx88-blackbird.c ++++ b/drivers/media/video/cx88/cx88-blackbird.c +@@ -1065,7 +1065,7 @@ static int mpeg_open(struct file *file) + err = drv->request_acquire(drv); + if(err != 0) { + dprintk(1,"%s: Unable to acquire hardware, %d\n", __func__, err); +- mutex_unlock(&dev->core->lock);; ++ mutex_unlock(&dev->core->lock); + return err; + } + } +diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c +index d8e38cc..14f3d54 100644 +--- a/drivers/media/video/davinci/vpfe_capture.c ++++ b/drivers/media/video/davinci/vpfe_capture.c +@@ -1276,7 +1276,7 @@ static int vpfe_videobuf_prepare(struct videobuf_queue *vq, + vb->size = vpfe_dev->fmt.fmt.pix.sizeimage; + vb->field = field; + +- ret = videobuf_iolock(vq, vb, NULL);; ++ ret = videobuf_iolock(vq, vb, NULL); + if (ret < 0) + return ret; + +diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c +index 5485923..7aee7f0 100644 +--- a/drivers/media/video/em28xx/em28xx-cards.c ++++ b/drivers/media/video/em28xx/em28xx-cards.c +@@ -2408,7 +2408,7 @@ void em28xx_register_i2c_ir(struct em28xx *dev) + dev->init_data.get_key = em28xx_get_key_em_haup; + dev->init_data.name = "i2c IR (EM2840 Hauppauge)"; + case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE: +- dev->init_data.ir_codes = RC_MAP_WINFAST_USBII_DELUXE;; ++ dev->init_data.ir_codes = RC_MAP_WINFAST_USBII_DELUXE; + dev->init_data.get_key = em28xx_get_key_winfast_usbii_deluxe; + dev->init_data.name = "i2c IR (EM2820 Winfast TV USBII Deluxe)"; + break; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002290:2, b/test/corpora/lkml/cur/1382298793.002290:2, new file mode 100644 index 00000000..bf05cb1e --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002290:2, @@ -0,0 +1,81 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 12/44] drivers/net/bnx2x: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:31 -0800 +Lines: 44 +Message-ID: <2bfaf1f1fe5d503a8a386a433b5187997819d771.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Eilon Greenstein <eilong@broadcom.com>, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:13:27 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpVW-00042L-1L + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:13:26 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932754Ab0KODMy (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:12:54 -0500 +Received: from mail.perches.com ([173.55.12.10]:1156 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932660Ab0KODFf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:35 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id AB58824375; + Sun, 14 Nov 2010 19:04:02 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062309> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/net/bnx2x/bnx2x_link.c | 4 ++-- + drivers/net/bnx2x/bnx2x_main.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/bnx2x/bnx2x_link.c b/drivers/net/bnx2x/bnx2x_link.c +index 5809196..38aeffe 100644 +--- a/drivers/net/bnx2x/bnx2x_link.c ++++ b/drivers/net/bnx2x/bnx2x_link.c +@@ -3904,7 +3904,7 @@ static u8 bnx2x_8726_read_sfp_module_eeprom(struct bnx2x_phy *phy, + MDIO_PMA_REG_SFP_TWO_WIRE_CTRL, &val); + if ((val & MDIO_PMA_REG_SFP_TWO_WIRE_CTRL_STATUS_MASK) == + MDIO_PMA_REG_SFP_TWO_WIRE_STATUS_IDLE) +- return 0;; ++ return 0; + msleep(1); + } + return -EINVAL; +@@ -3988,7 +3988,7 @@ static u8 bnx2x_8727_read_sfp_module_eeprom(struct bnx2x_phy *phy, + MDIO_PMA_REG_SFP_TWO_WIRE_CTRL, &val); + if ((val & MDIO_PMA_REG_SFP_TWO_WIRE_CTRL_STATUS_MASK) == + MDIO_PMA_REG_SFP_TWO_WIRE_STATUS_IDLE) +- return 0;; ++ return 0; + msleep(1); + } + +diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c +index e9ad16f..7ffcb08 100644 +--- a/drivers/net/bnx2x/bnx2x_main.c ++++ b/drivers/net/bnx2x/bnx2x_main.c +@@ -8078,7 +8078,7 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp) + int port = BP_PORT(bp); + u32 val, val2; + u32 config; +- u32 ext_phy_type, ext_phy_config;; ++ u32 ext_phy_type, ext_phy_config; + + bp->link_params.bp = bp; + bp->link_params.port = port; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002292:2, b/test/corpora/lkml/cur/1382298793.002292:2, new file mode 100644 index 00000000..3aceed70 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002292:2, @@ -0,0 +1,71 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 10/44] drivers/misc: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:29 -0800 +Lines: 35 +Message-ID: <f1f1ff72045c075062d3fbe8d2bfcf67bdb1571d.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:14:21 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpWA-0004SF-ER + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:14:06 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932800Ab0KODNW (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:13:22 -0500 +Received: from mail.perches.com ([173.55.12.10]:1151 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932629Ab0KODFd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:33 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 4E7E024372; + Sun, 14 Nov 2010 19:04:01 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062311> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/misc/bmp085.c | 2 +- + drivers/misc/isl29020.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/misc/bmp085.c b/drivers/misc/bmp085.c +index 63ee4c1..6b8a394 100644 +--- a/drivers/misc/bmp085.c ++++ b/drivers/misc/bmp085.c +@@ -216,7 +216,7 @@ static s32 bmp085_get_temperature(struct bmp085_data *data, int *temperature) + *temperature = (x1+x2+8) >> 4; + + exit: +- return status;; ++ return status; + } + + /* +diff --git a/drivers/misc/isl29020.c b/drivers/misc/isl29020.c +index ca47e62..e6bbf13 100644 +--- a/drivers/misc/isl29020.c ++++ b/drivers/misc/isl29020.c +@@ -158,7 +158,7 @@ static int als_set_default_config(struct i2c_client *client) + dev_err(&client->dev, "default write failed."); + return retval; + } +- return 0;; ++ return 0; + } + + static int isl29020_probe(struct i2c_client *client, +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002293:2, b/test/corpora/lkml/cur/1382298793.002293:2, new file mode 100644 index 00000000..a547a9bc --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002293:2, @@ -0,0 +1,57 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 08/44] drivers/leds: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:27 -0800 +Lines: 21 +Message-ID: <054f6857b7472d9f4c540c298cef0aa77bce6962.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Richard Purdie <rpurdie@rpsys.net>, linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:14:24 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpWB-0004SF-F9 + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:14:07 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932958Ab0KODNw (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:13:52 -0500 +Received: from mail.perches.com ([173.55.12.10]:1145 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932602Ab0KODFc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:32 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 92C3F24370; + Sun, 14 Nov 2010 19:03:59 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062312> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/leds/leds-mc13783.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c +index f05bb08..f369e56 100644 +--- a/drivers/leds/leds-mc13783.c ++++ b/drivers/leds/leds-mc13783.c +@@ -234,7 +234,7 @@ static int __devinit mc13783_leds_prepare(struct platform_device *pdev) + MC13783_LED_Cx_PERIOD; + + if (pdata->flags & MC13783_LED_TRIODE_TC3) +- reg |= MC13783_LED_Cx_TRIODE_TC_BIT;; ++ reg |= MC13783_LED_Cx_TRIODE_TC_BIT; + + ret = mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_5, reg); + if (ret) +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002294:2, b/test/corpora/lkml/cur/1382298793.002294:2, new file mode 100644 index 00000000..aa5821bc --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002294:2, @@ -0,0 +1,63 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 04/44] drivers/cpufreq: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:23 -0800 +Lines: 26 +Message-ID: <a4bef9c18ce34e80870a07c728ee25e8efac6d9d.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Dave Jones <davej@redhat.com>, cpufreq@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: cpufreq-owner@vger.kernel.org Mon Nov 15 04:16:07 2010 +Return-path: <cpufreq-owner@vger.kernel.org> +Envelope-to: glkc-cpufreq2@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <cpufreq-owner@vger.kernel.org>) + id 1PHpY5-0005lg-O4 + for glkc-cpufreq2@lo.gmane.org; Mon, 15 Nov 2010 04:16:06 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932680Ab0KODO4 (ORCPT <rfc822;glkc-cpufreq2@m.gmane.org>); + Sun, 14 Nov 2010 22:14:56 -0500 +Received: from mail.perches.com ([173.55.12.10]:1127 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1757376Ab0KODF3 (ORCPT <rfc822;cpufreq@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:29 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 1F49D2436E; + Sun, 14 Nov 2010 19:03:57 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: cpufreq-owner@vger.kernel.org +Precedence: bulk +List-ID: <cpufreq.vger.kernel.org> +X-Mailing-List: cpufreq@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062313> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/cpufreq/cpufreq_conservative.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c +index 526bfbf..b0d8f3d 100644 +--- a/drivers/cpufreq/cpufreq_conservative.c ++++ b/drivers/cpufreq/cpufreq_conservative.c +@@ -118,7 +118,7 @@ static inline cputime64_t get_cpu_idle_time_jiffy(unsigned int cpu, + if (wall) + *wall = (cputime64_t)jiffies_to_usecs(cur_wall_time); + +- return (cputime64_t)jiffies_to_usecs(idle_time);; ++ return (cputime64_t)jiffies_to_usecs(idle_time); + } + + static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) +-- +1.7.3.1.g432b3.dirty + +-- +To unsubscribe from this list: send the line "unsubscribe cpufreq" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298793.002296:2, b/test/corpora/lkml/cur/1382298793.002296:2, new file mode 100644 index 00000000..4d337c73 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002296:2, @@ -0,0 +1,148 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 01/44] arch/arm: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:20 -0800 +Lines: 105 +Message-ID: <b6d517c8da3ca0d50c836736e76059c89d692b6e.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Russell King <linux@arm.linux.org.uk>, + Wan ZongShun <mcuos.com@gmail.com>, + Colin Cross <ccross@android.com>, + Erik Gilling <konkers@android.com>, + Olof Johansson <olof@lixom.net>, + Sascha Hauer <kernel@pengutronix.de>, + linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, + linux-tegra@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:16:10 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpY9-0005lg-2R + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:16:09 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933240Ab0KODPt (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:15:49 -0500 +Received: from mail.perches.com ([173.55.12.10]:1125 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1757314Ab0KODF2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:28 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 4C0C32436B; + Sun, 14 Nov 2010 19:03:55 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062315> + +Signed-off-by: Joe Perches <joe@perches.com> +--- + arch/arm/mach-at91/at91cap9_devices.c | 2 +- + arch/arm/mach-at91/at91sam9g45_devices.c | 2 +- + arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- + arch/arm/mach-nuc93x/time.c | 2 +- + arch/arm/mach-tegra/tegra2_clocks.c | 2 +- + arch/arm/mach-w90x900/cpu.c | 2 +- + arch/arm/plat-mxc/irq.c | 2 +- + 7 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c +index d1f775e..308ce7a 100644 +--- a/arch/arm/mach-at91/at91cap9_devices.c ++++ b/arch/arm/mach-at91/at91cap9_devices.c +@@ -171,7 +171,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) + */ + usba_udc_data.pdata.vbus_pin = -EINVAL; + usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep); +- memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep));; ++ memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep)); + + if (data && data->vbus_pin > 0) { + at91_set_gpio_input(data->vbus_pin, 0); +diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c +index 1e8f275..5e9f8a4 100644 +--- a/arch/arm/mach-at91/at91sam9g45_devices.c ++++ b/arch/arm/mach-at91/at91sam9g45_devices.c +@@ -256,7 +256,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) + { + usba_udc_data.pdata.vbus_pin = -EINVAL; + usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep); +- memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep));; ++ memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep)); + + if (data && data->vbus_pin > 0) { + at91_set_gpio_input(data->vbus_pin, 0); +diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c +index 53aaa94..c49262b 100644 +--- a/arch/arm/mach-at91/at91sam9rl_devices.c ++++ b/arch/arm/mach-at91/at91sam9rl_devices.c +@@ -145,7 +145,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) + */ + usba_udc_data.pdata.vbus_pin = -EINVAL; + usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep); +- memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep));; ++ memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep)); + + if (data && data->vbus_pin > 0) { + at91_set_gpio_input(data->vbus_pin, 0); +diff --git a/arch/arm/mach-nuc93x/time.c b/arch/arm/mach-nuc93x/time.c +index 2f90f9d..f9807c0 100644 +--- a/arch/arm/mach-nuc93x/time.c ++++ b/arch/arm/mach-nuc93x/time.c +@@ -82,7 +82,7 @@ static void nuc93x_timer_setup(void) + timer0_load = (rate / TICKS_PER_SEC); + __raw_writel(timer0_load, REG_TICR0); + +- val |= (PERIOD | COUNTEN | INTEN | PRESCALE);; ++ val |= (PERIOD | COUNTEN | INTEN | PRESCALE); + __raw_writel(val, REG_TCSR0); + + } +diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c +index ae3b308..7f9d2252 100644 +--- a/arch/arm/mach-tegra/tegra2_clocks.c ++++ b/arch/arm/mach-tegra/tegra2_clocks.c +@@ -293,7 +293,7 @@ static int tegra2_super_clk_set_parent(struct clk *c, struct clk *p) + const struct clk_mux_sel *sel; + int shift; + +- val = clk_readl(c->reg + SUPER_CLK_MUX);; ++ val = clk_readl(c->reg + SUPER_CLK_MUX); + BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) && + ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE)); + shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ? +diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c +index 83c5632..0a235e5 100644 +--- a/arch/arm/mach-w90x900/cpu.c ++++ b/arch/arm/mach-w90x900/cpu.c +@@ -60,7 +60,7 @@ static DEFINE_CLK(emc, 7); + static DEFINE_SUBCLK(rmii, 2); + static DEFINE_CLK(usbd, 8); + static DEFINE_CLK(usbh, 9); +-static DEFINE_CLK(g2d, 10);; ++static DEFINE_CLK(g2d, 10); + static DEFINE_CLK(pwm, 18); + static DEFINE_CLK(ps2, 24); + static DEFINE_CLK(kpi, 25); +diff --git a/arch/arm/plat-mxc/irq.c b/arch/arm/plat-mxc/irq.c +index 7331f2a..d7809d0 100644 +--- a/arch/arm/plat-mxc/irq.c ++++ b/arch/arm/plat-mxc/irq.c +@@ -53,7 +53,7 @@ int imx_irq_set_priority(unsigned char irq, unsigned char prio) + unsigned int mask = 0x0F << irq % 8 * 4; + + if (irq >= MXC_INTERNAL_IRQS) +- return -EINVAL;; ++ return -EINVAL; + + temp = __raw_readl(avic_base + AVIC_NIPRIORITY(irq / 8)); + temp &= ~mask; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002297:2, b/test/corpora/lkml/cur/1382298793.002297:2, new file mode 100644 index 00000000..48a49c4c --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002297:2, @@ -0,0 +1,58 @@ +From: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org> +Subject: [PATCH 06/44] drivers/i2c: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:25 -0800 +Lines: 21 +Message-ID: <04cfa2beee1ed9656e550bb13076b9c57899542e.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: "Jean Delvare (PC drivers, core)" <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>, + "Ben Dooks (embedded platforms)" <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>, + linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +To: Jiri Kosina <trivial-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> +X-From: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Mon Nov 15 04:15:07 2010 +Return-path: <linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: gldi-i2c-1-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1PHpX8-0005AO-Oy + for gldi-i2c-1-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Mon, 15 Nov 2010 04:15:07 +0100 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S932641Ab0KODOb (ORCPT <rfc822;gldi-i2c-1@m.gmane.org>); + Sun, 14 Nov 2010 22:14:31 -0500 +Received: from mail.perches.com ([173.55.12.10]:1138 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932562Ab0KODFa (ORCPT <rfc822;linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Sun, 14 Nov 2010 22:05:30 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 39B6A2436C; + Sun, 14 Nov 2010 19:03:58 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org> +Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-i2c.vger.kernel.org> +X-Mailing-List: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org + +Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org> +--- + drivers/i2c/busses/i2c-designware.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-designware.c b/drivers/i2c/busses/i2c-designware.c +index b664ed8..a93922d 100644 +--- a/drivers/i2c/busses/i2c-designware.c ++++ b/drivers/i2c/busses/i2c-designware.c +@@ -390,7 +390,7 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev) + int tx_limit, rx_limit; + u32 addr = msgs[dev->msg_write_idx].addr; + u32 buf_len = dev->tx_buf_len; +- u8 *buf = dev->tx_buf;; ++ u8 *buf = dev->tx_buf; + + intr_mask = DW_IC_INTR_DEFAULT_MASK; + +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002298:2, b/test/corpora/lkml/cur/1382298793.002298:2, new file mode 100644 index 00000000..4aa3f389 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002298:2, @@ -0,0 +1,85 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 07/44] drivers/isdn: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:26 -0800 +Lines: 49 +Message-ID: <c7a38f65340aafb208d50fc3a781602c07aebb0c.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: Karsten Keil <isdn@linux-pingi.de>, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: netdev-owner@vger.kernel.org Mon Nov 15 04:15:06 2010 +Return-path: <netdev-owner@vger.kernel.org> +Envelope-to: linux-netdev-2@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <netdev-owner@vger.kernel.org>) + id 1PHpX7-0005AO-Lc + for linux-netdev-2@lo.gmane.org; Mon, 15 Nov 2010 04:15:06 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932642Ab0KODOJ (ORCPT <rfc822;linux-netdev-2@m.gmane.org>); + Sun, 14 Nov 2010 22:14:09 -0500 +Received: from mail.perches.com ([173.55.12.10]:1142 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932587Ab0KODFb (ORCPT <rfc822;netdev@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:31 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 036B82436F; + Sun, 14 Nov 2010 19:03:59 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: netdev-owner@vger.kernel.org +Precedence: bulk +List-ID: <netdev.vger.kernel.org> +X-Mailing-List: netdev@vger.kernel.org + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/isdn/hardware/mISDN/mISDNinfineon.c | 4 ++-- + drivers/isdn/hardware/mISDN/mISDNisar.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/isdn/hardware/mISDN/mISDNinfineon.c b/drivers/isdn/hardware/mISDN/mISDNinfineon.c +index e90db88..bc0529a 100644 +--- a/drivers/isdn/hardware/mISDN/mISDNinfineon.c ++++ b/drivers/isdn/hardware/mISDN/mISDNinfineon.c +@@ -420,7 +420,7 @@ enable_hwirq(struct inf_hw *hw) + break; + case INF_NICCY: + val = inl((u32)hw->cfg.start + NICCY_IRQ_CTRL_REG); +- val |= NICCY_IRQ_ENABLE;; ++ val |= NICCY_IRQ_ENABLE; + outl(val, (u32)hw->cfg.start + NICCY_IRQ_CTRL_REG); + break; + case INF_SCT_1: +@@ -924,7 +924,7 @@ setup_instance(struct inf_hw *card) + mISDNipac_init(&card->ipac, card); + + if (card->ipac.isac.dch.dev.Bprotocols == 0) +- goto error_setup;; ++ goto error_setup; + + err = mISDN_register_device(&card->ipac.isac.dch.dev, + &card->pdev->dev, card->name); +diff --git a/drivers/isdn/hardware/mISDN/mISDNisar.c b/drivers/isdn/hardware/mISDN/mISDNisar.c +index 38eb314..d13fa5b 100644 +--- a/drivers/isdn/hardware/mISDN/mISDNisar.c ++++ b/drivers/isdn/hardware/mISDN/mISDNisar.c +@@ -264,7 +264,7 @@ load_firmware(struct isar_hw *isar, const u8 *buf, int size) + while (noc) { + val = le16_to_cpu(*sp++); + *mp++ = val >> 8; +- *mp++ = val & 0xFF;; ++ *mp++ = val & 0xFF; + noc--; + } + spin_lock_irqsave(isar->hwlock, flags); +-- +1.7.3.1.g432b3.dirty + +-- +To unsubscribe from this list: send the line "unsubscribe netdev" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298793.002299:2, b/test/corpora/lkml/cur/1382298793.002299:2, new file mode 100644 index 00000000..dc35b93d --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002299:2, @@ -0,0 +1,56 @@ +From: Joe Perches <joe@perches.com> +Subject: [PATCH 05/44] drivers/gpio: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 19:04:24 -0800 +Lines: 21 +Message-ID: <a04f2c16a94e214f0a1828c4cea95f815a816853.1289789604.git.joe@perches.com> +References: <cover.1289789604.git.joe@perches.com> +Cc: linux-kernel@vger.kernel.org +To: Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:15:13 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHpX9-0005AO-Pv + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:15:08 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933055Ab0KODOp (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:14:45 -0500 +Received: from mail.perches.com ([173.55.12.10]:1136 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932550Ab0KODFa (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:05:30 -0500 +Received: from Joe-Laptop.home (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id A81642436F; + Sun, 14 Nov 2010 19:03:57 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1.g432b3.dirty +In-Reply-To: <cover.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org + +Signed-off-by: Joe Perches <joe@perches.com> +--- + drivers/gpio/langwell_gpio.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/gpio/langwell_gpio.c b/drivers/gpio/langwell_gpio.c +index 64db9dc..ed05ecb 100644 +--- a/drivers/gpio/langwell_gpio.c ++++ b/drivers/gpio/langwell_gpio.c +@@ -122,7 +122,7 @@ static int lnw_gpio_direction_output(struct gpio_chip *chip, + lnw_gpio_set(chip, offset, value); + spin_lock_irqsave(&lnw->lock, flags); + value = readl(gpdr); +- value |= BIT(offset % 32);; ++ value |= BIT(offset % 32); + writel(value, gpdr); + spin_unlock_irqrestore(&lnw->lock, flags); + return 0; +-- +1.7.3.1.g432b3.dirty + + + diff --git a/test/corpora/lkml/cur/1382298793.002302:2, b/test/corpora/lkml/cur/1382298793.002302:2, new file mode 100644 index 00000000..7ee679f0 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002302:2, @@ -0,0 +1,85 @@ +From: "Jack Wang" <jack_wang@usish.com> +Subject: RE: [PATCH 25/44] drivers/scsi/pm8001: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 11:27:32 +0800 +Lines: 33 +Message-ID: <1671200DA80140558ED0D17FB55585AD@usish.com.cn> +References: <cover.1289789604.git.joe@perches.com> <20b352f91642ca45ad730d8eeec0bbd323d26626.1289789605.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=gb2312 +Content-Transfer-Encoding: QUOTED-PRINTABLE +Cc: <lindar_liu@usish.com>, + "'James E.J. Bottomley'" <James.Bottomley@suse.de>, + <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org> +To: "'Joe Perches'" <joe@perches.com>, + "'Jiri Kosina'" <trivial@kernel.org> +X-From: linux-scsi-owner@vger.kernel.org Mon Nov 15 04:28:10 2010 +Return-path: <linux-scsi-owner@vger.kernel.org> +Envelope-to: lnx-linux-scsi@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-scsi-owner@vger.kernel.org>) + id 1PHpjl-0002I8-68 + for lnx-linux-scsi@lo.gmane.org; Mon, 15 Nov 2010 04:28:09 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932669Ab0KOD15 convert rfc822-to-quoted-printable (ORCPT + <rfc822;lnx-linux-scsi@m.gmane.org>); Sun, 14 Nov 2010 22:27:57 -0500 +Received: from sr-smtp.usish.com ([210.5.144.203]:58240 "EHLO + sr-smtp.usish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S932514Ab0KOD14 convert rfc822-to-8bit (ORCPT + <rfc822;linux-scsi@vger.kernel.org>); Sun, 14 Nov 2010 22:27:56 -0500 +Received: from outbound.usish.com (unknown [192.168.40.103]) + by sr-smtp.usish.com (Postfix) with ESMTP id 782BE778067; + Mon, 15 Nov 2010 11:20:06 +0800 (CST) +Received: from outbound.usish.com (outbound.usish.com [127.0.0.1]) + by postfix.imss70 (Postfix) with ESMTP id 8E538428070; + Mon, 15 Nov 2010 11:27:48 +0800 (CST) +Received: from usishe7a1977d2 (unknown [192.168.58.33]) + (using TLSv1 with cipher RC4-MD5 (128/128 bits)) + (No client certificate requested) + by outbound.usish.com (Postfix) with ESMTP id 5437142807A; + Mon, 15 Nov 2010 11:27:48 +0800 (CST) +X-Mailer: Microsoft Office Outlook 11 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 +Thread-Index: AcuEcgXhz8cjF31qQU6VXNE8zpGc0wAAnu4g +In-Reply-To: <20b352f91642ca45ad730d8eeec0bbd323d26626.1289789605.git.joe@perches.com> +Sender: linux-scsi-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-scsi.vger.kernel.org> +X-Mailing-List: linux-scsi@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062321> + +>=20 +> Signed-off-by: Joe Perches <joe@perches.com> +> --- +> drivers/scsi/pm8001/pm8001_init.c | 2 +- +> 1 files changed, 1 insertions(+), 1 deletions(-) +>=20 +> diff --git a/drivers/scsi/pm8001/pm8001_init.c +> b/drivers/scsi/pm8001/pm8001_init.c +> index f8c86b2..be210dd 100644 +> --- a/drivers/scsi/pm8001/pm8001_init.c +> +++ b/drivers/scsi/pm8001/pm8001_init.c +> @@ -160,7 +160,7 @@ static void pm8001_free(struct pm8001_hba_info +*pm8001_ha) +> static void pm8001_tasklet(unsigned long opaque) +> { +> struct pm8001_hba_info *pm8001_ha; +> - pm8001_ha =3D (struct pm8001_hba_info *)opaque;; +> + pm8001_ha =3D (struct pm8001_hba_info *)opaque; +> if (unlikely(!pm8001_ha)) +> BUG_ON(1); +> PM8001_CHIP_DISP->isr(pm8001_ha); +> -- +> 1.7.3.1.g432b3.dirty +[Jack Wang] Acked-by: Jack Wang <jack_wang@usish.com> +Thanks=A3=A1 + + +-- +To unsubscribe from this list: send the line "unsubscribe linux-scsi" i= +n +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298793.002309:2, b/test/corpora/lkml/cur/1382298793.002309:2, new file mode 100644 index 00000000..64153b58 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002309:2, @@ -0,0 +1,93 @@ +From: Grant Likely <grant.likely@secretlab.ca> +Subject: Re: [PATCH 28/44] drivers/spi: Remove unnecessary semicolons +Date: Sun, 14 Nov 2010 20:57:42 -0700 +Lines: 41 +Message-ID: <20101115035742.GA19965@angua.secretlab.ca> +References: <cover.1289789604.git.joe@perches.com> + <fe5e5e0efbd97eaa32530eef5ed47efdc3252dad.1289789605.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: Jiri Kosina <trivial@kernel.org>, + David Brownell <dbrownell@users.sourceforge.net>, + Wan ZongShun <mcuos.com@gmail.com>, + spi-devel-general@lists.sourceforge.net, + linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org +To: Joe Perches <joe@perches.com> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 04:58:26 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHqD3-0006P9-7p + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 04:58:25 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1757510Ab0KOD5r (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 14 Nov 2010 22:57:47 -0500 +Received: from mail-yx0-f174.google.com ([209.85.213.174]:43928 "EHLO + mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1754294Ab0KOD5q (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Sun, 14 Nov 2010 22:57:46 -0500 +Received: by yxn35 with SMTP id 35so916234yxn.19 + for <linux-kernel@vger.kernel.org>; Sun, 14 Nov 2010 19:57:46 -0800 (PST) +Received: by 10.91.10.20 with SMTP id n20mr7068735agi.56.1289793465914; + Sun, 14 Nov 2010 19:57:45 -0800 (PST) +Received: from angua (S01060002b3d79728.cg.shawcable.net [70.72.87.49]) + by mx.google.com with ESMTPS id d15sm3276149ana.20.2010.11.14.19.57.43 + (version=TLSv1/SSLv3 cipher=RC4-MD5); + Sun, 14 Nov 2010 19:57:45 -0800 (PST) +Received: by angua (Postfix, from userid 1000) + id 238853C00E5; Sun, 14 Nov 2010 20:57:42 -0700 (MST) +Content-Disposition: inline +In-Reply-To: <fe5e5e0efbd97eaa32530eef5ed47efdc3252dad.1289789605.git.joe@perches.com> +User-Agent: Mutt/1.5.20 (2009-06-14) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062328> + +On Sun, Nov 14, 2010 at 07:04:47PM -0800, Joe Perches wrote: +> Signed-off-by: Joe Perches <joe@perches.com> + +applied, thanks. + +g. + +> --- +> drivers/spi/amba-pl022.c | 2 +- +> drivers/spi/spi_nuc900.c | 2 +- +> 2 files changed, 2 insertions(+), 2 deletions(-) +> +> diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c +> index fb3d1b3..2e50631 100644 +> --- a/drivers/spi/amba-pl022.c +> +++ b/drivers/spi/amba-pl022.c +> @@ -956,7 +956,7 @@ static int configure_dma(struct pl022 *pl022) +> tx_conf.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; +> break; +> case WRITING_U32: +> - tx_conf.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;; +> + tx_conf.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; +> break; +> } +> +> diff --git a/drivers/spi/spi_nuc900.c b/drivers/spi/spi_nuc900.c +> index dff63be..d5be18b 100644 +> --- a/drivers/spi/spi_nuc900.c +> +++ b/drivers/spi/spi_nuc900.c +> @@ -449,7 +449,7 @@ err_iomap: +> release_mem_region(hw->res->start, resource_size(hw->res)); +> kfree(hw->ioarea); +> err_pdata: +> - spi_master_put(hw->master);; +> + spi_master_put(hw->master); +> +> err_nomem: +> return err; +> -- +> 1.7.3.1.g432b3.dirty +> + + diff --git a/test/corpora/lkml/cur/1382298793.002329:2, b/test/corpora/lkml/cur/1382298793.002329:2, new file mode 100644 index 00000000..d91006a5 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002329:2, @@ -0,0 +1,79 @@ +From: Michal Simek <monstr@monstr.eu> +Subject: Re: [PATCH 02/44] arch/microblaze: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 07:37:39 +0100 +Lines: 32 +Message-ID: <4CE0D533.1010407@monstr.eu> +References: <cover.1289789604.git.joe@perches.com> <5d57b90b488b4338bcdc3f0fbf5f6996842bd44d.1289789604.git.joe@perches.com> +Reply-To: monstr@monstr.eu +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Cc: Jiri Kosina <trivial@kernel.org>, + microblaze-uclinux@itee.uq.edu.au, linux-kernel@vger.kernel.org +To: Joe Perches <joe@perches.com> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 07:38:12 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHshf-0005Kt-RF + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 07:38:12 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1755918Ab0KOGhs (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 01:37:48 -0500 +Received: from mail-fx0-f46.google.com ([209.85.161.46]:39130 "EHLO + mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1755187Ab0KOGhp (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 01:37:45 -0500 +Received: by fxm6 with SMTP id 6so1494962fxm.19 + for <linux-kernel@vger.kernel.org>; Sun, 14 Nov 2010 22:37:43 -0800 (PST) +Received: by 10.223.70.131 with SMTP id d3mr4100646faj.73.1289803062970; + Sun, 14 Nov 2010 22:37:42 -0800 (PST) +Received: from monstr.eu ([178.23.216.97]) + by mx.google.com with ESMTPS id l14sm735429fan.33.2010.11.14.22.37.40 + (version=SSLv3 cipher=RC4-MD5); + Sun, 14 Nov 2010 22:37:41 -0800 (PST) +User-Agent: Thunderbird 2.0.0.22 (X11/20090625) +In-Reply-To: <5d57b90b488b4338bcdc3f0fbf5f6996842bd44d.1289789604.git.joe@perches.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062348> + +Joe Perches wrote: +> Signed-off-by: Joe Perches <joe@perches.com> +> --- +> arch/microblaze/lib/memmove.c | 2 +- +> 1 files changed, 1 insertions(+), 1 deletions(-) + +Applied. + +Thanks, +Michal + +> +> diff --git a/arch/microblaze/lib/memmove.c b/arch/microblaze/lib/memmove.c +> index 123e361..810fd68 100644 +> --- a/arch/microblaze/lib/memmove.c +> +++ b/arch/microblaze/lib/memmove.c +> @@ -182,7 +182,7 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) +> for (; c >= 4; c -= 4) { +> value = *--i_src; +> *--i_dst = buf_hold | ((value & 0xFF000000)>> 24); +> - buf_hold = (value & 0xFFFFFF) << 8;; +> + buf_hold = (value & 0xFFFFFF) << 8; +> } +> #endif +> /* Realign the source */ + + +-- +Michal Simek, Ing. (M.Eng) +w: www.monstr.eu p: +42-0-721842854 +Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ +Microblaze U-BOOT custodian + + diff --git a/test/corpora/lkml/cur/1382298793.002340:2, b/test/corpora/lkml/cur/1382298793.002340:2, new file mode 100644 index 00000000..cee8581c --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002340:2, @@ -0,0 +1,71 @@ +From: Sjur BRENDELAND <sjur.brandeland@stericsson.com> +Subject: RE: [PATCH 39/44] include/net/caif/cfctrl.h: Remove unnecessary + semicolons +Date: Mon, 15 Nov 2010 08:12:02 +0100 +Lines: 7 +Message-ID: <81C3A93C17462B4BBD7E272753C105791945C0C9AA@EXDCVYMBSTM005.EQ1STM.local> +References: <cover.1289789604.git.joe@perches.com> + <35914cfea1bd0ab3963e632d02b1fdd52a9d2bc8.1289789605.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 8BIT +Cc: "David S. Miller" <davem@davemloft.net>, + "netdev@vger.kernel.org" <netdev@vger.kernel.org>, + "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> +To: Joe Perches <joe@perches.com>, Jiri Kosina <trivial@kernel.org> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 08:12:47 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PHtF8-0003Ia-E9 + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 08:12:46 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1757561Ab0KOHMn (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 02:12:43 -0500 +Received: from eu1sys200aog110.obsmtp.com ([207.126.144.129]:34651 "EHLO + eu1sys200aog110.obsmtp.com" rhost-flags-OK-OK-OK-OK) + by vger.kernel.org with ESMTP id S1755276Ab0KOHMk convert rfc822-to-8bit + (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 02:12:40 -0500 +Received: from source ([138.198.100.35]) (using TLSv1) by eu1sys200aob110.postini.com ([207.126.147.11]) with SMTP + ID DSNKTODdXnF0LEMxKFzys6wWldAszZ/h5aGS@postini.com; Mon, 15 Nov 2010 07:12:40 UTC +Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) + by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id B201FFC; + Mon, 15 Nov 2010 07:12:06 +0000 (GMT) +Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) + by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id C1093569; + Mon, 15 Nov 2010 07:12:05 +0000 (GMT) +Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) + (using TLSv1 with cipher RC4-MD5 (128/128 bits)) + (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) + by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 2017C24C080; + Mon, 15 Nov 2010 08:12:01 +0100 (CET) +Received: from EXDCVYMBSTM005.EQ1STM.local ([10.230.100.3]) by + exdcvycastm022.EQ1STM.local ([10.230.100.30]) with mapi; Mon, 15 Nov 2010 + 08:12:04 +0100 +Thread-Topic: [PATCH 39/44] include/net/caif/cfctrl.h: Remove unnecessary + semicolons +Thread-Index: AcuEcgmvXg9N7FIzS1KHGoGQuVf68gAIhhTQ +In-Reply-To: <35914cfea1bd0ab3963e632d02b1fdd52a9d2bc8.1289789605.git.joe@perches.com> +Accept-Language: en-US +Content-Language: en-US +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +acceptlanguage: en-US +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062359> + +> +> Signed-off-by: Joe Perches <joe@perches.com> + + +Looks good to me. +Acked-by: Sjur Braendeland <sjur.brandeland@stericsson.com> + + + diff --git a/test/corpora/lkml/cur/1382298793.002400:2, b/test/corpora/lkml/cur/1382298793.002400:2, new file mode 100644 index 00000000..a2eab512 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002400:2, @@ -0,0 +1,102 @@ +From: Mel Gorman <mel@csn.ul.ie> +Subject: Re: [PATCH 40/44] mm/hugetlb.c: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 09:52:44 +0000 +Lines: 44 +Message-ID: <20101115095244.GI27362@csn.ul.ie> +References: <cover.1289789604.git.joe@perches.com> <59705f848d35b12ace640f92afcffea02cee0976.1289789605.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-15 +Cc: Jiri Kosina <trivial@kernel.org>, linux-mm@kvack.org, + linux-kernel@vger.kernel.org +To: Joe Perches <joe@perches.com> +X-From: owner-linux-mm@kvack.org Mon Nov 15 10:53:02 2010 +Return-path: <owner-linux-mm@kvack.org> +Envelope-to: glkm-linux-mm-2@m.gmane.org +Received: from kanga.kvack.org ([205.233.56.17]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <owner-linux-mm@kvack.org>) + id 1PHvkD-0001DG-RE + for glkm-linux-mm-2@m.gmane.org; Mon, 15 Nov 2010 10:53:02 +0100 +Received: by kanga.kvack.org (Postfix) + id BA7DD8D0050; Mon, 15 Nov 2010 04:53:00 -0500 (EST) +Delivered-To: linux-mm-outgoing@kvack.org +Received: by kanga.kvack.org (Postfix, from userid 40) + id B3E4F8D0017; Mon, 15 Nov 2010 04:53:00 -0500 (EST) +X-Original-To: int-list-linux-mm@kvack.org +Delivered-To: int-list-linux-mm@kvack.org +Received: by kanga.kvack.org (Postfix, from userid 63042) + id 985338D0050; Mon, 15 Nov 2010 04:53:00 -0500 (EST) +X-Original-To: linux-mm@kvack.org +Delivered-To: linux-mm@kvack.org +Received: from mail144.messagelabs.com (mail144.messagelabs.com [216.82.254.51]) + by kanga.kvack.org (Postfix) with ESMTP id 3FA8F8D0017 + for <linux-mm@kvack.org>; Mon, 15 Nov 2010 04:53:00 -0500 (EST) +X-VirusChecked: Checked +X-Env-Sender: mel@csn.ul.ie +X-Msg-Ref: server-6.tower-144.messagelabs.com!1289814777!96428158!1 +X-StarScan-Version: 6.2.9; banners=-,-,- +X-Originating-IP: [193.1.99.77] +X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG +Received: (qmail 13284 invoked from network); 15 Nov 2010 09:52:59 -0000 +Received: from gir.skynet.ie (HELO gir.skynet.ie) (193.1.99.77) + by server-6.tower-144.messagelabs.com with DHE-RSA-AES256-SHA encrypted SMTP; 15 Nov 2010 09:52:59 -0000 +Received: from skynet.skynet.ie (skynet.skynet.ie [193.1.99.74]) + by gir.skynet.ie (Postfix) with ESMTP id E3A5E1244B; + Mon, 15 Nov 2010 09:52:44 +0000 (GMT) +Received: by skynet.skynet.ie (Postfix, from userid 2391) + id D7AF750911; Mon, 15 Nov 2010 09:52:44 +0000 (GMT) +Content-Disposition: inline +In-Reply-To: <59705f848d35b12ace640f92afcffea02cee0976.1289789605.git.joe@perches.com> +User-Agent: Mutt/1.5.17+20080114 (2008-01-14) +X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.2 +Sender: owner-linux-mm@kvack.org +Precedence: bulk +X-Loop: owner-majordomo@kvack.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062420> + +On Sun, Nov 14, 2010 at 07:04:59PM -0800, Joe Perches wrote: +> Signed-off-by: Joe Perches <joe@perches.com> +> --- +> mm/hugetlb.c | 2 +- +> 1 files changed, 1 insertions(+), 1 deletions(-) +> + +Acked-by: Mel Gorman <mel@csn.ul.ie> + +> diff --git a/mm/hugetlb.c b/mm/hugetlb.c +> index c4a3558..8875242 100644 +> --- a/mm/hugetlb.c +> +++ b/mm/hugetlb.c +> @@ -540,7 +540,7 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, +> +> /* If reserves cannot be used, ensure enough pages are in the pool */ +> if (avoid_reserve && h->free_huge_pages - h->resv_huge_pages == 0) +> - goto err;; +> + goto err; +> +> for_each_zone_zonelist_nodemask(zone, z, zonelist, +> MAX_NR_ZONES - 1, nodemask) { +> -- +> 1.7.3.1.g432b3.dirty +> +> -- +> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in +> the body of a message to majordomo@vger.kernel.org +> More majordomo info at http://vger.kernel.org/majordomo-info.html +> Please read the FAQ at http://www.tux.org/lkml/ +> + +-- +Mel Gorman +Part-time Phd Student Linux Technology Center +University of Limerick IBM Dublin Software Lab + +-- +To unsubscribe, send a message with 'unsubscribe linux-mm' in +the body to majordomo@kvack.org. For more info on Linux MM, +see: http://www.linux-mm.org/ . +Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ +Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> + + + diff --git a/test/corpora/lkml/cur/1382298793.002432:2, b/test/corpora/lkml/cur/1382298793.002432:2, new file mode 100644 index 00000000..f8b72b65 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002432:2, @@ -0,0 +1,85 @@ +From: Liam Girdwood <lrg@slimlogic.co.uk> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary + semicolons +Date: Mon, 15 Nov 2010 11:09:20 +0000 +Lines: 14 +Message-ID: <1289819360.3377.15.camel@odin> +References: <cover.1289789604.git.joe@perches.com> + <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + Iwai <tiwai@suse.de>, linux-kernel@vger.kernel.org, + Takashi@alsa-project.org, + Mark Brown <broonie@opensource.wolfsonmicro.com>, + Ian Lartey <ian@opensource.wolfsonmicro.com> +To: Joe Perches <joe@perches.com> +X-From: alsa-devel-bounces@alsa-project.org Mon Nov 15 12:09:44 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PHwwS-0002x6-6X + for glad-alsa-devel-2@m.gmane.org; Mon, 15 Nov 2010 12:09:44 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id D0E09103835; Mon, 15 Nov 2010 12:09:43 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: * +X-Spam-Status: No, score=1.0 required=5.0 tests=PRX_BODY_40 autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 0AE19103845; + Mon, 15 Nov 2010 12:09:35 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id EA398103845; Mon, 15 Nov 2010 12:09:33 +0100 (CET) +Received: from mail-wy0-f179.google.com (mail-wy0-f179.google.com + [74.125.82.179]) + by alsa0.perex.cz (Postfix) with ESMTP id 8FD12103849 + for <alsa-devel@alsa-project.org>; Mon, 15 Nov 2010 12:09:26 +0100 (CET) +Received: by mail-wy0-f179.google.com with SMTP id 36so3482678wyg.38 + for <alsa-devel@alsa-project.org>; Mon, 15 Nov 2010 03:09:26 -0800 (PST) +Received: by 10.216.64.139 with SMTP id c11mr5392190wed.81.1289819366153; + Mon, 15 Nov 2010 03:09:26 -0800 (PST) +Received: from [192.168.1.6] (host81-136-218-57.in-addr.btopenworld.com + [81.136.218.57]) + by mx.google.com with ESMTPS id 7sm3626925wet.24.2010.11.15.03.09.21 + (version=SSLv3 cipher=RC4-MD5); Mon, 15 Nov 2010 03:09:24 -0800 (PST) +In-Reply-To: <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> +X-Mailer: Evolution 2.30.3 +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062453> + +On Sun, 2010-11-14 at 19:05 -0800, Joe Perches wrote: +> Signed-off-by: Joe Perches <joe@perches.com> +> --- +> sound/soc/codecs/wm8904.c | 2 +- +> sound/soc/codecs/wm8940.c | 1 - +> sound/soc/codecs/wm8993.c | 2 +- +> sound/soc/codecs/wm_hubs.c | 2 +- +> 4 files changed, 3 insertions(+), 4 deletions(-) + +Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> +-- +Freelance Developer, SlimLogic Ltd +ASoC and Voltage Regulator Maintainer. +http://www.slimlogic.co.uk + + diff --git a/test/corpora/lkml/cur/1382298793.002468:2, b/test/corpora/lkml/cur/1382298793.002468:2, new file mode 100644 index 00000000..e06d3891 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002468:2, @@ -0,0 +1,75 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary + semicolons +Date: Mon, 15 Nov 2010 13:49:39 +0000 +Lines: 5 +Message-ID: <20101115134939.GC12986@rakim.wolfsonmicro.main> +References: <cover.1289789604.git.joe@perches.com> + <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + Takashi Iwai <tiwai@suse.de>, linux-kernel@vger.kernel.org, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk> +To: Joe Perches <joe@perches.com> +X-From: alsa-devel-bounces@alsa-project.org Mon Nov 15 14:49:49 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PHzRN-0003qZ-C2 + for glad-alsa-devel-2@m.gmane.org; Mon, 15 Nov 2010 14:49:49 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id D24A2103851; Mon, 15 Nov 2010 14:49:48 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 53C91103853; + Mon, 15 Nov 2010 14:49:44 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 15C62103853; Mon, 15 Nov 2010 14:49:42 +0100 (CET) +Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com + [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 8DE08103851 + for <alsa-devel@alsa-project.org>; Mon, 15 Nov 2010 14:49:41 +0100 (CET) +Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com + [87.246.78.27]) + by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id E613E788028; + Mon, 15 Nov 2010 13:49:40 +0000 (GMT) +Received: from broonie by rakim.wolfsonmicro.main with local (Exim 4.72) + (envelope-from <broonie@rakim.wolfsonmicro.main>) + id 1PHzRD-0004Lh-OM; Mon, 15 Nov 2010 13:49:39 +0000 +Content-Disposition: inline +In-Reply-To: <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> +X-Cookie: I like your SNOOPY POSTER!! +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062489> + +On Sun, Nov 14, 2010 at 07:05:03PM -0800, Joe Perches wrote: +> Signed-off-by: Joe Perches <joe@perches.com> + +This doesn't apply against current -next, could you please regenerate +against that? + + diff --git a/test/corpora/lkml/cur/1382298793.002543:2, b/test/corpora/lkml/cur/1382298793.002543:2, new file mode 100644 index 00000000..aebfe251 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002543:2, @@ -0,0 +1,132 @@ +From: "Rose, Gregory V" <gregory.v.rose@intel.com> +Subject: Re: [PATCH 14/44] drivers/net/ixgbe: Remove + unnecessary semicolons +Date: Mon, 15 Nov 2010 08:24:22 -0800 +Lines: 48 +Message-ID: <43F901BD926A4E43B106BF17856F0755013080DEFF@orsmsx508.amr.corp.intel.com> +References: <cover.1289789604.git.joe@perches.com> + <7d2c334daa75c5221946a17d45c9de1901cf06e7.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: "e1000-devel@lists.sourceforge.net" <e1000-devel@lists.sourceforge.net>, + "Allan, Bruce W" <bruce.w.allan@intel.com>, "Brandeburg, + Jesse" <jesse.brandeburg@intel.com>, + "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, + "Ronciak, John" <john.ronciak@intel.com>, "Kirsher, + Jeffrey T" <jeffrey.t.kirsher@intel.com>, + "netdev@vger.kernel.org" <netdev@vger.kernel.org> +To: Joe Perches <joe@perches.com>, Jiri Kosina <trivial@kernel.org> +X-From: e1000-devel-bounces@lists.sourceforge.net Mon Nov 15 17:25:50 2010 +Return-path: <e1000-devel-bounces@lists.sourceforge.net> +Envelope-to: glded-e1000-devel@m.gmane.org +Received: from lists.sourceforge.net ([216.34.181.88]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <e1000-devel-bounces@lists.sourceforge.net>) + id 1PI1sL-0003p5-2h + for glded-e1000-devel@m.gmane.org; Mon, 15 Nov 2010 17:25:49 +0100 +Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) + by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) + (envelope-from <e1000-devel-bounces@lists.sourceforge.net>) + id 1PI1sG-0006Jq-KT; Mon, 15 Nov 2010 16:25:44 +0000 +Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] + helo=mx.sourceforge.net) + by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) + (envelope-from <gregory.v.rose@intel.com>) id 1PI1sF-0006Jk-IV + for e1000-devel@lists.sourceforge.net; Mon, 15 Nov 2010 16:25:43 +0000 +X-ACL-Warn: +Received: from mga09.intel.com ([134.134.136.24]) + by sog-mx-4.v43.ch3.sourceforge.com with esmtp (Exim 4.69) + id 1PI1sA-0001hP-Vk + for e1000-devel@lists.sourceforge.net; Mon, 15 Nov 2010 16:25:43 +0000 +Received: from orsmga001.jf.intel.com ([10.7.209.18]) + by orsmga102.jf.intel.com with ESMTP; 15 Nov 2010 08:25:33 -0800 +X-ExtLoop1: 1 +X-IronPort-AV: E=Sophos;i="4.59,200,1288594800"; d="scan'208";a="677619042" +Received: from orsmsx604.amr.corp.intel.com ([10.22.226.87]) + by orsmga001.jf.intel.com with ESMTP; 15 Nov 2010 08:25:33 -0800 +Received: from orsmsx606.amr.corp.intel.com (10.22.226.128) by + orsmsx604.amr.corp.intel.com (10.22.226.87) with Microsoft SMTP Server + (TLS) id 8.2.254.0; Mon, 15 Nov 2010 08:24:25 -0800 +Received: from orsmsx508.amr.corp.intel.com ([10.22.226.46]) by + orsmsx606.amr.corp.intel.com ([10.22.226.128]) with mapi; + Mon, 15 Nov 2010 08:24:24 -0800 +Thread-Topic: [PATCH 14/44] drivers/net/ixgbe: Remove unnecessary semicolons +Thread-Index: AcuEcftvdxmC6VgnRT2RlEslHutcHgAb4Qcg +In-Reply-To: <7d2c334daa75c5221946a17d45c9de1901cf06e7.1289789604.git.joe@perches.com> +Accept-Language: en-US +Content-Language: en-US +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +acceptlanguage: en-US +X-Spam-Score: -0.0 (/) +X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. + See http://spamassassin.org/tag/ for more details. + -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay + domain +X-Headers-End: 1PI1sA-0001hP-Vk +X-BeenThere: e1000-devel@lists.sourceforge.net +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "e100/e1000\(e\)/ixgb/igb/ixgbe development and discussion" + <e1000-devel.lists.sourceforge.net> +List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/e1000-devel>, + <mailto:e1000-devel-request@lists.sourceforge.net?subject=unsubscribe> +List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=e1000-devel> +List-Post: <mailto:e1000-devel@lists.sourceforge.net> +List-Help: <mailto:e1000-devel-request@lists.sourceforge.net?subject=help> +List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/e1000-devel>, + <mailto:e1000-devel-request@lists.sourceforge.net?subject=subscribe> +Errors-To: e1000-devel-bounces@lists.sourceforge.net +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062564> + +> -----Original Message----- +> From: Joe Perches [mailto:joe@perches.com] +> Sent: Sunday, November 14, 2010 7:05 PM +> To: Jiri Kosina +> Cc: Kirsher, Jeffrey T; Brandeburg, Jesse; Allan, Bruce W; Wyborny, +> Carolyn; Skidmore, Donald C; Rose, Gregory V; Waskiewicz Jr, Peter P; +> Duyck, Alexander H; Ronciak, John; e1000-devel@lists.sourceforge.net; +> netdev@vger.kernel.org; linux-kernel@vger.kernel.org +> Subject: [PATCH 14/44] drivers/net/ixgbe: Remove unnecessary semicolons +> +> Signed-off-by: Joe Perches <joe@perches.com> +> --- +> drivers/net/ixgbe/ixgbe_sriov.c | 2 +- +> 1 files changed, 1 insertions(+), 1 deletions(-) +> +> diff --git a/drivers/net/ixgbe/ixgbe_sriov.c +> b/drivers/net/ixgbe/ixgbe_sriov.c +> index 5428153..93f40bc 100644 +> --- a/drivers/net/ixgbe/ixgbe_sriov.c +> +++ b/drivers/net/ixgbe/ixgbe_sriov.c +> @@ -68,7 +68,7 @@ static int ixgbe_set_vf_multicasts(struct ixgbe_adapter +> *adapter, +> * addresses +> */ +> for (i = 0; i < entries; i++) { +> - vfinfo->vf_mc_hashes[i] = hash_list[i];; +> + vfinfo->vf_mc_hashes[i] = hash_list[i]; +> } +> +> for (i = 0; i < vfinfo->num_vf_mc_hashes; i++) { +> -- +> 1.7.3.1.g432b3.dirty + +Acked By: Greg Rose <Gregory.v.rose@intel.com> + + +------------------------------------------------------------------------------ +Centralized Desktop Delivery: Dell and VMware Reference Architecture +Simplifying enterprise desktop deployment and management using +Dell EqualLogic storage and VMware View: A highly scalable, end-to-end +client virtualization framework. Read more! +http://p.sf.net/sfu/dell-eql-dev2dev +_______________________________________________ +E1000-devel mailing list +E1000-devel@lists.sourceforge.net +https://lists.sourceforge.net/lists/listinfo/e1000-devel +To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired + + + diff --git a/test/corpora/lkml/cur/1382298793.002557:2, b/test/corpora/lkml/cur/1382298793.002557:2, new file mode 100644 index 00000000..723f9d6d --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002557:2, @@ -0,0 +1,109 @@ +From: Joe Perches <joe@perches.com> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 09:09:17 -0800 +Lines: 63 +Message-ID: <1289840957.16461.138.camel@Joe-Laptop> +References: <cover.1289789604.git.joe@perches.com> + <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> + <20101115134939.GC12986@rakim.wolfsonmicro.main> +Mime-Version: 1.0 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 7bit +Cc: Jiri Kosina <trivial@kernel.org>, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk>, + Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Mark Brown <broonie@opensource.wolfsonmicro.com> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 18:09:51 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PI2Yr-0005ly-Pc + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 18:09:46 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932795Ab0KORJV (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 12:09:21 -0500 +Received: from mail.perches.com ([173.55.12.10]:1293 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932132Ab0KORJU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 12:09:20 -0500 +Received: from [192.168.1.162] (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 93B872436B; + Mon, 15 Nov 2010 09:07:32 -0800 (PST) +In-Reply-To: <20101115134939.GC12986@rakim.wolfsonmicro.main> +X-Mailer: Evolution 2.30.3 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062578> + +Signed-off-by: Joe Perches <joe@perches.com> +--- +V2: against -next + + sound/soc/codecs/wm8904.c | 2 +- + sound/soc/codecs/wm8940.c | 1 - + sound/soc/codecs/wm8993.c | 2 +- + sound/soc/codecs/wm_hubs.c | 2 +- + 4 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c +index be90399..5e57bd2 100644 +--- a/sound/soc/codecs/wm8904.c ++++ b/sound/soc/codecs/wm8904.c +@@ -1591,7 +1591,7 @@ static int wm8904_hw_params(struct snd_pcm_substream *substream, + - wm8904->fs); + for (i = 1; i < ARRAY_SIZE(clk_sys_rates); i++) { + cur_val = abs((wm8904->sysclk_rate / +- clk_sys_rates[i].ratio) - wm8904->fs);; ++ clk_sys_rates[i].ratio) - wm8904->fs); + if (cur_val < best_val) { + best = i; + best_val = cur_val; +diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c +index c2def1b..caed084 100644 +--- a/sound/soc/codecs/wm8940.c ++++ b/sound/soc/codecs/wm8940.c +@@ -736,7 +736,6 @@ static int wm8940_probe(struct snd_soc_codec *codec) + return ret; + + return ret; +-; + } + + static int wm8940_remove(struct snd_soc_codec *codec) +diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c +index bcc54be..991d90c 100644 +--- a/sound/soc/codecs/wm8993.c ++++ b/sound/soc/codecs/wm8993.c +@@ -1227,7 +1227,7 @@ static int wm8993_hw_params(struct snd_pcm_substream *substream, + - wm8993->fs); + for (i = 1; i < ARRAY_SIZE(clk_sys_rates); i++) { + cur_val = abs((wm8993->sysclk_rate / +- clk_sys_rates[i].ratio) - wm8993->fs);; ++ clk_sys_rates[i].ratio) - wm8993->fs); + if (cur_val < best_val) { + best = i; + best_val = cur_val; +diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c +index 8aff0ef..422c7fb 100644 +--- a/sound/soc/codecs/wm_hubs.c ++++ b/sound/soc/codecs/wm_hubs.c +@@ -119,7 +119,7 @@ static void calibrate_dc_servo(struct snd_soc_codec *codec) + switch (hubs->dcs_readback_mode) { + case 0: + reg_l = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_1) +- & WM8993_DCS_INTEG_CHAN_0_MASK;; ++ & WM8993_DCS_INTEG_CHAN_0_MASK; + reg_r = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_2) + & WM8993_DCS_INTEG_CHAN_1_MASK; + break; + + + + diff --git a/test/corpora/lkml/cur/1382298793.002575:2, b/test/corpora/lkml/cur/1382298793.002575:2, new file mode 100644 index 00000000..981c1c9a --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002575:2, @@ -0,0 +1,79 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary + semicolons +Date: Mon, 15 Nov 2010 17:30:31 +0000 +Lines: 7 +Message-ID: <20101115173031.GI12986@rakim.wolfsonmicro.main> +References: <cover.1289789604.git.joe@perches.com> + <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> + <20101115134939.GC12986@rakim.wolfsonmicro.main> + <1289840957.16461.138.camel@Joe-Laptop> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + Takashi Iwai <tiwai@suse.de>, linux-kernel@vger.kernel.org, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk> +To: Joe Perches <joe@perches.com> +X-From: alsa-devel-bounces@alsa-project.org Mon Nov 15 18:30:46 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PI2t9-0000lr-Er + for glad-alsa-devel-2@m.gmane.org; Mon, 15 Nov 2010 18:30:43 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 5B6F8244F9; Mon, 15 Nov 2010 18:30:41 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id AE3D8244FB; + Mon, 15 Nov 2010 18:30:36 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id EF7B7244FC; Mon, 15 Nov 2010 18:30:34 +0100 (CET) +Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com + [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 8B247244F9 + for <alsa-devel@alsa-project.org>; Mon, 15 Nov 2010 18:30:34 +0100 (CET) +Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com + [87.246.78.27]) + by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id C748C788028; + Mon, 15 Nov 2010 17:30:32 +0000 (GMT) +Received: from broonie by rakim.wolfsonmicro.main with local (Exim 4.72) + (envelope-from <broonie@rakim.wolfsonmicro.main>) + id 1PI2sx-0000C1-Jf; Mon, 15 Nov 2010 17:30:31 +0000 +Content-Disposition: inline +In-Reply-To: <1289840957.16461.138.camel@Joe-Laptop> +X-Cookie: I like your SNOOPY POSTER!! +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062597> + +On Mon, Nov 15, 2010 at 09:09:17AM -0800, Joe Perches wrote: +> Signed-off-by: Joe Perches <joe@perches.com> + +Applied, thanks. + +Please try to use changelog formats consistent with the code you're +modifying. + + diff --git a/test/corpora/lkml/cur/1382298793.002576:2, b/test/corpora/lkml/cur/1382298793.002576:2, new file mode 100644 index 00000000..6963356d --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002576:2, @@ -0,0 +1,63 @@ +From: Joe Perches <joe@perches.com> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 09:34:04 -0800 +Lines: 15 +Message-ID: <1289842444.16461.140.camel@Joe-Laptop> +References: <cover.1289789604.git.joe@perches.com> + <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> + <20101115134939.GC12986@rakim.wolfsonmicro.main> + <1289840957.16461.138.camel@Joe-Laptop> + <20101115173031.GI12986@rakim.wolfsonmicro.main> +Mime-Version: 1.0 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 7bit +Cc: Jiri Kosina <trivial@kernel.org>, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk>, + Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Mark Brown <broonie@opensource.wolfsonmicro.com> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 18:34:20 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PI2wd-0002wj-Br + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 18:34:19 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933091Ab0KOReI (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 12:34:08 -0500 +Received: from mail.perches.com ([173.55.12.10]:1304 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S933013Ab0KOReH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 12:34:07 -0500 +Received: from [192.168.1.162] (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 9F71A24368; + Mon, 15 Nov 2010 09:32:18 -0800 (PST) +In-Reply-To: <20101115173031.GI12986@rakim.wolfsonmicro.main> +X-Mailer: Evolution 2.30.3 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062599> + +On Mon, 2010-11-15 at 17:30 +0000, Mark Brown wrote: +> On Mon, Nov 15, 2010 at 09:09:17AM -0800, Joe Perches wrote: +> > Signed-off-by: Joe Perches <joe@perches.com> +> Applied, thanks. +> Please try to use changelog formats consistent with the code you're +> modifying. + +I think it's more important to use consistent changelogs +for a patch series. + +If you want your own subsystem changelog consistency, I +think you should change the format to what you desire. + +cheers, Joe + + + diff --git a/test/corpora/lkml/cur/1382298793.002639:2, b/test/corpora/lkml/cur/1382298793.002639:2, new file mode 100644 index 00000000..450509df --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002639:2, @@ -0,0 +1,90 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary + semicolons +Date: Mon, 15 Nov 2010 18:27:08 +0000 +Lines: 16 +Message-ID: <20101115182708.GJ12986@rakim.wolfsonmicro.main> +References: <cover.1289789604.git.joe@perches.com> + <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> + <20101115134939.GC12986@rakim.wolfsonmicro.main> + <1289840957.16461.138.camel@Joe-Laptop> + <20101115173031.GI12986@rakim.wolfsonmicro.main> + <1289842444.16461.140.camel@Joe-Laptop> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + Takashi Iwai <tiwai@suse.de>, linux-kernel@vger.kernel.org, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk> +To: Joe Perches <joe@perches.com> +X-From: alsa-devel-bounces@alsa-project.org Mon Nov 15 19:27:21 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PI3lw-0007AT-Pq + for glad-alsa-devel-2@m.gmane.org; Mon, 15 Nov 2010 19:27:20 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 35136103873; Mon, 15 Nov 2010 19:27:17 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id B554724525; + Mon, 15 Nov 2010 19:27:11 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id D599A24527; Mon, 15 Nov 2010 19:27:10 +0100 (CET) +Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com + [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 5719224414 + for <alsa-devel@alsa-project.org>; Mon, 15 Nov 2010 19:27:10 +0100 (CET) +Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com + [87.246.78.27]) + by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id C97D2788028; + Mon, 15 Nov 2010 18:27:09 +0000 (GMT) +Received: from broonie by rakim.wolfsonmicro.main with local (Exim 4.72) + (envelope-from <broonie@rakim.wolfsonmicro.main>) + id 1PI3lk-00053D-RZ; Mon, 15 Nov 2010 18:27:08 +0000 +Content-Disposition: inline +In-Reply-To: <1289842444.16461.140.camel@Joe-Laptop> +X-Cookie: I like your SNOOPY POSTER!! +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062664> + +On Mon, Nov 15, 2010 at 09:34:04AM -0800, Joe Perches wrote: +> On Mon, 2010-11-15 at 17:30 +0000, Mark Brown wrote: + +> > Please try to use changelog formats consistent with the code you're +> > modifying. + +> I think it's more important to use consistent changelogs +> for a patch series. + +...since...? + +> If you want your own subsystem changelog consistency, I +> think you should change the format to what you desire. + +Which is what I'm doing but it's annoying to have to constantly hand +edit changelogs. + + diff --git a/test/corpora/lkml/cur/1382298793.002642:2, b/test/corpora/lkml/cur/1382298793.002642:2, new file mode 100644 index 00000000..1bd4e32c --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002642:2, @@ -0,0 +1,66 @@ +From: Joe Perches <joe@perches.com> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 10:30:29 -0800 +Lines: 16 +Message-ID: <1289845830.16461.149.camel@Joe-Laptop> +References: <cover.1289789604.git.joe@perches.com> + <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> + <20101115134939.GC12986@rakim.wolfsonmicro.main> + <1289840957.16461.138.camel@Joe-Laptop> + <20101115173031.GI12986@rakim.wolfsonmicro.main> + <1289842444.16461.140.camel@Joe-Laptop> + <20101115182708.GJ12986@rakim.wolfsonmicro.main> +Mime-Version: 1.0 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 7bit +Cc: Jiri Kosina <trivial@kernel.org>, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk>, + Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Mark Brown <broonie@opensource.wolfsonmicro.com> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 19:31:55 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PI3qN-0000mO-6u + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 19:31:55 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1758106Ab0KOSad (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 13:30:33 -0500 +Received: from mail.perches.com ([173.55.12.10]:1314 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1756843Ab0KOSac (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 13:30:32 -0500 +Received: from [192.168.1.162] (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 2BC7724368; + Mon, 15 Nov 2010 10:28:43 -0800 (PST) +In-Reply-To: <20101115182708.GJ12986@rakim.wolfsonmicro.main> +X-Mailer: Evolution 2.30.3 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062667> + +On Mon, 2010-11-15 at 18:27 +0000, Mark Brown wrote: +> On Mon, Nov 15, 2010 at 09:34:04AM -0800, Joe Perches wrote: +> > On Mon, 2010-11-15 at 17:30 +0000, Mark Brown wrote: +> > > Please try to use changelog formats consistent with the code you're +> > > modifying. +> > I think it's more important to use consistent changelogs +> > for a patch series. +> ...since...? + +1995... + +Since there isn't a consistent standard for subsystems +changelogs and automating scripts for the desires of +individual subsystem maintainers is not feasible. + + + + diff --git a/test/corpora/lkml/cur/1382298793.002661:2, b/test/corpora/lkml/cur/1382298793.002661:2, new file mode 100644 index 00000000..36f87520 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002661:2, @@ -0,0 +1,49 @@ +From: David Miller <davem@davemloft.net> +Subject: Re: [PATCH 39/44] include/net/caif/cfctrl.h: Remove unnecessary + semicolons +Date: Mon, 15 Nov 2010 11:07:32 -0800 (PST) +Lines: 6 +Message-ID: <20101115.110732.27814339.davem@davemloft.net> +References: <cover.1289789604.git.joe@perches.com> + <35914cfea1bd0ab3963e632d02b1fdd52a9d2bc8.1289789605.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Cc: trivial@kernel.org, sjur.brandeland@stericsson.com, + netdev@vger.kernel.org, linux-kernel@vger.kernel.org +To: joe@perches.com +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 20:07:42 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PI4Oy-0002G6-Lp + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 20:07:41 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933101Ab0KOTHJ (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 14:07:09 -0500 +Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:51782 + "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) + by vger.kernel.org with ESMTP id S932513Ab0KOTHI (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 14:07:08 -0500 +Received: from localhost (localhost [127.0.0.1]) + by sunset.davemloft.net (Postfix) with ESMTP id 71B5924C088; + Mon, 15 Nov 2010 11:07:33 -0800 (PST) +In-Reply-To: <35914cfea1bd0ab3963e632d02b1fdd52a9d2bc8.1289789605.git.joe@perches.com> +X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062686> + +From: Joe Perches <joe@perches.com> +Date: Sun, 14 Nov 2010 19:04:58 -0800 + +> Signed-off-by: Joe Perches <joe@perches.com> + +Applied. + + diff --git a/test/corpora/lkml/cur/1382298793.002662:2, b/test/corpora/lkml/cur/1382298793.002662:2, new file mode 100644 index 00000000..2fbb7e7a --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002662:2, @@ -0,0 +1,49 @@ +From: David Miller <davem@davemloft.net> +Subject: Re: [PATCH 41/44] net/ipv6/mcast.c: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 11:07:39 -0800 (PST) +Lines: 6 +Message-ID: <20101115.110739.191407854.davem@davemloft.net> +References: <cover.1289789604.git.joe@perches.com> + <1f3e1f7e454f3c62b66fc5f3e1e1ed90d62b7fb0.1289789605.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Cc: trivial@kernel.org, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, + jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net, + netdev@vger.kernel.org, linux-kernel@vger.kernel.org +To: joe@perches.com +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 20:07:42 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PI4Oz-0002G6-63 + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 20:07:41 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933351Ab0KOTHS (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 14:07:18 -0500 +Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:51792 + "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) + by vger.kernel.org with ESMTP id S933109Ab0KOTHP (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 14:07:15 -0500 +Received: from localhost (localhost [127.0.0.1]) + by sunset.davemloft.net (Postfix) with ESMTP id 53FFA24C088; + Mon, 15 Nov 2010 11:07:40 -0800 (PST) +In-Reply-To: <1f3e1f7e454f3c62b66fc5f3e1e1ed90d62b7fb0.1289789605.git.joe@perches.com> +X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062687> + +From: Joe Perches <joe@perches.com> +Date: Sun, 14 Nov 2010 19:05:00 -0800 + +> Signed-off-by: Joe Perches <joe@perches.com> + +Applied. + + diff --git a/test/corpora/lkml/cur/1382298793.002663:2, b/test/corpora/lkml/cur/1382298793.002663:2, new file mode 100644 index 00000000..c888922c --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002663:2, @@ -0,0 +1,50 @@ +From: David Miller <davem@davemloft.net> +Subject: Re: [PATCH 15/44] drivers/net/vxge: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 11:07:55 -0800 (PST) +Lines: 6 +Message-ID: <20101115.110755.98889745.davem@davemloft.net> +References: <cover.1289789604.git.joe@perches.com> + <e86e79a18106cc38715136bfb2e880b38f5ac764.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Cc: trivial@kernel.org, ramkrishna.vepa@exar.com, + sivakumar.subramani@exar.com, sreenivasa.honnur@exar.com, + jon.mason@exar.com, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +To: joe@perches.com +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 20:07:42 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PI4P0-0002G6-7S + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 20:07:42 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933487Ab0KOTHe (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 14:07:34 -0500 +Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:51805 + "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) + by vger.kernel.org with ESMTP id S933109Ab0KOTHb (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 14:07:31 -0500 +Received: from localhost (localhost [127.0.0.1]) + by sunset.davemloft.net (Postfix) with ESMTP id 185A124C08A; + Mon, 15 Nov 2010 11:07:56 -0800 (PST) +In-Reply-To: <e86e79a18106cc38715136bfb2e880b38f5ac764.1289789604.git.joe@perches.com> +X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062688> + +From: Joe Perches <joe@perches.com> +Date: Sun, 14 Nov 2010 19:04:34 -0800 + +> Signed-off-by: Joe Perches <joe@perches.com> + +Not applicable to net-next-2.6 + + diff --git a/test/corpora/lkml/cur/1382298793.002664:2, b/test/corpora/lkml/cur/1382298793.002664:2, new file mode 100644 index 00000000..ec584cb9 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002664:2, @@ -0,0 +1,49 @@ +From: David Miller <davem@davemloft.net> +Subject: Re: [PATCH 38/44] include/linux/if_macvlan.h: Remove unnecessary + semicolons +Date: Mon, 15 Nov 2010 11:07:46 -0800 (PST) +Lines: 6 +Message-ID: <20101115.110746.241931394.davem@davemloft.net> +References: <cover.1289789604.git.joe@perches.com> + <186ca914f887b2354ea3178696edc81cacbb28c6.1289789605.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Cc: trivial@kernel.org, kaber@trash.net, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +To: joe@perches.com +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 20:07:42 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PI4Oz-0002G6-MR + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 20:07:42 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933465Ab0KOTHZ (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 14:07:25 -0500 +Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:51798 + "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) + by vger.kernel.org with ESMTP id S933109Ab0KOTHV (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 14:07:21 -0500 +Received: from localhost (localhost [127.0.0.1]) + by sunset.davemloft.net (Postfix) with ESMTP id 665FB24C08A; + Mon, 15 Nov 2010 11:07:46 -0800 (PST) +In-Reply-To: <186ca914f887b2354ea3178696edc81cacbb28c6.1289789605.git.joe@perches.com> +X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062689> + +From: Joe Perches <joe@perches.com> +Date: Sun, 14 Nov 2010 19:04:57 -0800 + +> Signed-off-by: Joe Perches <joe@perches.com> + +Applied. + + diff --git a/test/corpora/lkml/cur/1382298793.002665:2, b/test/corpora/lkml/cur/1382298793.002665:2, new file mode 100644 index 00000000..7af81e81 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002665:2, @@ -0,0 +1,98 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary + semicolons +Date: Mon, 15 Nov 2010 19:07:38 +0000 +Lines: 22 +Message-ID: <20101115190738.GF3338@sirena.org.uk> +References: <cover.1289789604.git.joe@perches.com> + <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> + <20101115134939.GC12986@rakim.wolfsonmicro.main> + <1289840957.16461.138.camel@Joe-Laptop> + <20101115173031.GI12986@rakim.wolfsonmicro.main> + <1289842444.16461.140.camel@Joe-Laptop> + <20101115182708.GJ12986@rakim.wolfsonmicro.main> + <1289845830.16461.149.camel@Joe-Laptop> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + Takashi Iwai <tiwai@suse.de>, linux-kernel@vger.kernel.org, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk> +To: Joe Perches <joe@perches.com> +X-From: alsa-devel-bounces@alsa-project.org Mon Nov 15 20:07:53 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PI4PA-0002MQ-AO + for glad-alsa-devel-2@m.gmane.org; Mon, 15 Nov 2010 20:07:52 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 78DB02453D; Mon, 15 Nov 2010 20:07:51 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 07D122453A; + Mon, 15 Nov 2010 20:07:47 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 4AB082453B; Mon, 15 Nov 2010 20:07:45 +0100 (CET) +Received: from cassiel.sirena.org.uk (cassiel.sirena.org.uk [80.68.93.111]) + by alsa0.perex.cz (Postfix) with ESMTP id D864524538 + for <alsa-devel@alsa-project.org>; Mon, 15 Nov 2010 20:07:44 +0100 (CET) +Received: from broonie by cassiel.sirena.org.uk with local (Exim 4.69) + (envelope-from <broonie@sirena.org.uk>) + id 1PI4Ow-0007qS-V5; Mon, 15 Nov 2010 19:07:38 +0000 +Content-Disposition: inline +In-Reply-To: <1289845830.16461.149.camel@Joe-Laptop> +X-Cookie: Who messed with my anti-paranoia shot? +User-Agent: Mutt/1.5.18 (2008-05-17) +X-SA-Exim-Connect-IP: <locally generated> +X-SA-Exim-Mail-From: broonie@sirena.org.uk +X-SA-Exim-Scanned: No (on cassiel.sirena.org.uk); + SAEximRunCond expanded to false +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062690> + +On Mon, Nov 15, 2010 at 10:30:29AM -0800, Joe Perches wrote: +> On Mon, 2010-11-15 at 18:27 +0000, Mark Brown wrote: +> > On Mon, Nov 15, 2010 at 09:34:04AM -0800, Joe Perches wrote: + +> > > I think it's more important to use consistent changelogs +> > > for a patch series. + +> > ...since...? + +> 1995... + +That's not really a reason. It seems that... + +> Since there isn't a consistent standard for subsystems +> changelogs and automating scripts for the desires of +> individual subsystem maintainers is not feasible. + +...you mean that you wish to do this since it makes your life as a +script author easier. I'd suggest using pattern matching to look up the +rules for generating the prefixes (it's pretty much entirely prefixes) +in the same way you're handling figuring out who to mail - that'd +probably cover it in an automatable fashion. + + diff --git a/test/corpora/lkml/cur/1382298793.002666:2, b/test/corpora/lkml/cur/1382298793.002666:2, new file mode 100644 index 00000000..8907c252 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002666:2, @@ -0,0 +1,87 @@ +From: David Miller <davem@davemloft.net> +Subject: Re: [PATCH 13/44] drivers/net/e1000e: Remove + unnecessary semicolons +Date: Mon, 15 Nov 2010 11:08:27 -0800 (PST) +Lines: 19 +Message-ID: <20101115.110827.58428696.davem@davemloft.net> +References: <cover.1289789604.git.joe@perches.com> + <e5cf92d50de7924930d660a5865c3d60d9cd9dc5.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: trivial@kernel.org, e1000-devel@lists.sourceforge.net, + bruce.w.allan@intel.com, jesse.brandeburg@intel.com, + linux-kernel@vger.kernel.org, gregory.v.rose@intel.com, + john.ronciak@intel.com, jeffrey.t.kirsher@intel.com, netdev@vger.kernel.org +To: joe@perches.com +X-From: e1000-devel-bounces@lists.sourceforge.net Mon Nov 15 20:08:15 2010 +Return-path: <e1000-devel-bounces@lists.sourceforge.net> +Envelope-to: glded-e1000-devel@m.gmane.org +Received: from lists.sourceforge.net ([216.34.181.88]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <e1000-devel-bounces@lists.sourceforge.net>) + id 1PI4PW-0002W0-GR + for glded-e1000-devel@m.gmane.org; Mon, 15 Nov 2010 20:08:14 +0100 +Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) + by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) + (envelope-from <e1000-devel-bounces@lists.sourceforge.net>) + id 1PI4PV-0002fQ-W8; Mon, 15 Nov 2010 19:08:13 +0000 +Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] + helo=mx.sourceforge.net) + by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) + (envelope-from <davem@davemloft.net>) id 1PI4PU-0002fJ-Ct + for e1000-devel@lists.sourceforge.net; Mon, 15 Nov 2010 19:08:12 +0000 +X-ACL-Warn: +Received: from 74-93-104-97-washington.hfc.comcastbusiness.net ([74.93.104.97] + helo=sunset.davemloft.net) + by sog-mx-3.v43.ch3.sourceforge.com with esmtp (Exim 4.69) + id 1PI4PQ-0006vK-9a + for e1000-devel@lists.sourceforge.net; Mon, 15 Nov 2010 19:08:12 +0000 +Received: from localhost (localhost [127.0.0.1]) + by sunset.davemloft.net (Postfix) with ESMTP id 0BCD224C088; + Mon, 15 Nov 2010 11:08:28 -0800 (PST) +In-Reply-To: <e5cf92d50de7924930d660a5865c3d60d9cd9dc5.1289789604.git.joe@perches.com> +X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) +X-Spam-Score: 0.8 (/) +X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. + See http://spamassassin.org/tag/ for more details. + 1.0 RDNS_DYNAMIC Delivered to internal network by host with + dynamic-looking rDNS + -0.2 AWL AWL: From: address is in the auto white-list +X-Headers-End: 1PI4PQ-0006vK-9a +X-BeenThere: e1000-devel@lists.sourceforge.net +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "e100/e1000\(e\)/ixgb/igb/ixgbe development and discussion" + <e1000-devel.lists.sourceforge.net> +List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/e1000-devel>, + <mailto:e1000-devel-request@lists.sourceforge.net?subject=unsubscribe> +List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=e1000-devel> +List-Post: <mailto:e1000-devel@lists.sourceforge.net> +List-Help: <mailto:e1000-devel-request@lists.sourceforge.net?subject=help> +List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/e1000-devel>, + <mailto:e1000-devel-request@lists.sourceforge.net?subject=subscribe> +Errors-To: e1000-devel-bounces@lists.sourceforge.net +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062691> + +From: Joe Perches <joe@perches.com> +Date: Sun, 14 Nov 2010 19:04:32 -0800 + +> Signed-off-by: Joe Perches <joe@perches.com> + +Applied. + +------------------------------------------------------------------------------ +Centralized Desktop Delivery: Dell and VMware Reference Architecture +Simplifying enterprise desktop deployment and management using +Dell EqualLogic storage and VMware View: A highly scalable, end-to-end +client virtualization framework. Read more! +http://p.sf.net/sfu/dell-eql-dev2dev +_______________________________________________ +E1000-devel mailing list +E1000-devel@lists.sourceforge.net +https://lists.sourceforge.net/lists/listinfo/e1000-devel +To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired + + + diff --git a/test/corpora/lkml/cur/1382298793.002667:2, b/test/corpora/lkml/cur/1382298793.002667:2, new file mode 100644 index 00000000..c85cbd51 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002667:2, @@ -0,0 +1,87 @@ +From: David Miller <davem@davemloft.net> +Subject: Re: [PATCH 14/44] drivers/net/ixgbe: Remove + unnecessary semicolons +Date: Mon, 15 Nov 2010 11:08:21 -0800 (PST) +Lines: 19 +Message-ID: <20101115.110821.13743893.davem@davemloft.net> +References: <cover.1289789604.git.joe@perches.com> + <7d2c334daa75c5221946a17d45c9de1901cf06e7.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: trivial@kernel.org, e1000-devel@lists.sourceforge.net, + bruce.w.allan@intel.com, jesse.brandeburg@intel.com, + linux-kernel@vger.kernel.org, gregory.v.rose@intel.com, + john.ronciak@intel.com, jeffrey.t.kirsher@intel.com, netdev@vger.kernel.org +To: joe@perches.com +X-From: e1000-devel-bounces@lists.sourceforge.net Mon Nov 15 20:08:15 2010 +Return-path: <e1000-devel-bounces@lists.sourceforge.net> +Envelope-to: glded-e1000-devel@m.gmane.org +Received: from lists.sourceforge.net ([216.34.181.88]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <e1000-devel-bounces@lists.sourceforge.net>) + id 1PI4PW-0002Vz-9H + for glded-e1000-devel@m.gmane.org; Mon, 15 Nov 2010 20:08:14 +0100 +Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) + by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) + (envelope-from <e1000-devel-bounces@lists.sourceforge.net>) + id 1PI4PQ-0008VG-9t; Mon, 15 Nov 2010 19:08:08 +0000 +Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] + helo=mx.sourceforge.net) + by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) + (envelope-from <davem@davemloft.net>) id 1PI4PO-0008V9-I9 + for e1000-devel@lists.sourceforge.net; Mon, 15 Nov 2010 19:08:06 +0000 +X-ACL-Warn: +Received: from 74-93-104-97-washington.hfc.comcastbusiness.net ([74.93.104.97] + helo=sunset.davemloft.net) + by sog-mx-1.v43.ch3.sourceforge.com with esmtp (Exim 4.69) + id 1PI4PK-0004Ab-D0 + for e1000-devel@lists.sourceforge.net; Mon, 15 Nov 2010 19:08:06 +0000 +Received: from localhost (localhost [127.0.0.1]) + by sunset.davemloft.net (Postfix) with ESMTP id E0AE124C08A; + Mon, 15 Nov 2010 11:08:21 -0800 (PST) +In-Reply-To: <7d2c334daa75c5221946a17d45c9de1901cf06e7.1289789604.git.joe@perches.com> +X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) +X-Spam-Score: 0.7 (/) +X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. + See http://spamassassin.org/tag/ for more details. + 1.0 RDNS_DYNAMIC Delivered to internal network by host with + dynamic-looking rDNS + -0.3 AWL AWL: From: address is in the auto white-list +X-Headers-End: 1PI4PK-0004Ab-D0 +X-BeenThere: e1000-devel@lists.sourceforge.net +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "e100/e1000\(e\)/ixgb/igb/ixgbe development and discussion" + <e1000-devel.lists.sourceforge.net> +List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/e1000-devel>, + <mailto:e1000-devel-request@lists.sourceforge.net?subject=unsubscribe> +List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=e1000-devel> +List-Post: <mailto:e1000-devel@lists.sourceforge.net> +List-Help: <mailto:e1000-devel-request@lists.sourceforge.net?subject=help> +List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/e1000-devel>, + <mailto:e1000-devel-request@lists.sourceforge.net?subject=subscribe> +Errors-To: e1000-devel-bounces@lists.sourceforge.net +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062692> + +From: Joe Perches <joe@perches.com> +Date: Sun, 14 Nov 2010 19:04:33 -0800 + +> Signed-off-by: Joe Perches <joe@perches.com> + +Applied. + +------------------------------------------------------------------------------ +Centralized Desktop Delivery: Dell and VMware Reference Architecture +Simplifying enterprise desktop deployment and management using +Dell EqualLogic storage and VMware View: A highly scalable, end-to-end +client virtualization framework. Read more! +http://p.sf.net/sfu/dell-eql-dev2dev +_______________________________________________ +E1000-devel mailing list +E1000-devel@lists.sourceforge.net +https://lists.sourceforge.net/lists/listinfo/e1000-devel +To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired + + + diff --git a/test/corpora/lkml/cur/1382298793.002668:2, b/test/corpora/lkml/cur/1382298793.002668:2, new file mode 100644 index 00000000..a4537440 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002668:2, @@ -0,0 +1,50 @@ +From: David Miller <davem@davemloft.net> +Subject: Re: [PATCH 21/44] drivers/s390/net: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 11:08:10 -0800 (PST) +Lines: 6 +Message-ID: <20101115.110810.241442235.davem@davemloft.net> +References: <cover.1289789604.git.joe@perches.com> + <ea09773876fb36a52a9a750110b381d20767ac12.1289789605.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Cc: trivial@kernel.org, ursula.braun@de.ibm.com, + blaschka@linux.vnet.ibm.com, linux390@de.ibm.com, + schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, + linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org +To: joe@perches.com +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 20:09:11 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PI4QQ-00030Y-IU + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 20:09:10 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933525Ab0KOTHt (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 14:07:49 -0500 +Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:51810 + "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) + by vger.kernel.org with ESMTP id S933071Ab0KOTHp (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 14:07:45 -0500 +Received: from localhost (localhost [127.0.0.1]) + by sunset.davemloft.net (Postfix) with ESMTP id 79DC124C088; + Mon, 15 Nov 2010 11:08:10 -0800 (PST) +In-Reply-To: <ea09773876fb36a52a9a750110b381d20767ac12.1289789605.git.joe@perches.com> +X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062693> + +From: Joe Perches <joe@perches.com> +Date: Sun, 14 Nov 2010 19:04:40 -0800 + +> Signed-off-by: Joe Perches <joe@perches.com> + +I'll let the s390 folks take this one. + + diff --git a/test/corpora/lkml/cur/1382298793.002669:2, b/test/corpora/lkml/cur/1382298793.002669:2, new file mode 100644 index 00000000..f595d0a8 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002669:2, @@ -0,0 +1,48 @@ +From: David Miller <davem@davemloft.net> +Subject: Re: [PATCH 18/44] drivers/net/cnic.c: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 11:08:15 -0800 (PST) +Lines: 6 +Message-ID: <20101115.110815.52192986.davem@davemloft.net> +References: <cover.1289789604.git.joe@perches.com> + <950331e47b16c2ad28d73502f30f5a0f017b5493.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Cc: trivial@kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +To: joe@perches.com +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 20:09:11 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PI4QR-00030Y-3C + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 20:09:11 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933539Ab0KOTHy (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 14:07:54 -0500 +Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:51817 + "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) + by vger.kernel.org with ESMTP id S933054Ab0KOTHv (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 14:07:51 -0500 +Received: from localhost (localhost [127.0.0.1]) + by sunset.davemloft.net (Postfix) with ESMTP id 0297924C08A; + Mon, 15 Nov 2010 11:08:16 -0800 (PST) +In-Reply-To: <950331e47b16c2ad28d73502f30f5a0f017b5493.1289789604.git.joe@perches.com> +X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062694> + +From: Joe Perches <joe@perches.com> +Date: Sun, 14 Nov 2010 19:04:37 -0800 + +> Signed-off-by: Joe Perches <joe@perches.com> + +Applied. + + diff --git a/test/corpora/lkml/cur/1382298793.002670:2, b/test/corpora/lkml/cur/1382298793.002670:2, new file mode 100644 index 00000000..964ba859 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002670:2, @@ -0,0 +1,52 @@ +From: David Miller <davem@davemloft.net> +Subject: Re: [PATCH 07/44] drivers/isdn: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 11:08:40 -0800 (PST) +Lines: 11 +Message-ID: <20101115.110840.45901337.davem@davemloft.net> +References: <cover.1289789604.git.joe@perches.com> + <c7a38f65340aafb208d50fc3a781602c07aebb0c.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Cc: trivial@kernel.org, isdn@linux-pingi.de, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +To: joe@perches.com +X-From: netdev-owner@vger.kernel.org Mon Nov 15 20:09:14 2010 +Return-path: <netdev-owner@vger.kernel.org> +Envelope-to: linux-netdev-2@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <netdev-owner@vger.kernel.org>) + id 1PI4QU-00030Y-5P + for linux-netdev-2@lo.gmane.org; Mon, 15 Nov 2010 20:09:14 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933584Ab0KOTIR (ORCPT <rfc822;linux-netdev-2@m.gmane.org>); + Mon, 15 Nov 2010 14:08:17 -0500 +Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:51842 + "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) + by vger.kernel.org with ESMTP id S933494Ab0KOTIP (ORCPT + <rfc822;netdev@vger.kernel.org>); Mon, 15 Nov 2010 14:08:15 -0500 +Received: from localhost (localhost [127.0.0.1]) + by sunset.davemloft.net (Postfix) with ESMTP id 88D8924C088; + Mon, 15 Nov 2010 11:08:40 -0800 (PST) +In-Reply-To: <c7a38f65340aafb208d50fc3a781602c07aebb0c.1289789604.git.joe@perches.com> +X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) +Sender: netdev-owner@vger.kernel.org +Precedence: bulk +List-ID: <netdev.vger.kernel.org> +X-Mailing-List: netdev@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062695> + +From: Joe Perches <joe@perches.com> +Date: Sun, 14 Nov 2010 19:04:26 -0800 + +> Signed-off-by: Joe Perches <joe@perches.com> + +Applied. +-- +To unsubscribe from this list: send the line "unsubscribe netdev" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298793.002671:2, b/test/corpora/lkml/cur/1382298793.002671:2, new file mode 100644 index 00000000..1fe0cc55 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002671:2, @@ -0,0 +1,48 @@ +From: David Miller <davem@davemloft.net> +Subject: Re: [PATCH 12/44] drivers/net/bnx2x: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 11:08:34 -0800 (PST) +Lines: 6 +Message-ID: <20101115.110834.91340564.davem@davemloft.net> +References: <cover.1289789604.git.joe@perches.com> + <2bfaf1f1fe5d503a8a386a433b5187997819d771.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Cc: trivial@kernel.org, eilong@broadcom.com, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +To: joe@perches.com +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 20:09:14 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PI4QT-00030Y-LK + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 20:09:13 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933575Ab0KOTIN (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 14:08:13 -0500 +Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:51836 + "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) + by vger.kernel.org with ESMTP id S933449Ab0KOTIJ (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 14:08:09 -0500 +Received: from localhost (localhost [127.0.0.1]) + by sunset.davemloft.net (Postfix) with ESMTP id 8FAC824C08A; + Mon, 15 Nov 2010 11:08:34 -0800 (PST) +In-Reply-To: <2bfaf1f1fe5d503a8a386a433b5187997819d771.1289789604.git.joe@perches.com> +X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062696> + +From: Joe Perches <joe@perches.com> +Date: Sun, 14 Nov 2010 19:04:31 -0800 + +> Signed-off-by: Joe Perches <joe@perches.com> + +Applied. + + diff --git a/test/corpora/lkml/cur/1382298793.002679:2, b/test/corpora/lkml/cur/1382298793.002679:2, new file mode 100644 index 00000000..8e1234b6 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002679:2, @@ -0,0 +1,61 @@ +From: Joe Perches <joe@perches.com> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 11:14:18 -0800 +Lines: 9 +Message-ID: <1289848458.16461.150.camel@Joe-Laptop> +References: <cover.1289789604.git.joe@perches.com> + <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> + <20101115134939.GC12986@rakim.wolfsonmicro.main> + <1289840957.16461.138.camel@Joe-Laptop> + <20101115173031.GI12986@rakim.wolfsonmicro.main> + <1289842444.16461.140.camel@Joe-Laptop> + <20101115182708.GJ12986@rakim.wolfsonmicro.main> + <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> +Mime-Version: 1.0 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 7bit +Cc: Jiri Kosina <trivial@kernel.org>, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk>, + Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Mark Brown <broonie@opensource.wolfsonmicro.com> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 20:14:49 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PI4Vp-0006HI-NH + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 20:14:46 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933566Ab0KOTOW (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 14:14:22 -0500 +Received: from mail.perches.com ([173.55.12.10]:1319 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S933505Ab0KOTOV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 14:14:21 -0500 +Received: from [192.168.1.162] (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 4087C24368; + Mon, 15 Nov 2010 11:12:31 -0800 (PST) +In-Reply-To: <20101115190738.GF3338@sirena.org.uk> +X-Mailer: Evolution 2.30.3 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062704> + +On Mon, 2010-11-15 at 19:07 +0000, Mark Brown wrote: +> I'd suggest using pattern matching to look up the +> rules for generating the prefixes (it's pretty much entirely prefixes) +> in the same way you're handling figuring out who to mail - that'd +> probably cover it in an automatable fashion. + +Publish a tool that works and I'll use it. + + + + diff --git a/test/corpora/lkml/cur/1382298793.002688:2, b/test/corpora/lkml/cur/1382298793.002688:2, new file mode 100644 index 00000000..7d573a09 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002688:2, @@ -0,0 +1,94 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary + semicolons +Date: Mon, 15 Nov 2010 19:34:07 +0000 +Lines: 16 +Message-ID: <20101115193407.GK12986@rakim.wolfsonmicro.main> +References: <cover.1289789604.git.joe@perches.com> + <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> + <20101115134939.GC12986@rakim.wolfsonmicro.main> + <1289840957.16461.138.camel@Joe-Laptop> + <20101115173031.GI12986@rakim.wolfsonmicro.main> + <1289842444.16461.140.camel@Joe-Laptop> + <20101115182708.GJ12986@rakim.wolfsonmicro.main> + <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> + <1289848458.16461.150.camel@Joe-Laptop> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + Takashi Iwai <tiwai@suse.de>, linux-kernel@vger.kernel.org, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk> +To: Joe Perches <joe@perches.com> +X-From: alsa-devel-bounces@alsa-project.org Mon Nov 15 20:34:23 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PI4oo-0008LE-En + for glad-alsa-devel-2@m.gmane.org; Mon, 15 Nov 2010 20:34:22 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 9B9BF24551; Mon, 15 Nov 2010 20:34:21 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 7F6F424547; + Mon, 15 Nov 2010 20:34:16 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 4D4F724548; Mon, 15 Nov 2010 20:34:14 +0100 (CET) +Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com + [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 9C6502453F + for <alsa-devel@alsa-project.org>; Mon, 15 Nov 2010 20:34:09 +0100 (CET) +Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com + [87.246.78.27]) + by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id 992AA788028; + Mon, 15 Nov 2010 19:34:08 +0000 (GMT) +Received: from broonie by rakim.wolfsonmicro.main with local (Exim 4.72) + (envelope-from <broonie@rakim.wolfsonmicro.main>) + id 1PI4oZ-0005Qk-Q4; Mon, 15 Nov 2010 19:34:07 +0000 +Content-Disposition: inline +In-Reply-To: <1289848458.16461.150.camel@Joe-Laptop> +X-Cookie: I like your SNOOPY POSTER!! +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062713> + +On Mon, Nov 15, 2010 at 11:14:18AM -0800, Joe Perches wrote: +> On Mon, 2010-11-15 at 19:07 +0000, Mark Brown wrote: + +> > I'd suggest using pattern matching to look up the +> > rules for generating the prefixes (it's pretty much entirely prefixes) +> > in the same way you're handling figuring out who to mail - that'd +> > probably cover it in an automatable fashion. + +> Publish a tool that works and I'll use it. + +It appears your scripts are already hooked into get_maintainers.pl which +would seem the obvious place to do this? Sadly I don't do perl, though +it looks like you're doing pretty much all the work on that anyway. + +The main thing here is to avoid your patches sticking out - as well as +the hassle applying them stuff like this is also a red flag on review. + + diff --git a/test/corpora/lkml/cur/1382298793.002699:2, b/test/corpora/lkml/cur/1382298793.002699:2, new file mode 100644 index 00000000..3fdfaf11 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.002699:2, @@ -0,0 +1,106 @@ +From: Joe Perches <joe@perches.com> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary semicolons +Date: Mon, 15 Nov 2010 11:52:53 -0800 +Lines: 52 +Message-ID: <1289850773.16461.166.camel@Joe-Laptop> +References: <cover.1289789604.git.joe@perches.com> + <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> + <20101115134939.GC12986@rakim.wolfsonmicro.main> + <1289840957.16461.138.camel@Joe-Laptop> + <20101115173031.GI12986@rakim.wolfsonmicro.main> + <1289842444.16461.140.camel@Joe-Laptop> + <20101115182708.GJ12986@rakim.wolfsonmicro.main> + <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> + <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> +Mime-Version: 1.0 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 7bit +Cc: Jiri Kosina <trivial@kernel.org>, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk>, + Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Mark Brown <broonie@opensource.wolfsonmicro.com> +X-From: linux-kernel-owner@vger.kernel.org Mon Nov 15 20:53:21 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PI57A-0001v9-CG + for glk-linux-kernel-3@lo.gmane.org; Mon, 15 Nov 2010 20:53:20 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932871Ab0KOTw5 (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 15 Nov 2010 14:52:57 -0500 +Received: from mail.perches.com ([173.55.12.10]:1328 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1758222Ab0KOTw4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Mon, 15 Nov 2010 14:52:56 -0500 +Received: from [192.168.1.162] (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id CE13524368; + Mon, 15 Nov 2010 11:51:05 -0800 (PST) +In-Reply-To: <20101115193407.GK12986@rakim.wolfsonmicro.main> +X-Mailer: Evolution 2.30.3 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1062724> + +On Mon, 2010-11-15 at 19:34 +0000, Mark Brown wrote: +> On Mon, Nov 15, 2010 at 11:14:18AM -0800, Joe Perches wrote: +> > On Mon, 2010-11-15 at 19:07 +0000, Mark Brown wrote: +> > > I'd suggest using pattern matching to look up the +> > > rules for generating the prefixes (it's pretty much entirely prefixes) +> > > in the same way you're handling figuring out who to mail - that'd +> > > probably cover it in an automatable fashion. +> > Publish a tool that works and I'll use it. +> It appears your scripts are already hooked into get_maintainers.pl which +> would seem the obvious place to do this? Sadly I don't do perl, though +> it looks like you're doing pretty much all the work on that anyway. + +Sadly, no it's not the right place. + +That script just generates cc email addresses +for pre-formatted commit patches. + +It'd have to be a script that modifies the git commit subject line +to the taste of the subsystem maintainer. + +Right now, I use a commit script that's something like: + +#!/bin/bash +echo "$1: Remove unnecessary semicolons" > msg +echo >> msg +#cat >> msg <<EOF +#Unnecessary semicolons should not exist. +#EOF +git commit -s -F msg $1 + +There could be a modification to $1 (path) +or some such. + +Maybe a script like +./scripts/convert_commit_subject_to_subsystem_maintainer_taste +or something. + +Care to write one in sh/bash/perl/python/c/ocaml/c#? + +As far as I know, the only subsystem pedants^H^H^H^H^Hople +that care much about the commit subject style are +arch/x86 and sound. + +I can understand the desire of these subsystem maintainers +to have a consistent style. I think though that requiring +a subject header style without providing more than a +general guideline is a but much. + +I'd use any other automated tool you want to provide. + +cheers, Joe + + + diff --git a/test/corpora/lkml/cur/1382298793.003013:2, b/test/corpora/lkml/cur/1382298793.003013:2, new file mode 100644 index 00000000..945ce7c5 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003013:2, @@ -0,0 +1,128 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary + semicolons +Date: Tue, 16 Nov 2010 10:49:22 +0000 +Lines: 50 +Message-ID: <20101116104921.GL12986@rakim.wolfsonmicro.main> +References: <20101115134939.GC12986@rakim.wolfsonmicro.main> + <1289840957.16461.138.camel@Joe-Laptop> + <20101115173031.GI12986@rakim.wolfsonmicro.main> + <1289842444.16461.140.camel@Joe-Laptop> + <20101115182708.GJ12986@rakim.wolfsonmicro.main> + <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> + <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> + <1289850773.16461.166.camel@Joe-Laptop> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + Takashi Iwai <tiwai@suse.de>, linux-kernel@vger.kernel.org, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk> +To: Joe Perches <joe@perches.com> +X-From: alsa-devel-bounces@alsa-project.org Tue Nov 16 11:49:29 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PIJ6O-0003Hl-Gx + for glad-alsa-devel-2@m.gmane.org; Tue, 16 Nov 2010 11:49:28 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id C3B89243EB; Tue, 16 Nov 2010 11:49:27 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 5204E243EB; + Tue, 16 Nov 2010 11:49:26 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id D1E2E243EC; Tue, 16 Nov 2010 11:49:24 +0100 (CET) +Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com + [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 16268243EA + for <alsa-devel@alsa-project.org>; Tue, 16 Nov 2010 11:49:24 +0100 (CET) +Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com + [87.246.78.27]) + by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id 4AC4E3B438A; + Tue, 16 Nov 2010 10:49:23 +0000 (GMT) +Received: from broonie by rakim.wolfsonmicro.main with local (Exim 4.72) + (envelope-from <broonie@rakim.wolfsonmicro.main>) + id 1PIJ6I-0001Kz-Cf; Tue, 16 Nov 2010 10:49:22 +0000 +Content-Disposition: inline +In-Reply-To: <1289850773.16461.166.camel@Joe-Laptop> +X-Cookie: I like your SNOOPY POSTER!! +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063040> + +On Mon, Nov 15, 2010 at 11:52:53AM -0800, Joe Perches wrote: +> On Mon, 2010-11-15 at 19:34 +0000, Mark Brown wrote: + +> > It appears your scripts are already hooked into get_maintainers.pl which +> > would seem the obvious place to do this? Sadly I don't do perl, though +> > it looks like you're doing pretty much all the work on that anyway. + +> Sadly, no it's not the right place. + +To query MAINTAINERS? I'd assume that's where you'd want to put that +stuff? + +> There could be a modification to $1 (path) +> or some such. +> +> Maybe a script like +> ./scripts/convert_commit_subject_to_subsystem_maintainer_taste +> or something. + +> Care to write one in sh/bash/perl/python/c/ocaml/c#? + +Like I say I'd expect this to be a get_maintainers based lookup to dump +some data out? + +> As far as I know, the only subsystem pedants^H^H^H^H^Hople +> that care much about the commit subject style are +> arch/x86 and sound. + +If you look at the kernel you'll see quite a few subsystems which have +some sort of standard practice which they do try to enforce, you +shouldn't take silence as people being happy here - it's taken me some +considerable time to get round to mentioning this, for example, and I +might not have bothered if the patch had applied first time around. +Like working against -next it's one of these things that would make your +patches easier to deal with. + +> I can understand the desire of these subsystem maintainers +> to have a consistent style. I think though that requiring +> a subject header style without providing more than a +> general guideline is a but much. + +The general guideline I tend to go with is that if what you're doing +looks odd for the code you're submitting against for some reason you're +doing something wrong unless you understand why you're doing something +different and there's a good reason. + +> I'd use any other automated tool you want to provide. + +Like I say, I'd expect the lookup from the database to be handled by +get_maintainers.pl. Having a separate database would seem odd. + + diff --git a/test/corpora/lkml/cur/1382298793.003145:2, b/test/corpora/lkml/cur/1382298793.003145:2, new file mode 100644 index 00000000..7418171a --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003145:2, @@ -0,0 +1,89 @@ +From: Joe Perches <joe@perches.com> +Subject: rfc: rewrite commit subject line for subsystem maintainer + preference tool +Date: Tue, 16 Nov 2010 06:51:17 -0800 +Lines: 36 +Message-ID: <1289919077.28741.50.camel@Joe-Laptop> +References: <20101115134939.GC12986@rakim.wolfsonmicro.main> + <1289840957.16461.138.camel@Joe-Laptop> + <20101115173031.GI12986@rakim.wolfsonmicro.main> + <1289842444.16461.140.camel@Joe-Laptop> + <20101115182708.GJ12986@rakim.wolfsonmicro.main> + <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> + <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> + <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> +Mime-Version: 1.0 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 7bit +Cc: Jiri Kosina <trivial@kernel.org>, + Andrew Morton <akpm@linux-foundation.org>, + Florian Mickler <florian@mickler.org>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Mark Brown <broonie@opensource.wolfsonmicro.com> +X-From: linux-kernel-owner@vger.kernel.org Tue Nov 16 15:51:41 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PIMsn-0003tR-Ee + for glk-linux-kernel-3@lo.gmane.org; Tue, 16 Nov 2010 15:51:41 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1758690Ab0KPOvV (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 16 Nov 2010 09:51:21 -0500 +Received: from mail.perches.com ([173.55.12.10]:1433 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1755918Ab0KPOvU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Tue, 16 Nov 2010 09:51:20 -0500 +Received: from [192.168.1.162] (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 38D5C24368; + Tue, 16 Nov 2010 06:49:10 -0800 (PST) +In-Reply-To: <20101116104921.GL12986@rakim.wolfsonmicro.main> +X-Mailer: Evolution 2.30.3 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063175> + +On Tue, 2010-11-16 at 10:49 +0000, Mark Brown wrote: +> On Mon, Nov 15, 2010 at 11:52:53AM -0800, Joe Perches wrote: +> > On Mon, 2010-11-15 at 19:34 +0000, Mark Brown wrote: +> > > It appears your scripts are already hooked into get_maintainers.pl which +> > > would seem the obvious place to do this? Sadly I don't do perl, though +> > > it looks like you're doing pretty much all the work on that anyway. +> > Sadly, no it's not the right place. +> To query MAINTAINERS? I'd assume that's where you'd want to put that +> stuff? + +I trimmed cc's and added Andrew Morton and Florian Mickler. +First thread link for them: http://lkml.org/lkml/2010/11/15/262 + +I use get_maintainer to find email addresses with +"git send-email --cc-cmd=" but sure it could be extended +to find some other new information in the MAINTAINERS file. + +Anyway, I think that get_maintainers isn't the proper tool +to rewrite commit subject lines, though it could certainly +do the lookup of a key in the MAINTAINERS file. + +Maybe add a new MAINTAINERS section line something like: + "C: CommitSubjectGrammarStyle" +where CommitSubjectGrammarStyle is something more +information rich than "style 1", "style 2". + +Perhaps you'll propose a grammar to convert path to header +and go through and add these "C:" style entries to the +sections you maintain. + +Also, what would you expect the output to be when a single +patch modified files from 2 subsystems that use different +styles? + +cheers, Joe + + + diff --git a/test/corpora/lkml/cur/1382298793.003148:2, b/test/corpora/lkml/cur/1382298793.003148:2, new file mode 100644 index 00000000..bd56e87b --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003148:2, @@ -0,0 +1,92 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: rfc: rewrite commit subject line for subsystem + maintainer preference tool +Date: Tue, 16 Nov 2010 15:04:51 +0000 +Lines: 15 +Message-ID: <20101116150451.GA26239@rakim.wolfsonmicro.main> +References: <20101115173031.GI12986@rakim.wolfsonmicro.main> + <1289842444.16461.140.camel@Joe-Laptop> + <20101115182708.GJ12986@rakim.wolfsonmicro.main> + <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> + <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> + <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Florian Mickler <florian@mickler.org>, + Andrew Morton <akpm@linux-foundation.org>, + Jiri Kosina <trivial@kernel.org>, alsa-devel@alsa-project.org, + linux-kernel@vger.kernel.org +To: Joe Perches <joe@perches.com> +X-From: alsa-devel-bounces@alsa-project.org Tue Nov 16 16:05:00 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PIN5f-0004ME-Rp + for glad-alsa-devel-2@m.gmane.org; Tue, 16 Nov 2010 16:04:59 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id E869810380D; Tue, 16 Nov 2010 16:04:57 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 159A924457; + Tue, 16 Nov 2010 16:04:57 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 43E4E24458; Tue, 16 Nov 2010 16:04:55 +0100 (CET) +Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com + [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id CED8D243CD + for <alsa-devel@alsa-project.org>; Tue, 16 Nov 2010 16:04:54 +0100 (CET) +Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com + [87.246.78.27]) + by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id A251D3B445E; + Tue, 16 Nov 2010 15:04:52 +0000 (GMT) +Received: from broonie by rakim.wolfsonmicro.main with local (Exim 4.72) + (envelope-from <broonie@rakim.wolfsonmicro.main>) + id 1PIN5X-0007x2-Qm; Tue, 16 Nov 2010 15:04:51 +0000 +Content-Disposition: inline +In-Reply-To: <1289919077.28741.50.camel@Joe-Laptop> +X-Cookie: Onward through the fog. +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063178> + +On Tue, Nov 16, 2010 at 06:51:17AM -0800, Joe Perches wrote: + +> Maybe add a new MAINTAINERS section line something like: +> "C: CommitSubjectGrammarStyle" +> where CommitSubjectGrammarStyle is something more +> information rich than "style 1", "style 2". + +Something printfish would seem reasonable? + +> Also, what would you expect the output to be when a single +> patch modified files from 2 subsystems that use different +> styles? + +The traditional thing is "ThingX/ThingY: blah" but as with anything else +you need to be sensible. + + diff --git a/test/corpora/lkml/cur/1382298793.003216:2, b/test/corpora/lkml/cur/1382298793.003216:2, new file mode 100644 index 00000000..655f450b --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003216:2, @@ -0,0 +1,113 @@ +From: Florian Mickler <florian@mickler.org> +Subject: Re: rfc: rewrite commit subject line for subsystem maintainer + preference tool +Date: Tue, 16 Nov 2010 18:37:07 +0100 +Lines: 59 +Message-ID: <20101116183707.179964dd@schatten.dmk.lab> +References: <20101115134939.GC12986@rakim.wolfsonmicro.main> + <1289840957.16461.138.camel@Joe-Laptop> + <20101115173031.GI12986@rakim.wolfsonmicro.main> + <1289842444.16461.140.camel@Joe-Laptop> + <20101115182708.GJ12986@rakim.wolfsonmicro.main> + <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> + <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> + <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>, + Jiri Kosina <trivial@kernel.org>, + Andrew Morton <akpm@linux-foundation.org>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Joe Perches <joe@perches.com> +X-From: linux-kernel-owner@vger.kernel.org Tue Nov 16 18:37:57 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PIPTh-0007Ey-5Q + for glk-linux-kernel-3@lo.gmane.org; Tue, 16 Nov 2010 18:37:57 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1756054Ab0KPRhi (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 16 Nov 2010 12:37:38 -0500 +Received: from ist.d-labs.de ([213.239.218.44]:44291 "EHLO mx01.d-labs.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1754101Ab0KPRhh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Tue, 16 Nov 2010 12:37:37 -0500 +Received: from schatten.dmk.lab (f053209081.adsl.alicedsl.de [78.53.209.81]) + by mx01.d-labs.de (Postfix) with ESMTPSA id 1EB9E7FFD4; + Tue, 16 Nov 2010 18:36:55 +0100 (CET) +In-Reply-To: <1289919077.28741.50.camel@Joe-Laptop> +X-Mailer: Claws Mail 3.7.6cvs31 (GTK+ 2.20.1; x86_64-unknown-linux-gnu) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063246> + +On Tue, 16 Nov 2010 06:51:17 -0800 +Joe Perches <joe@perches.com> wrote: + +> On Tue, 2010-11-16 at 10:49 +0000, Mark Brown wrote: +> > On Mon, Nov 15, 2010 at 11:52:53AM -0800, Joe Perches wrote: +> > > On Mon, 2010-11-15 at 19:34 +0000, Mark Brown wrote: +> > > > It appears your scripts are already hooked into get_maintainers.pl which +> > > > would seem the obvious place to do this? Sadly I don't do perl, though +> > > > it looks like you're doing pretty much all the work on that anyway. +> > > Sadly, no it's not the right place. +> > To query MAINTAINERS? I'd assume that's where you'd want to put that +> > stuff? +> +> I trimmed cc's and added Andrew Morton and Florian Mickler. +> First thread link for them: http://lkml.org/lkml/2010/11/15/262 +> +> I use get_maintainer to find email addresses with +> "git send-email --cc-cmd=" but sure it could be extended +> to find some other new information in the MAINTAINERS file. +> +> Anyway, I think that get_maintainers isn't the proper tool +> to rewrite commit subject lines, though it could certainly +> do the lookup of a key in the MAINTAINERS file. +> +> Maybe add a new MAINTAINERS section line something like: +> "C: CommitSubjectGrammarStyle" +> where CommitSubjectGrammarStyle is something more +> information rich than "style 1", "style 2". +> +> Perhaps you'll propose a grammar to convert path to header +> and go through and add these "C:" style entries to the +> sections you maintain. +> +> Also, what would you expect the output to be when a single +> patch modified files from 2 subsystems that use different +> styles? +> +> cheers, Joe +> + +My first reaction to this is, it's silly. Certainly a +subsystem-maintainer is capable of hacking something together that +suits his needs or may just use a good editor to get the job done. +After all, he might want to edit the commit message anyway. Also he has +to have his act together for all non-conforming submitters anyway, +because shurely, telling people to re-edit their patches subject line +is not what one would consider "welcoming to newbies", or whatever it +is kernel subsystem maintainers have to be nowadays *g*... + +On second thought, if that facility existed, i think nobody would mind +it either. So, why not. I don't see a way to specify what to do with +cross-subsystem patches though. + +(MAINTAINERS seems to be the logical place to put this +information.) + +Regards, +Flo + + + diff --git a/test/corpora/lkml/cur/1382298793.003231:2, b/test/corpora/lkml/cur/1382298793.003231:2, new file mode 100644 index 00000000..0f4a1237 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003231:2, @@ -0,0 +1,82 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: rfc: rewrite commit subject line for subsystem maintainer + preference tool +Date: Tue, 16 Nov 2010 18:12:27 +0000 +Lines: 26 +Message-ID: <20101116181226.GB26239@rakim.wolfsonmicro.main> +References: <1289842444.16461.140.camel@Joe-Laptop> + <20101115182708.GJ12986@rakim.wolfsonmicro.main> + <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> + <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> + <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: Joe Perches <joe@perches.com>, Jiri Kosina <trivial@kernel.org>, + Andrew Morton <akpm@linux-foundation.org>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Florian Mickler <florian@mickler.org> +X-From: linux-kernel-owner@vger.kernel.org Tue Nov 16 19:12:51 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PIQ1Q-0006KJ-Uw + for glk-linux-kernel-3@lo.gmane.org; Tue, 16 Nov 2010 19:12:49 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1756467Ab0KPSMa (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 16 Nov 2010 13:12:30 -0500 +Received: from opensource.wolfsonmicro.com ([80.75.67.52]:42692 "EHLO + opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) + by vger.kernel.org with ESMTP id S1755686Ab0KPSM3 (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Tue, 16 Nov 2010 13:12:29 -0500 +Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com [87.246.78.27]) + by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id 3E8603B44D5; + Tue, 16 Nov 2010 18:12:28 +0000 (GMT) +Received: from broonie by rakim.wolfsonmicro.main with local (Exim 4.72) + (envelope-from <broonie@rakim.wolfsonmicro.main>) + id 1PIQ15-0000oJ-5s; Tue, 16 Nov 2010 18:12:27 +0000 +Content-Disposition: inline +In-Reply-To: <20101116183707.179964dd@schatten.dmk.lab> +X-Cookie: Onward through the fog. +User-Agent: Mutt/1.5.20 (2009-06-14) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063261> + +On Tue, Nov 16, 2010 at 06:37:07PM +0100, Florian Mickler wrote: + +> My first reaction to this is, it's silly. Certainly a +> subsystem-maintainer is capable of hacking something together that +> suits his needs or may just use a good editor to get the job done. +> After all, he might want to edit the commit message anyway. Also he has +> to have his act together for all non-conforming submitters anyway, +> because shurely, telling people to re-edit their patches subject line +> is not what one would consider "welcoming to newbies", or whatever it +> is kernel subsystem maintainers have to be nowadays *g*... + +So, my general policy on this is that I tend to push back on patches +which don't just work with the toolset (subject lines are just one part +of it) to a variable extent depending on who's submitting and what +they're submitting. One of the factors is that the more patches are +coming from someone the easier I expect their patches to be to work +with. + +The reason this came up is that this is one of the issues with Joe's +patches (which are rather frequent) but he is only willing to do things +that he can automate. + +> (MAINTAINERS seems to be the logical place to put this +> information.) + +Indeed. + + diff --git a/test/corpora/lkml/cur/1382298793.003278:2, b/test/corpora/lkml/cur/1382298793.003278:2, new file mode 100644 index 00000000..b3b0f0cc --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003278:2, @@ -0,0 +1,89 @@ +From: Florian Mickler <florian@mickler.org> +Subject: Re: rfc: rewrite commit subject line for subsystem maintainer + preference tool +Date: Tue, 16 Nov 2010 20:35:22 +0100 +Lines: 37 +Message-ID: <20101116203522.65240b18@schatten.dmk.lab> +References: <1289842444.16461.140.camel@Joe-Laptop> + <20101115182708.GJ12986@rakim.wolfsonmicro.main> + <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> + <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> + <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +Cc: Joe Perches <joe@perches.com>, Jiri Kosina <trivial@kernel.org>, + Andrew Morton <akpm@linux-foundation.org>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Mark Brown <broonie@opensource.wolfsonmicro.com> +X-From: linux-kernel-owner@vger.kernel.org Tue Nov 16 20:36:24 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PIRKK-0004cK-An + for glk-linux-kernel-3@lo.gmane.org; Tue, 16 Nov 2010 20:36:24 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S932105Ab0KPTfy (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 16 Nov 2010 14:35:54 -0500 +Received: from ist.d-labs.de ([213.239.218.44]:46199 "EHLO mx01.d-labs.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1756324Ab0KPTfw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Tue, 16 Nov 2010 14:35:52 -0500 +Received: from schatten.dmk.lab (f053209081.adsl.alicedsl.de [78.53.209.81]) + by mx01.d-labs.de (Postfix) with ESMTPSA id 8CEAA7FAFE; + Tue, 16 Nov 2010 20:35:09 +0100 (CET) +In-Reply-To: <20101116181226.GB26239@rakim.wolfsonmicro.main> +X-Mailer: Claws Mail 3.7.6cvs31 (GTK+ 2.20.1; x86_64-unknown-linux-gnu) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063309> + +On Tue, 16 Nov 2010 18:12:27 +0000 +Mark Brown <broonie@opensource.wolfsonmicro.com> wrote: + +> On Tue, Nov 16, 2010 at 06:37:07PM +0100, Florian Mickler wrote: +> +> > My first reaction to this is, it's silly. Certainly a +> > subsystem-maintainer is capable of hacking something together that +> > suits his needs or may just use a good editor to get the job done. +> > After all, he might want to edit the commit message anyway. Also he has +> > to have his act together for all non-conforming submitters anyway, +> > because shurely, telling people to re-edit their patches subject line +> > is not what one would consider "welcoming to newbies", or whatever it +> > is kernel subsystem maintainers have to be nowadays *g*... +> +> So, my general policy on this is that I tend to push back on patches +> which don't just work with the toolset (subject lines are just one part +> of it) to a variable extent depending on who's submitting and what +> they're submitting. One of the factors is that the more patches are +> coming from someone the easier I expect their patches to be to work +> with. +> +> The reason this came up is that this is one of the issues with Joe's +> patches (which are rather frequent) but he is only willing to do things +> that he can automate. + +Hehe, I know that I wouldn't want to hand edit every autogenerated patch +people throw at me... What about just dropping everything before the +last "]" or ":" and putting an autogenerated prefix before it in a +pre-commit hook on your side? + +That should work most of the time... don't know... maybe other +subsystem maintainers have some more suggestions on reducing the +workload... this could even be an interesting topic for some summit... + +Regards, +Flo + + + diff --git a/test/corpora/lkml/cur/1382298793.003295:2, b/test/corpora/lkml/cur/1382298793.003295:2, new file mode 100644 index 00000000..802eca72 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003295:2, @@ -0,0 +1,92 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: rfc: rewrite commit subject line for subsystem + maintainer preference tool +Date: Tue, 16 Nov 2010 19:55:31 +0000 +Lines: 16 +Message-ID: <20101116195530.GA7523@rakim.wolfsonmicro.main> +References: <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> + <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> + <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Joe Perches <joe@perches.com>, Andrew Morton <akpm@linux-foundation.org>, + Jiri Kosina <trivial@kernel.org>, alsa-devel@alsa-project.org, + linux-kernel@vger.kernel.org +To: Florian Mickler <florian@mickler.org> +X-From: alsa-devel-bounces@alsa-project.org Tue Nov 16 20:55:48 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PIRd2-0000Zr-GV + for glad-alsa-devel-2@m.gmane.org; Tue, 16 Nov 2010 20:55:44 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 02BEA2417E; Tue, 16 Nov 2010 20:55:36 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 8AFD424159; + Tue, 16 Nov 2010 20:55:35 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 32ADC24179; Tue, 16 Nov 2010 20:55:34 +0100 (CET) +Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com + [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 913CA24158 + for <alsa-devel@alsa-project.org>; Tue, 16 Nov 2010 20:55:33 +0100 (CET) +Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com + [87.246.78.27]) + by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id C4CDE3B4538; + Tue, 16 Nov 2010 19:55:31 +0000 (GMT) +Received: from broonie by rakim.wolfsonmicro.main with local (Exim 4.72) + (envelope-from <broonie@rakim.wolfsonmicro.main>) + id 1PIRcp-0004nx-60; Tue, 16 Nov 2010 19:55:31 +0000 +Content-Disposition: inline +In-Reply-To: <20101116203522.65240b18@schatten.dmk.lab> +X-Cookie: Killing turkeys causes winter. +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063326> + +On Tue, Nov 16, 2010 at 08:35:22PM +0100, Florian Mickler wrote: + +> Hehe, I know that I wouldn't want to hand edit every autogenerated patch +> people throw at me... What about just dropping everything before the +> last "]" or ":" and putting an autogenerated prefix before it in a +> pre-commit hook on your side? + +> That should work most of the time... don't know... maybe other + +It's the most of the time bit that worries me, I'm generally reluctant +to script things like this when the scripts aren't very widely used and +it's a pain to get hooks distributed over all my systems and working for +all the things I need to apply patches for. + +From my point of view my current approach is actually working pretty +well with most submitters, even people doing similar janitorial stuff. + + diff --git a/test/corpora/lkml/cur/1382298793.003316:2, b/test/corpora/lkml/cur/1382298793.003316:2, new file mode 100644 index 00000000..7b09d35c --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003316:2, @@ -0,0 +1,105 @@ +From: Randy Dunlap <rdunlap@xenotime.net> +Subject: Re: rfc: rewrite commit subject line for subsystem + maintainer preference tool +Date: Tue, 16 Nov 2010 12:21:02 -0800 +Organization: YPO4 +Lines: 34 +Message-ID: <20101116122102.86e7e0b9.rdunlap@xenotime.net> +References: <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> + <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> + <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + linux-kernel@vger.kernel.org, Florian Mickler <florian@mickler.org>, + Joe Perches <joe@perches.com>, Andrew Morton <akpm@linux-foundation.org> +To: Mark Brown <broonie@opensource.wolfsonmicro.com> +X-From: alsa-devel-bounces@alsa-project.org Tue Nov 16 21:21:20 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PIS1m-0001Kj-Rd + for glad-alsa-devel-2@m.gmane.org; Tue, 16 Nov 2010 21:21:18 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 2FC2024371; Tue, 16 Nov 2010 21:21:18 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id ACBEB24368; + Tue, 16 Nov 2010 21:21:16 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 6AFBB24369; Tue, 16 Nov 2010 21:21:15 +0100 (CET) +Received: from xenotime.net (xenotime.net [72.52.115.56]) + by alsa0.perex.cz (Postfix) with SMTP id 6FDFD24363 + for <alsa-devel@alsa-project.org>; Tue, 16 Nov 2010 21:21:14 +0100 (CET) +Received: from chimera.site ([173.50.240.230]) by xenotime.net for + <alsa-devel@alsa-project.org>; Tue, 16 Nov 2010 12:21:06 -0800 +In-Reply-To: <20101116195530.GA7523@rakim.wolfsonmicro.main> +X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; x86_64-unknown-linux-gnu) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063347> + +On Tue, 16 Nov 2010 19:55:31 +0000 Mark Brown wrote: + +> On Tue, Nov 16, 2010 at 08:35:22PM +0100, Florian Mickler wrote: +> +> > Hehe, I know that I wouldn't want to hand edit every autogenerated patch +> > people throw at me... What about just dropping everything before the +> > last "]" or ":" and putting an autogenerated prefix before it in a +> > pre-commit hook on your side? +> +> > That should work most of the time... don't know... maybe other +> +> It's the most of the time bit that worries me, I'm generally reluctant +> to script things like this when the scripts aren't very widely used and +> it's a pain to get hooks distributed over all my systems and working for +> all the things I need to apply patches for. +> +> From my point of view my current approach is actually working pretty +> well with most submitters, even people doing similar janitorial stuff. + +I don't know what you asked Joe to change, but asking someone to use +the documented canonical patch format: + +<quote> +The canonical patch subject line is: + + Subject: [PATCH 001/123] subsystem: summary phrase +</quote> + +should be fine. And there is no need for printf-ish templates +for this in MAINTAINERS either. + +--- +~Randy +*** Remember to use Documentation/SubmitChecklist when testing your code *** + + diff --git a/test/corpora/lkml/cur/1382298793.003334:2, b/test/corpora/lkml/cur/1382298793.003334:2, new file mode 100644 index 00000000..9a58840c --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003334:2, @@ -0,0 +1,106 @@ +From: Joe Perches <joe@perches.com> +Subject: Re: rfc: rewrite commit subject line for subsystem maintainer + preference tool +Date: Tue, 16 Nov 2010 12:42:36 -0800 +Lines: 51 +Message-ID: <1289940156.28741.207.camel@Joe-Laptop> +References: <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> + <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> + <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 7bit +Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>, + Florian Mickler <florian@mickler.org>, + Jiri Kosina <trivial@kernel.org>, + Andrew Morton <akpm@linux-foundation.org>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Randy Dunlap <rdunlap@xenotime.net> +X-From: linux-kernel-owner@vger.kernel.org Tue Nov 16 21:43:01 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PISMm-00074k-9X + for glk-linux-kernel-3@lo.gmane.org; Tue, 16 Nov 2010 21:43:00 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1757174Ab0KPUmj (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 16 Nov 2010 15:42:39 -0500 +Received: from mail.perches.com ([173.55.12.10]:1476 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1754409Ab0KPUmi (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Tue, 16 Nov 2010 15:42:38 -0500 +Received: from [192.168.1.162] (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 17CC824368; + Tue, 16 Nov 2010 12:40:23 -0800 (PST) +In-Reply-To: <20101116122102.86e7e0b9.rdunlap@xenotime.net> +X-Mailer: Evolution 2.30.3 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063365> + +On Tue, 2010-11-16 at 12:21 -0800, Randy Dunlap wrote: +> On Tue, 16 Nov 2010 19:55:31 +0000 Mark Brown wrote: +> I don't know what you asked Joe to change, but asking someone to use +> the documented canonical patch format: +> <quote> +> The canonical patch subject line is: +> Subject: [PATCH 001/123] subsystem: summary phrase +> </quote> +> should be fine. And there is no need for printf-ish templates +> for this in MAINTAINERS either. + +I've never read that before. Learn something new etc... +It seems path prefixes aren't good nor even commonly used. + +A review of kernel patch subjects: + +$ git log --no-merges --pretty=oneline | \ + cut -f2- -d" " | cut -f1 -d: | sort | uniq -c | sort -rn + +is interesting. Here's the head: + 5007 x86 + 3943 Staging + 3220 USB + 2790 sh + 2707 KVM + 2624 ARM + 2449 ALSA + 1571 Input + 1549 ASoC + 1470 iwlwifi + 1423 ACPI + 1397 mac80211 + 1384 V4L/DVB + 1226 sched + 1200 Btrfs + 1184 powerpc + 1106 [NETFILTER] + 1080 MIPS + 1049 net + 1047 ide + 1014 drm/i915 + 993 staging + 921 ath9k + +Some subsystem maintainers like upper case, some mixed, some lower. +Some aren't consistent. (Staging/staging) + +It doesn't seem a rule can be pregenerated so maybe adding these +"C:" lines to MAINTAINERS has some value. + + + + diff --git a/test/corpora/lkml/cur/1382298793.003340:2, b/test/corpora/lkml/cur/1382298793.003340:2, new file mode 100644 index 00000000..ff520cb9 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003340:2, @@ -0,0 +1,138 @@ +From: Randy Dunlap <rdunlap@xenotime.net> +Subject: Re: rfc: rewrite commit subject line for subsystem + maintainer preference tool +Date: Tue, 16 Nov 2010 12:46:09 -0800 +Organization: YPO4 +Lines: 64 +Message-ID: <20101116124609.382e42fb.rdunlap@xenotime.net> +References: <1289845830.16461.149.camel@Joe-Laptop> + <20101115190738.GF3338@sirena.org.uk> + <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> + <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> + <1289940156.28741.207.camel@Joe-Laptop> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + Mark Brown <broonie@opensource.wolfsonmicro.com>, + linux-kernel@vger.kernel.org, Florian Mickler <florian@mickler.org>, + Andrew Morton <akpm@linux-foundation.org> +To: Joe Perches <joe@perches.com> +X-From: alsa-devel-bounces@alsa-project.org Tue Nov 16 21:46:23 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PISQ1-0000rd-2s + for glad-alsa-devel-2@m.gmane.org; Tue, 16 Nov 2010 21:46:21 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 5421B2438C; Tue, 16 Nov 2010 21:46:20 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: * +X-Spam-Status: No, score=1.0 required=5.0 tests=PRX_BODY_29 autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 774FE24390; + Tue, 16 Nov 2010 21:46:19 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 6051924391; Tue, 16 Nov 2010 21:46:17 +0100 (CET) +Received: from xenotime.net (xenotime.net [72.52.115.56]) + by alsa0.perex.cz (Postfix) with SMTP id 4F17D2438C + for <alsa-devel@alsa-project.org>; Tue, 16 Nov 2010 21:46:15 +0100 (CET) +Received: from chimera.site ([173.50.240.230]) by xenotime.net for + <alsa-devel@alsa-project.org>; Tue, 16 Nov 2010 12:46:10 -0800 +In-Reply-To: <1289940156.28741.207.camel@Joe-Laptop> +X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; x86_64-unknown-linux-gnu) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063371> + +On Tue, 16 Nov 2010 12:42:36 -0800 Joe Perches wrote: + +> On Tue, 2010-11-16 at 12:21 -0800, Randy Dunlap wrote: +> > On Tue, 16 Nov 2010 19:55:31 +0000 Mark Brown wrote: +> > I don't know what you asked Joe to change, but asking someone to use +> > the documented canonical patch format: +> > <quote> +> > The canonical patch subject line is: +> > Subject: [PATCH 001/123] subsystem: summary phrase +> > </quote> +> > should be fine. And there is no need for printf-ish templates +> > for this in MAINTAINERS either. +> +> I've never read that before. Learn something new etc... +> It seems path prefixes aren't good nor even commonly used. +> +> A review of kernel patch subjects: +> +> $ git log --no-merges --pretty=oneline | \ +> cut -f2- -d" " | cut -f1 -d: | sort | uniq -c | sort -rn +> +> is interesting. Here's the head: +> 5007 x86 +> 3943 Staging +> 3220 USB +> 2790 sh +> 2707 KVM +> 2624 ARM +> 2449 ALSA +> 1571 Input +> 1549 ASoC +> 1470 iwlwifi +> 1423 ACPI +> 1397 mac80211 +> 1384 V4L/DVB +> 1226 sched +> 1200 Btrfs +> 1184 powerpc +> 1106 [NETFILTER] +> 1080 MIPS +> 1049 net +> 1047 ide +> 1014 drm/i915 +> 993 staging +> 921 ath9k + +$ARCH is a commonly accepted substitute for subsystem. + +And yes, lots of people use <drivername> there as well. + + +> Some subsystem maintainers like upper case, some mixed, some lower. +> Some aren't consistent. (Staging/staging) + +Case usually doesn't matter to most of us. + +> It doesn't seem a rule can be pregenerated so maybe adding these +> "C:" lines to MAINTAINERS has some value. + +Hopefully it won't go that far. + +--- +~Randy +*** Remember to use Documentation/SubmitChecklist when testing your code *** + + diff --git a/test/corpora/lkml/cur/1382298793.003448:2, b/test/corpora/lkml/cur/1382298793.003448:2, new file mode 100644 index 00000000..d9ecd6a3 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003448:2, @@ -0,0 +1,100 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: rfc: rewrite commit subject line for subsystem + maintainer preference tool +Date: Tue, 16 Nov 2010 23:01:26 +0000 +Lines: 24 +Message-ID: <20101116230126.GB24623@opensource.wolfsonmicro.com> +References: <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> + <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + linux-kernel@vger.kernel.org, Florian Mickler <florian@mickler.org>, + Joe Perches <joe@perches.com>, Andrew Morton <akpm@linux-foundation.org> +To: Randy Dunlap <rdunlap@xenotime.net> +X-From: alsa-devel-bounces@alsa-project.org Wed Nov 17 00:01:43 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PIUWr-0004yP-6J + for glad-alsa-devel-2@m.gmane.org; Wed, 17 Nov 2010 00:01:33 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id A434B103882; Wed, 17 Nov 2010 00:01:26 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 9B9A81037FB; + Wed, 17 Nov 2010 00:01:23 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 47D7B1037FB; Wed, 17 Nov 2010 00:01:22 +0100 (CET) +Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com + [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id F24201037E3 + for <alsa-devel@alsa-project.org>; Wed, 17 Nov 2010 00:01:20 +0100 (CET) +Received: from finisterre.wolfsonmicro.main + (cpc3-sgyl4-0-0-cust125.sgyl.cable.virginmedia.com [82.41.240.126]) + by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id F2D407881C9; + Tue, 16 Nov 2010 23:01:18 +0000 (GMT) +Received: from broonie by finisterre.wolfsonmicro.main with local (Exim 4.72) + (envelope-from <broonie@opensource.wolfsonmicro.com>) + id 1PIUWk-0007m9-B8; Tue, 16 Nov 2010 23:01:26 +0000 +Content-Disposition: inline +In-Reply-To: <20101116122102.86e7e0b9.rdunlap@xenotime.net> +X-Cookie: Beware of Bigfoot! +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063481> + +On Tue, Nov 16, 2010 at 12:21:02PM -0800, Randy Dunlap wrote: + +> I don't know what you asked Joe to change, but asking someone to use +> the documented canonical patch format: + +> <quote> +> The canonical patch subject line is: + +> Subject: [PATCH 001/123] subsystem: summary phrase +> </quote> + +> should be fine. And there is no need for printf-ish templates +> for this in MAINTAINERS either. + +That's exactly what I asked him to do. He said he's not willing to use +anything for "subsystem" which can't be automatically generated. + +The formats I mentioned because some subsystems have their own things +within this format like "subsystem: driver:" or whatever. While it's +probably not an issue for the sort of patch Joe generates if we do have +a tool for this I'd expect it'll go the same way that checkpatch does +and get used by people doing more specific work. It'd be good to try to +head off the friction that may cause by at least having an idea how we +might cope with that. + + diff --git a/test/corpora/lkml/cur/1382298793.003459:2, b/test/corpora/lkml/cur/1382298793.003459:2, new file mode 100644 index 00000000..8fddae82 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003459:2, @@ -0,0 +1,88 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: rfc: rewrite commit subject line for subsystem + maintainer preference tool +Date: Tue, 16 Nov 2010 23:22:58 +0000 +Lines: 12 +Message-ID: <20101116232258.GC24623@opensource.wolfsonmicro.com> +References: <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> + <1289940156.28741.207.camel@Joe-Laptop> + <20101116124609.382e42fb.rdunlap@xenotime.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + linux-kernel@vger.kernel.org, Florian Mickler <florian@mickler.org>, + Joe Perches <joe@perches.com>, Andrew Morton <akpm@linux-foundation.org> +To: Randy Dunlap <rdunlap@xenotime.net> +X-From: alsa-devel-bounces@alsa-project.org Wed Nov 17 00:22:58 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PIUrZ-0001Km-F5 + for glad-alsa-devel-2@m.gmane.org; Wed, 17 Nov 2010 00:22:57 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 28F9610381A; Wed, 17 Nov 2010 00:22:55 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 1CC8D10381B; + Wed, 17 Nov 2010 00:22:55 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id B1B8B10381B; Wed, 17 Nov 2010 00:22:52 +0100 (CET) +Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com + [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id CB03810381A + for <alsa-devel@alsa-project.org>; Wed, 17 Nov 2010 00:22:51 +0100 (CET) +Received: from finisterre.wolfsonmicro.main + (cpc3-sgyl4-0-0-cust125.sgyl.cable.virginmedia.com [82.41.240.126]) + by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id 39A957881C9; + Tue, 16 Nov 2010 23:22:51 +0000 (GMT) +Received: from broonie by finisterre.wolfsonmicro.main with local (Exim 4.72) + (envelope-from <broonie@opensource.wolfsonmicro.com>) + id 1PIUra-0001BL-NS; Tue, 16 Nov 2010 23:22:58 +0000 +Content-Disposition: inline +In-Reply-To: <20101116124609.382e42fb.rdunlap@xenotime.net> +X-Cookie: Beware of Bigfoot! +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063492> + +On Tue, Nov 16, 2010 at 12:46:09PM -0800, Randy Dunlap wrote: +> On Tue, 16 Nov 2010 12:42:36 -0800 Joe Perches wrote: + +> > Some subsystem maintainers like upper case, some mixed, some lower. +> > Some aren't consistent. (Staging/staging) + +> Case usually doesn't matter to most of us. + +Given that we're working in case sensitive languages here it's probably +safe to assume that a reasonable proportion of people will care; being +reasonably consistent with existing practice for the subsystem seems +sensible. + + diff --git a/test/corpora/lkml/cur/1382298793.003462:2, b/test/corpora/lkml/cur/1382298793.003462:2, new file mode 100644 index 00000000..4f6ba5ae --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003462:2, @@ -0,0 +1,97 @@ +From: Randy Dunlap <rdunlap@xenotime.net> +Subject: Re: rfc: rewrite commit subject line for subsystem + maintainer preference tool +Date: Tue, 16 Nov 2010 15:28:35 -0800 +Organization: YPO4 +Lines: 26 +Message-ID: <20101116152835.b0ab571c.rdunlap@xenotime.net> +References: <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> + <1289940156.28741.207.camel@Joe-Laptop> + <20101116124609.382e42fb.rdunlap@xenotime.net> + <20101116232258.GC24623@opensource.wolfsonmicro.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + linux-kernel@vger.kernel.org, Florian Mickler <florian@mickler.org>, + Joe Perches <joe@perches.com>, Andrew Morton <akpm@linux-foundation.org> +To: Mark Brown <broonie@opensource.wolfsonmicro.com> +X-From: alsa-devel-bounces@alsa-project.org Wed Nov 17 00:29:00 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PIUxP-0004iI-Hq + for glad-alsa-devel-2@m.gmane.org; Wed, 17 Nov 2010 00:28:59 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id AD65410388C; Wed, 17 Nov 2010 00:28:58 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 21296103822; + Wed, 17 Nov 2010 00:28:57 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 58AE7103822; Wed, 17 Nov 2010 00:28:54 +0100 (CET) +Received: from xenotime.net (xenotime.net [72.52.115.56]) + by alsa0.perex.cz (Postfix) with SMTP id 1947B10381B + for <alsa-devel@alsa-project.org>; Wed, 17 Nov 2010 00:28:52 +0100 (CET) +Received: from chimera.site ([173.50.240.230]) by xenotime.net for + <alsa-devel@alsa-project.org>; Tue, 16 Nov 2010 15:28:36 -0800 +In-Reply-To: <20101116232258.GC24623@opensource.wolfsonmicro.com> +X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; x86_64-unknown-linux-gnu) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063495> + +On Tue, 16 Nov 2010 23:22:58 +0000 Mark Brown wrote: + +> On Tue, Nov 16, 2010 at 12:46:09PM -0800, Randy Dunlap wrote: +> > On Tue, 16 Nov 2010 12:42:36 -0800 Joe Perches wrote: +> +> > > Some subsystem maintainers like upper case, some mixed, some lower. +> > > Some aren't consistent. (Staging/staging) +> +> > Case usually doesn't matter to most of us. +> +> Given that we're working in case sensitive languages here it's probably +> safe to assume that a reasonable proportion of people will care; being +> reasonably consistent with existing practice for the subsystem seems +> sensible. + +Greg takes patches that say STAGING or Staging or staging. + +DaveM takes patches that say net: or netdev: or network: or NET: + +The sound maintainers take patches that say sound: or alsa: or ALSA: + +etc. + +--- +~Randy +*** Remember to use Documentation/SubmitChecklist when testing your code *** + + diff --git a/test/corpora/lkml/cur/1382298793.003468:2, b/test/corpora/lkml/cur/1382298793.003468:2, new file mode 100644 index 00000000..a26128d3 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003468:2, @@ -0,0 +1,99 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: rfc: rewrite commit subject line for subsystem + maintainer preference tool +Date: Tue, 16 Nov 2010 23:50:26 +0000 +Lines: 23 +Message-ID: <20101116235025.GA7256@opensource.wolfsonmicro.com> +References: <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> + <1289940156.28741.207.camel@Joe-Laptop> + <20101116124609.382e42fb.rdunlap@xenotime.net> + <20101116232258.GC24623@opensource.wolfsonmicro.com> + <20101116152835.b0ab571c.rdunlap@xenotime.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + linux-kernel@vger.kernel.org, Florian Mickler <florian@mickler.org>, + Joe Perches <joe@perches.com>, Andrew Morton <akpm@linux-foundation.org> +To: Randy Dunlap <rdunlap@xenotime.net> +X-From: alsa-devel-bounces@alsa-project.org Wed Nov 17 00:50:24 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PIVI7-00006s-O3 + for glad-alsa-devel-2@m.gmane.org; Wed, 17 Nov 2010 00:50:23 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id F007910388B; Wed, 17 Nov 2010 00:50:22 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 9E0B9103822; + Wed, 17 Nov 2010 00:50:21 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id AD918103822; Wed, 17 Nov 2010 00:50:19 +0100 (CET) +Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com + [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 39C5A10381B + for <alsa-devel@alsa-project.org>; Wed, 17 Nov 2010 00:50:19 +0100 (CET) +Received: from finisterre.wolfsonmicro.main + (cpc3-sgyl4-0-0-cust125.sgyl.cable.virginmedia.com [82.41.240.126]) + by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id B19503B4628; + Tue, 16 Nov 2010 23:50:18 +0000 (GMT) +Received: from broonie by finisterre.wolfsonmicro.main with local (Exim 4.72) + (envelope-from <broonie@opensource.wolfsonmicro.com>) + id 1PIVIA-0003UP-7d; Tue, 16 Nov 2010 23:50:26 +0000 +Content-Disposition: inline +In-Reply-To: <20101116152835.b0ab571c.rdunlap@xenotime.net> +X-Cookie: You enjoy the company of other people. +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063501> + +On Tue, Nov 16, 2010 at 03:28:35PM -0800, Randy Dunlap wrote: +> On Tue, 16 Nov 2010 23:22:58 +0000 Mark Brown wrote: +> > On Tue, Nov 16, 2010 at 12:46:09PM -0800, Randy Dunlap wrote: + +> > > Case usually doesn't matter to most of us. + +> > Given that we're working in case sensitive languages here it's probably +> > safe to assume that a reasonable proportion of people will care; being +> > reasonably consistent with existing practice for the subsystem seems +> > sensible. + +> Greg takes patches that say STAGING or Staging or staging. + +> DaveM takes patches that say net: or netdev: or network: or NET: + +> The sound maintainers take patches that say sound: or alsa: or ALSA: + +> etc. + +...and best practice would be to pay attention to what the standard +thing is for the subsystem and follow that. We shouldn't be suggesting +that people just ignore the case, though obviously if it's not clear +then it's not worth worrying too much about it. + + diff --git a/test/corpora/lkml/cur/1382298793.003471:2, b/test/corpora/lkml/cur/1382298793.003471:2, new file mode 100644 index 00000000..1e1fc4a8 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003471:2, @@ -0,0 +1,79 @@ +From: Joe Perches <joe@perches.com> +Subject: Re: rfc: rewrite commit subject line for subsystem maintainer + preference tool +Date: Tue, 16 Nov 2010 15:57:57 -0800 +Lines: 25 +Message-ID: <1289951877.28741.262.camel@Joe-Laptop> +References: <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> + <1289940156.28741.207.camel@Joe-Laptop> + <20101116124609.382e42fb.rdunlap@xenotime.net> + <20101116232258.GC24623@opensource.wolfsonmicro.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 7bit +Cc: Randy Dunlap <rdunlap@xenotime.net>, + Florian Mickler <florian@mickler.org>, + Jiri Kosina <trivial@kernel.org>, + Andrew Morton <akpm@linux-foundation.org>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Mark Brown <broonie@opensource.wolfsonmicro.com> +X-From: linux-kernel-owner@vger.kernel.org Wed Nov 17 00:58:25 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PIVPr-0004pn-RQ + for glk-linux-kernel-3@lo.gmane.org; Wed, 17 Nov 2010 00:58:24 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1757881Ab0KPX6A (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 16 Nov 2010 18:58:00 -0500 +Received: from mail.perches.com ([173.55.12.10]:1493 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1757143Ab0KPX57 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Tue, 16 Nov 2010 18:57:59 -0500 +Received: from [192.168.1.162] (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id B87C82436B; + Tue, 16 Nov 2010 15:55:40 -0800 (PST) +In-Reply-To: <20101116232258.GC24623@opensource.wolfsonmicro.com> +X-Mailer: Evolution 2.30.3 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063504> + +On Tue, 2010-11-16 at 23:22 +0000, Mark Brown wrote: +> On Tue, Nov 16, 2010 at 12:46:09PM -0800, Randy Dunlap wrote: +> > On Tue, 16 Nov 2010 12:42:36 -0800 Joe Perches wrote: +> > > Some subsystem maintainers like upper case, some mixed, some lower. +> > > Some aren't consistent. (Staging/staging) +> > Case usually doesn't matter to most of us. +> Given that we're working in case sensitive languages here it's probably +> safe to assume that a reasonable proportion of people will care; being +> reasonably consistent with existing practice for the subsystem seems +> sensible. + +Presumably the tool would also have to traverse up the tree +to find the appropriate style so every MAINTAINERS section +would not need a C entry. + +ie: sound/soc/codecs/foo could use the C: entry for sound/soc/ + +Perhaps something like: + C: ASoC basename: + +and for arch/x86/: + C: x86, dirname: + +etc. + + + diff --git a/test/corpora/lkml/cur/1382298793.003472:2, b/test/corpora/lkml/cur/1382298793.003472:2, new file mode 100644 index 00000000..0e360fd9 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003472:2, @@ -0,0 +1,84 @@ +From: Joe Perches <joe@perches.com> +Subject: Re: rfc: rewrite commit subject line for subsystem maintainer + preference tool +Date: Tue, 16 Nov 2010 15:57:55 -0800 +Lines: 29 +Message-ID: <1289951875.28741.261.camel@Joe-Laptop> +References: <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> + <1289940156.28741.207.camel@Joe-Laptop> + <20101116124609.382e42fb.rdunlap@xenotime.net> + <20101116232258.GC24623@opensource.wolfsonmicro.com> + <20101116152835.b0ab571c.rdunlap@xenotime.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 7bit +Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>, + Florian Mickler <florian@mickler.org>, + Jiri Kosina <trivial@kernel.org>, + Andrew Morton <akpm@linux-foundation.org>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Randy Dunlap <rdunlap@xenotime.net> +X-From: linux-kernel-owner@vger.kernel.org Wed Nov 17 00:58:26 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PIVPr-0004pn-AW + for glk-linux-kernel-3@lo.gmane.org; Wed, 17 Nov 2010 00:58:23 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1757099Ab0KPX56 (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 16 Nov 2010 18:57:58 -0500 +Received: from mail.perches.com ([173.55.12.10]:1485 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751238Ab0KPX55 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Tue, 16 Nov 2010 18:57:57 -0500 +Received: from [192.168.1.162] (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 18B3A24368; + Tue, 16 Nov 2010 15:55:38 -0800 (PST) +In-Reply-To: <20101116152835.b0ab571c.rdunlap@xenotime.net> +X-Mailer: Evolution 2.30.3 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063505> + +On Tue, 2010-11-16 at 15:28 -0800, Randy Dunlap wrote: +> On Tue, 16 Nov 2010 23:22:58 +0000 Mark Brown wrote: +> > On Tue, Nov 16, 2010 at 12:46:09PM -0800, Randy Dunlap wrote: +> > > On Tue, 16 Nov 2010 12:42:36 -0800 Joe Perches wrote: +> > > > Some subsystem maintainers like upper case, some mixed, some lower. +> > > > Some aren't consistent. (Staging/staging) +> > > Case usually doesn't matter to most of us. +> > Given that we're working in case sensitive languages here it's probably +> > safe to assume that a reasonable proportion of people will care; being +> > reasonably consistent with existing practice for the subsystem seems +> > sensible. +> Greg takes patches that say STAGING or Staging or staging. + +Greg seems to rewrite patch subjects and is inconsistent +about case, so he might be doing that by hand. + +> DaveM takes patches that say net: or netdev: or network: or NET: + +DaveM doesn't appear to be choosy about patch subject lines. +He seems to take any sensible patch and as far as I know he +doesn't edit the subject lines. He does reject inferior +patches outright. + +> The sound maintainers take patches that say sound: or alsa: or ALSA: + +The sound maintainers seem to rewrite patch subjects on an +ad-hoc basis. + + + + diff --git a/test/corpora/lkml/cur/1382298793.003478:2, b/test/corpora/lkml/cur/1382298793.003478:2, new file mode 100644 index 00000000..c95e3f86 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003478:2, @@ -0,0 +1,113 @@ +From: Joel Becker <Joel.Becker@oracle.com> +Subject: Re: [PATCH 36/44] fs/ocfs2: Remove unnecessary + semicolons +Date: Tue, 16 Nov 2010 16:10:47 -0800 +Lines: 38 +Message-ID: <20101117001046.GE10237@mail.oracle.com> +References: <cover.1289789604.git.joe@perches.com> + <e32409b17aaa1a54fec85f3654583ef08fcf851c.1289789605.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Mark Fasheh <mfasheh@suse.com>, Jiri Kosina <trivial@kernel.org>, + linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com +To: Joe Perches <joe@perches.com> +X-From: ocfs2-devel-bounces@oss.oracle.com Wed Nov 17 01:11:36 2010 +Return-path: <ocfs2-devel-bounces@oss.oracle.com> +Envelope-to: gcfod-ocfs2-devel@gmane.org +Received: from rcsinet10.oracle.com ([148.87.113.121]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <ocfs2-devel-bounces@oss.oracle.com>) + id 1PIVcY-0003qc-VC + for gcfod-ocfs2-devel@gmane.org; Wed, 17 Nov 2010 01:11:31 +0100 +Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) + by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id oAH0B96Y007820 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Wed, 17 Nov 2010 00:11:10 GMT +Received: from oss.oracle.com (oss.oracle.com [141.146.12.120]) + by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id oAH0B6rM032434 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Wed, 17 Nov 2010 00:11:07 GMT +Received: from localhost ([127.0.0.1] helo=oss.oracle.com) + by oss.oracle.com with esmtp (Exim 4.63) + (envelope-from <ocfs2-devel-bounces@oss.oracle.com>) + id 1PIVcA-0001bs-K0; Tue, 16 Nov 2010 16:11:06 -0800 +Received: from rcsinet15.oracle.com ([148.87.113.117]) + by oss.oracle.com with esmtp (Exim 4.63) + (envelope-from <joel.becker@oracle.com>) id 1PIVc7-0001bl-Td + for ocfs2-devel@oss.oracle.com; Tue, 16 Nov 2010 16:11:04 -0800 +Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) + by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id + oAH0B1gV032165; Wed, 17 Nov 2010 00:11:01 GMT +Received: from ca-server1.us.oracle.com by acsmt353.oracle.com + with ESMTP id 784380701289952654; Tue, 16 Nov 2010 16:10:54 -0800 +Received: from jlbec by ca-server1.us.oracle.com with local (Exim 4.69) + (envelope-from <joel.becker@oracle.com>) + id 1PIVbx-0007gG-4G; Tue, 16 Nov 2010 16:10:53 -0800 +Mail-Followup-To: Joe Perches <joe@perches.com>, + Jiri Kosina <trivial@kernel.org>, Mark Fasheh <mfasheh@suse.com>, + ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org +Content-Disposition: inline +In-Reply-To: <e32409b17aaa1a54fec85f3654583ef08fcf851c.1289789605.git.joe@perches.com> +X-Burt-Line: Trees are cool. +X-Red-Smith: Ninety feet between bases is perhaps as close as man has ever + come to perfection. +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: ocfs2-devel@oss.oracle.com +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: <ocfs2-devel.oss.oracle.com> +List-Unsubscribe: <http://oss.oracle.com/mailman/listinfo/ocfs2-devel>, + <mailto:ocfs2-devel-request@oss.oracle.com?subject=unsubscribe> +List-Archive: <http://oss.oracle.com/pipermail/ocfs2-devel> +List-Post: <mailto:ocfs2-devel@oss.oracle.com> +List-Help: <mailto:ocfs2-devel-request@oss.oracle.com?subject=help> +List-Subscribe: <http://oss.oracle.com/mailman/listinfo/ocfs2-devel>, + <mailto:ocfs2-devel-request@oss.oracle.com?subject=subscribe> +Sender: ocfs2-devel-bounces@oss.oracle.com +Errors-To: ocfs2-devel-bounces@oss.oracle.com +X-Source-IP: oss.oracle.com [141.146.12.120] +X-Auth-Type: Internal IP +X-CT-RefId: str=0001.0A090207.4CE31D9C.007A:SCFSTAT3865452,ss=1,fgs=0 +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063511> + +On Sun, Nov 14, 2010 at 07:04:55PM -0800, Joe Perches wrote: +> Signed-off-by: Joe Perches <joe@perches.com> + +Acked-by: Joel Becker <joel.becker@oracle.com> + + +> --- +> fs/ocfs2/refcounttree.c | 2 +- +> 1 files changed, 1 insertions(+), 1 deletions(-) +> +> diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c +> index b5f9160..da14a42 100644 +> --- a/fs/ocfs2/refcounttree.c +> +++ b/fs/ocfs2/refcounttree.c +> @@ -3704,7 +3704,7 @@ int ocfs2_refcount_cow_xattr(struct inode *inode, +> context->cow_start = cow_start; +> context->cow_len = cow_len; +> context->ref_tree = ref_tree; +> - context->ref_root_bh = ref_root_bh;; +> + context->ref_root_bh = ref_root_bh; +> context->cow_object = xv; +> +> context->cow_duplicate_clusters = ocfs2_duplicate_clusters_by_jbd; +> -- +> 1.7.3.1.g432b3.dirty +> + +-- + +Life's Little Instruction Book #237 + + "Seek out the good in people." + +Joel Becker +Senior Development Manager +Oracle +E-mail: joel.becker@oracle.com +Phone: (650) 506-8127 + + diff --git a/test/corpora/lkml/cur/1382298793.003497:2, b/test/corpora/lkml/cur/1382298793.003497:2, new file mode 100644 index 00000000..ab478861 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003497:2, @@ -0,0 +1,94 @@ +From: Stefan Richter <stefanr@s5r6.in-berlin.de> +Subject: Re: rfc: rewrite commit subject line for subsystem maintainer + preference tool +Date: Wed, 17 Nov 2010 01:44:27 +0100 +Lines: 34 +Message-ID: <20101117014427.41d85b13@stein> +References: <1289848458.16461.150.camel@Joe-Laptop> + <20101115193407.GK12986@rakim.wolfsonmicro.main> + <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> + <20101116230126.GB24623@opensource.wolfsonmicro.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +Cc: Randy Dunlap <rdunlap@xenotime.net>, + Florian Mickler <florian@mickler.org>, + Joe Perches <joe@perches.com>, + Jiri Kosina <trivial@kernel.org>, + Andrew Morton <akpm@linux-foundation.org>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Mark Brown <broonie@opensource.wolfsonmicro.com> +X-From: linux-kernel-owner@vger.kernel.org Wed Nov 17 01:45:44 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PIW9d-0005et-Ft + for glk-linux-kernel-3@lo.gmane.org; Wed, 17 Nov 2010 01:45:41 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933190Ab0KQApU (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 16 Nov 2010 19:45:20 -0500 +Received: from einhorn.in-berlin.de ([192.109.42.8]:40608 "EHLO + einhorn.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S932265Ab0KQApS (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Tue, 16 Nov 2010 19:45:18 -0500 +X-Envelope-From: stefanr@s5r6.in-berlin.de +Received: from stein ([83.221.231.7]) + (authenticated bits=0) + by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id oAH0iRjV025917 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); + Wed, 17 Nov 2010 01:44:28 +0100 +In-Reply-To: <20101116230126.GB24623@opensource.wolfsonmicro.com> +X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) +X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063530> + +On Nov 16 Mark Brown wrote: +> On Tue, Nov 16, 2010 at 12:21:02PM -0800, Randy Dunlap wrote: +> +> > I don't know what you asked Joe to change, but asking someone to use +> > the documented canonical patch format: +> +> > <quote> +> > The canonical patch subject line is: +> +> > Subject: [PATCH 001/123] subsystem: summary phrase +> > </quote> +> +> > should be fine. And there is no need for printf-ish templates +> > for this in MAINTAINERS either. +> +> That's exactly what I asked him to do. He said he's not willing to use +> anything for "subsystem" which can't be automatically generated. + +Why should we codify our conventions in MAINTAINERS to accommodate the +specific problem of virtually a _single_ patch author? + +Conventions are living and are being adjusted all the time, as code +organization changes, people join and go, projects start and cease. + +Said author please looks the conventions up in the git history. If he +finds that this decelerates his patch generation rate, he can surely +code a script that looks into git for him and suggests plausible +prefixes for his patch titles to him. Or he can collect a kind of +database (a config file) locally for his own use in which he records +conventional prefixes on the go. +-- +Stefan Richter +-=====-==-=- =-== =---= +http://arcgraph.de/sr/ + + diff --git a/test/corpora/lkml/cur/1382298793.003501:2, b/test/corpora/lkml/cur/1382298793.003501:2, new file mode 100644 index 00000000..67668d17 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003501:2, @@ -0,0 +1,89 @@ +From: Jiri Kosina <jkosina@suse.cz> +Subject: Re: rfc: rewrite commit subject line for subsystem maintainer + preference tool +Date: Wed, 17 Nov 2010 01:53:35 +0100 (CET) +Lines: 43 +Message-ID: <alpine.LNX.2.00.1011170150060.7420@pobox.suse.cz> +References: <1289848458.16461.150.camel@Joe-Laptop> <20101115193407.GK12986@rakim.wolfsonmicro.main> <1289850773.16461.166.camel@Joe-Laptop> <20101116104921.GL12986@rakim.wolfsonmicro.main> <1289919077.28741.50.camel@Joe-Laptop> <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> <20101116203522.65240b18@schatten.dmk.lab> <20101116195530.GA7523@rakim.wolfsonmicro.main> <20101116122102.86e7e0b9.rdunlap@xenotime.net> <20101116230126.GB24623@opensource.wolfsonmicro.com> + <20101117014427.41d85b13@stein> +Mime-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>, + Randy Dunlap <rdunlap@xenotime.net>, + Florian Mickler <florian@mickler.org>, + Joe Perches <joe@perches.com>, + Andrew Morton <akpm@linux-foundation.org>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Stefan Richter <stefanr@s5r6.in-berlin.de> +X-From: linux-kernel-owner@vger.kernel.org Wed Nov 17 01:53:55 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PIWHa-0001VG-H4 + for glk-linux-kernel-3@lo.gmane.org; Wed, 17 Nov 2010 01:53:54 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S933245Ab0KQAxi (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Tue, 16 Nov 2010 19:53:38 -0500 +Received: from cantor2.suse.de ([195.135.220.15]:45188 "EHLO mx2.suse.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S932265Ab0KQAxh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Tue, 16 Nov 2010 19:53:37 -0500 +Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) + by mx2.suse.de (Postfix) with ESMTP id 1C9DD867E2; + Wed, 17 Nov 2010 01:53:36 +0100 (CET) +In-Reply-To: <20101117014427.41d85b13@stein> +User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063534> + +On Wed, 17 Nov 2010, Stefan Richter wrote: + +> > > I don't know what you asked Joe to change, but asking someone to use +> > > the documented canonical patch format: +> > +> > > <quote> +> > > The canonical patch subject line is: +> > +> > > Subject: [PATCH 001/123] subsystem: summary phrase +> > > </quote> +> > +> > > should be fine. And there is no need for printf-ish templates +> > > for this in MAINTAINERS either. +> > +> > That's exactly what I asked him to do. He said he's not willing to use +> > anything for "subsystem" which can't be automatically generated. +> +> Why should we codify our conventions in MAINTAINERS to accommodate the +> specific problem of virtually a _single_ patch author? +> +> Conventions are living and are being adjusted all the time, as code +> organization changes, people join and go, projects start and cease. +> +> Said author please looks the conventions up in the git history. If he +> finds that this decelerates his patch generation rate, he can surely +> code a script that looks into git for him and suggests plausible +> prefixes for his patch titles to him. Or he can collect a kind of +> database (a config file) locally for his own use in which he records +> conventional prefixes on the go. + +Come on guys, this debate is really horribly boring. + +Either the maintainer wants the patch. Then he is certainly able to apply +it no matter the subject line (I personally am getting a lot of patches +which don't follow the format I am using in my tree ... converting +Subject: lines is so trivial that I have never felt like bothering anyone +about it ... it's basically single condition in a shellscript). Or the +maintainer doesn't feel like the patch is worth it, and then the +subject-line format really doesn't matter. + +-- +Jiri Kosina +SUSE Labs, Novell Inc. + + diff --git a/test/corpora/lkml/cur/1382298793.003503:2, b/test/corpora/lkml/cur/1382298793.003503:2, new file mode 100644 index 00000000..0ea87ecf --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003503:2, @@ -0,0 +1,110 @@ +From: Randy Dunlap <rdunlap@xenotime.net> +Subject: Re: rfc: rewrite commit subject line for subsystem + maintainer preference tool +Date: Tue, 16 Nov 2010 16:55:56 -0800 +Organization: YPO4 +Lines: 36 +Message-ID: <20101116165556.3ee8e236.rdunlap@xenotime.net> +References: <1289850773.16461.166.camel@Joe-Laptop> + <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> + <1289940156.28741.207.camel@Joe-Laptop> + <20101116124609.382e42fb.rdunlap@xenotime.net> + <20101116232258.GC24623@opensource.wolfsonmicro.com> + <20101116152835.b0ab571c.rdunlap@xenotime.net> + <1289951875.28741.261.camel@Joe-Laptop> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + Mark Brown <broonie@opensource.wolfsonmicro.com>, + linux-kernel@vger.kernel.org, Florian Mickler <florian@mickler.org>, + Andrew Morton <akpm@linux-foundation.org> +To: Joe Perches <joe@perches.com> +X-From: alsa-devel-bounces@alsa-project.org Wed Nov 17 01:56:19 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PIWJv-0002k1-9C + for glad-alsa-devel-2@m.gmane.org; Wed, 17 Nov 2010 01:56:19 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 9953B1038A4; Wed, 17 Nov 2010 01:56:17 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id C25DC24439; + Wed, 17 Nov 2010 01:56:09 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 316CC24439; Wed, 17 Nov 2010 01:56:08 +0100 (CET) +Received: from xenotime.net (xenotime.net [72.52.115.56]) + by alsa0.perex.cz (Postfix) with SMTP id 043F124436 + for <alsa-devel@alsa-project.org>; Wed, 17 Nov 2010 01:56:06 +0100 (CET) +Received: from chimera.site ([173.50.240.230]) by xenotime.net for + <alsa-devel@alsa-project.org>; Tue, 16 Nov 2010 16:55:57 -0800 +In-Reply-To: <1289951875.28741.261.camel@Joe-Laptop> +X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; x86_64-unknown-linux-gnu) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1063536> + +On Tue, 16 Nov 2010 15:57:55 -0800 Joe Perches wrote: + +> On Tue, 2010-11-16 at 15:28 -0800, Randy Dunlap wrote: +> > On Tue, 16 Nov 2010 23:22:58 +0000 Mark Brown wrote: +> > > On Tue, Nov 16, 2010 at 12:46:09PM -0800, Randy Dunlap wrote: +> > > > On Tue, 16 Nov 2010 12:42:36 -0800 Joe Perches wrote: +> > > > > Some subsystem maintainers like upper case, some mixed, some lower. +> > > > > Some aren't consistent. (Staging/staging) +> > > > Case usually doesn't matter to most of us. +> > > Given that we're working in case sensitive languages here it's probably +> > > safe to assume that a reasonable proportion of people will care; being +> > > reasonably consistent with existing practice for the subsystem seems +> > > sensible. +> > Greg takes patches that say STAGING or Staging or staging. +> +> Greg seems to rewrite patch subjects and is inconsistent +> about case, so he might be doing that by hand. +> +> > DaveM takes patches that say net: or netdev: or network: or NET: +> +> DaveM doesn't appear to be choosy about patch subject lines. +> He seems to take any sensible patch and as far as I know he +> doesn't edit the subject lines. He does reject inferior +> patches outright. +> +> > The sound maintainers take patches that say sound: or alsa: or ALSA: +> +> The sound maintainers seem to rewrite patch subjects on an +> ad-hoc basis. + +OK, I can accept your summary. +However, I can't tell that we are making any progress. + +--- +~Randy +*** Remember to use Documentation/SubmitChecklist when testing your code *** + + diff --git a/test/corpora/lkml/cur/1382298793.003971:2, b/test/corpora/lkml/cur/1382298793.003971:2, new file mode 100644 index 00000000..4b510adc --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.003971:2, @@ -0,0 +1,106 @@ +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +Subject: Re: rfc: rewrite commit subject line for subsystem + maintainer preference tool +Date: Wed, 17 Nov 2010 17:07:47 +0000 +Lines: 29 +Message-ID: <20101117170746.GB19488@rakim.wolfsonmicro.main> +References: <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> + <20101116230126.GB24623@opensource.wolfsonmicro.com> + <20101117014427.41d85b13@stein> + <alpine.LNX.2.00.1011170150060.7420@pobox.suse.cz> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, + Florian Mickler <florian@mickler.org>, Randy Dunlap <rdunlap@xenotime.net>, + Stefan Richter <stefanr@s5r6.in-berlin.de>, Joe Perches <joe@perches.com>, + Andrew Morton <akpm@linux-foundation.org> +To: Jiri Kosina <jkosina@suse.cz> +X-From: alsa-devel-bounces@alsa-project.org Wed Nov 17 18:07:59 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PIlUD-000436-I4 + for glad-alsa-devel-2@m.gmane.org; Wed, 17 Nov 2010 18:07:57 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id B1000245CE; Wed, 17 Nov 2010 18:07:54 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id C35471037EC; + Wed, 17 Nov 2010 18:07:52 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 4EE8F1037EC; Wed, 17 Nov 2010 18:07:51 +0100 (CET) +Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com + [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id A8A16245CE + for <alsa-devel@alsa-project.org>; Wed, 17 Nov 2010 18:07:50 +0100 (CET) +Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com + [87.246.78.27]) + by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id 9E3591147AC; + Wed, 17 Nov 2010 17:07:48 +0000 (GMT) +Received: from broonie by rakim.wolfsonmicro.main with local (Exim 4.72) + (envelope-from <broonie@rakim.wolfsonmicro.main>) + id 1PIlU3-00061C-Bl; Wed, 17 Nov 2010 17:07:47 +0000 +Content-Disposition: inline +In-Reply-To: <alpine.LNX.2.00.1011170150060.7420@pobox.suse.cz> +X-Cookie: Killing turkeys causes winter. +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1064007> + +On Wed, Nov 17, 2010 at 01:53:35AM +0100, Jiri Kosina wrote: +> On Wed, 17 Nov 2010, Stefan Richter wrote: + +> > Why should we codify our conventions in MAINTAINERS to accommodate the +> > specific problem of virtually a _single_ patch author? + +It seems to be the way we're heading in general - look at all the recent +work on MAINTAINERS and get_maintainer.pl. There seems to be a genral +push to make all this stuff automatable. + +> Either the maintainer wants the patch. Then he is certainly able to apply +> it no matter the subject line (I personally am getting a lot of patches +> which don't follow the format I am using in my tree ... converting +> Subject: lines is so trivial that I have never felt like bothering anyone +> about it ... it's basically single condition in a shellscript). Or the + +It's slightly more than that if you're dealing with more than one area, +and I also find this sort of stuff is a good flag for scrubbing the +patch in greater detail - when patches stand out from a 1000ft visual +overview there's a fair chance that there's other issues so if people +regularly submit good patches that have only cosmetic issues I find it's +worth guiding them away from that. + +> maintainer doesn't feel like the patch is worth it, and then the +> subject-line format really doesn't matter. + +In this case if I don't apply it it's likely to end up going in via your +tree and then I'll still have to deal with the merge conflicts which are +more annoying. + + diff --git a/test/corpora/lkml/cur/1382298793.004059:2, b/test/corpora/lkml/cur/1382298793.004059:2, new file mode 100644 index 00000000..646ac835 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.004059:2, @@ -0,0 +1,88 @@ +From: Pavel Machek <pavel@ucw.cz> +Subject: Re: [PATCH 44/44] sound/soc/codecs: Remove unnecessary + semicolons +Date: Wed, 17 Nov 2010 20:32:56 +0100 +Lines: 19 +Message-ID: <20101117193256.GA28010@ucw.cz> +References: <cover.1289789604.git.joe@perches.com> + <97fd199b7dac50613f6843156687223928cce44a.1289789605.git.joe@perches.com> + <20101115134939.GC12986@rakim.wolfsonmicro.main> + <1289840957.16461.138.camel@Joe-Laptop> + <20101115173031.GI12986@rakim.wolfsonmicro.main> + <1289842444.16461.140.camel@Joe-Laptop> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>, + alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + Takashi Iwai <tiwai@suse.de>, linux-kernel@vger.kernel.org, + Mark Brown <broonie@opensource.wolfsonmicro.com>, + Ian Lartey <ian@opensource.wolfsonmicro.com>, + Liam Girdwood <lrg@slimlogic.co.uk> +To: Joe Perches <joe@perches.com> +X-From: alsa-devel-bounces@alsa-project.org Wed Nov 17 20:33:19 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PInkr-0005bs-LY + for glad-alsa-devel-2@m.gmane.org; Wed, 17 Nov 2010 20:33:17 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id D7C501038BF; Wed, 17 Nov 2010 20:33:14 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled + version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 193061038BD; + Wed, 17 Nov 2010 20:33:08 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 664E91038BD; Wed, 17 Nov 2010 20:33:06 +0100 (CET) +Received: from atrey.karlin.mff.cuni.cz (ksp.mff.cuni.cz [195.113.26.206]) + by alsa0.perex.cz (Postfix) with ESMTP id 9E5621038BA + for <alsa-devel@alsa-project.org>; Wed, 17 Nov 2010 20:33:05 +0100 (CET) +Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) + id AC6A1F23E1; Wed, 17 Nov 2010 20:33:04 +0100 (CET) +Content-Disposition: inline +In-Reply-To: <1289842444.16461.140.camel@Joe-Laptop> +User-Agent: Mutt/1.5.20 (2009-06-14) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1064096> + +On Mon 2010-11-15 09:34:04, Joe Perches wrote: +> On Mon, 2010-11-15 at 17:30 +0000, Mark Brown wrote: +> > On Mon, Nov 15, 2010 at 09:09:17AM -0800, Joe Perches wrote: +> > > Signed-off-by: Joe Perches <joe@perches.com> +> > Applied, thanks. +> > Please try to use changelog formats consistent with the code you're +> > modifying. +> +> I think it's more important to use consistent changelogs +> for a patch series. + +And I agree here. Having to learn code-style quirks for patches is +bad, having to learn new changelog style for each subsystem is very +bad. + Pavel + +-- +(english) http://www.livejournal.com/~pavelmachek +(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html + + diff --git a/test/corpora/lkml/cur/1382298793.004091:2, b/test/corpora/lkml/cur/1382298793.004091:2, new file mode 100644 index 00000000..1abc297f --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.004091:2, @@ -0,0 +1,133 @@ +From: Stefan Richter <stefanr@s5r6.in-berlin.de> +Subject: Re: rfc: rewrite commit subject line for subsystem maintainer + preference tool +Date: Wed, 17 Nov 2010 22:07:37 +0100 +Lines: 74 +Message-ID: <20101117220737.2d3d7356@stein> +References: <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> + <20101116230126.GB24623@opensource.wolfsonmicro.com> + <20101117014427.41d85b13@stein> + <alpine.LNX.2.00.1011170150060.7420@pobox.suse.cz> + <20101117170746.GB19488@rakim.wolfsonmicro.main> +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +Cc: Jiri Kosina <jkosina@suse.cz>, Randy Dunlap <rdunlap@xenotime.net>, + Florian Mickler <florian@mickler.org>, + Joe Perches <joe@perches.com>, + Andrew Morton <akpm@linux-foundation.org>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Mark Brown <broonie@opensource.wolfsonmicro.com> +X-From: linux-kernel-owner@vger.kernel.org Wed Nov 17 22:08:15 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PIpEk-0006ge-Hz + for glk-linux-kernel-3@lo.gmane.org; Wed, 17 Nov 2010 22:08:14 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1758632Ab0KQVHz (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Wed, 17 Nov 2010 16:07:55 -0500 +Received: from einhorn.in-berlin.de ([192.109.42.8]:48630 "EHLO + einhorn.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751563Ab0KQVHy (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Wed, 17 Nov 2010 16:07:54 -0500 +X-Envelope-From: stefanr@s5r6.in-berlin.de +Received: from stein ([83.221.231.7]) + (authenticated bits=0) + by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id oAHL7dhi014114 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); + Wed, 17 Nov 2010 22:07:39 +0100 +In-Reply-To: <20101117170746.GB19488@rakim.wolfsonmicro.main> +X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) +X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1064128> + +On Nov 17 Mark Brown wrote: +> On Wed, Nov 17, 2010 at 01:53:35AM +0100, Jiri Kosina wrote: +> > On Wed, 17 Nov 2010, Stefan Richter wrote: +> +> > > Why should we codify our conventions in MAINTAINERS to accommodate the +> > > specific problem of virtually a _single_ patch author? +> +> It seems to be the way we're heading in general - look at all the recent +> work on MAINTAINERS and get_maintainer.pl. There seems to be a genral +> push to make all this stuff automatable. + +get_maintainer.pl, used with judgment and together with "gitk +the/patched/source.c" is nice not only for people like Joe who +regularly work tree-wide but also for ones like me who only rarely want +to submit a bug report or patch for a subsystem with they are +unfamiliar with. + +But the thought of a database of "how to start a good patch title" is +far-fetched. Really, as a patch author, just look how other people +write patch titles and judge whether this is good for your work too or +not. + +> > Either the maintainer wants the patch. Then he is certainly able to apply +> > it no matter the subject line (I personally am getting a lot of patches +> > which don't follow the format I am using in my tree ... converting +> > Subject: lines is so trivial that I have never felt like bothering anyone +> > about it ... it's basically single condition in a shellscript). Or the +> +> It's slightly more than that if you're dealing with more than one area, +> and I also find this sort of stuff is a good flag for scrubbing the +> patch in greater detail - when patches stand out from a 1000ft visual +> overview there's a fair chance that there's other issues so if people +> regularly submit good patches that have only cosmetic issues I find it's +> worth guiding them away from that. + +On one hand Jiri is right that maintainers can adjust title prefixes ad +hoc. (Downside: Weaker connection to mailinglist archives.) On the +other hand, in the case of long-term prolific authors like Joe it is +more optimal if there is a good patch title right from the outset. + +So, if this boring thread does at least yield the conclusion that +${path}/${filename}: is a bad title prefix, at least something was +won. :-) + +Another thought: Whether a typical part of a mass conversion, e.g. to +use a new helper macro without change of functionality, is named + + [PATCH] [subsystem] driver: use foo_bar helper +or + [PATCH] use foo_bar helper in subsystem, driver + +does not really matter, does it? This change is more about the helper +than about the driver. It is really a different kind of changeset than +a functional change that we want to be called + + [PATCH] [subsystem] driver: fix crash at disconnection + +or so. This is something that those who look for release notes of +that driver or subsystem want to grep in the changelog. + +Or in other words: If you as patch author wonder what would be a good +title for your patch, then ask yourself: How should this change show up +in kernel release notes that are constructed from the git shortlog? +Sometimes the answer to this question includes among else a prefix with +a canonical subsystem name (even case sensitive, with brackets or +colon), whereas other times such formalities are utterly pointless. + +[Sorry for the spent electrons. But OTOH, issues like (1.) optimum +use of reviewer bandwidth, (2.) kernel changelog alias release +notes /do/ matter.] +-- +Stefan Richter +-=====-==-=- =-== =---= +http://arcgraph.de/sr/ + + diff --git a/test/corpora/lkml/cur/1382298793.004190:2, b/test/corpora/lkml/cur/1382298793.004190:2, new file mode 100644 index 00000000..10a54af1 --- /dev/null +++ b/test/corpora/lkml/cur/1382298793.004190:2, @@ -0,0 +1,67 @@ +From: Joe Perches <joe@perches.com> +Subject: Re: rfc: rewrite commit subject line for subsystem maintainer + preference tool +Date: Wed, 17 Nov 2010 15:49:19 -0800 +Lines: 11 +Message-ID: <1290037759.28741.313.camel@Joe-Laptop> +References: <20101116104921.GL12986@rakim.wolfsonmicro.main> + <1289919077.28741.50.camel@Joe-Laptop> + <20101116183707.179964dd@schatten.dmk.lab> + <20101116181226.GB26239@rakim.wolfsonmicro.main> + <20101116203522.65240b18@schatten.dmk.lab> + <20101116195530.GA7523@rakim.wolfsonmicro.main> + <20101116122102.86e7e0b9.rdunlap@xenotime.net> + <20101116230126.GB24623@opensource.wolfsonmicro.com> + <20101117014427.41d85b13@stein> + <alpine.LNX.2.00.1011170150060.7420@pobox.suse.cz> + <20101117170746.GB19488@rakim.wolfsonmicro.main> + <20101117220737.2d3d7356@stein> +Mime-Version: 1.0 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 7bit +Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>, + Jiri Kosina <jkosina@suse.cz>, + Randy Dunlap <rdunlap@xenotime.net>, + Florian Mickler <florian@mickler.org>, + Andrew Morton <akpm@linux-foundation.org>, + alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org +To: Stefan Richter <stefanr@s5r6.in-berlin.de> +X-From: linux-kernel-owner@vger.kernel.org Thu Nov 18 00:49:42 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PIrkz-0000bE-Ro + for glk-linux-kernel-3@lo.gmane.org; Thu, 18 Nov 2010 00:49:42 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1752426Ab0KQXtX (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Wed, 17 Nov 2010 18:49:23 -0500 +Received: from mail.perches.com ([173.55.12.10]:1507 "EHLO mail.perches.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1750850Ab0KQXtW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Wed, 17 Nov 2010 18:49:22 -0500 +Received: from [192.168.1.162] (unknown [192.168.1.162]) + by mail.perches.com (Postfix) with ESMTP id 7D75724368; + Wed, 17 Nov 2010 15:49:17 -0800 (PST) +In-Reply-To: <20101117220737.2d3d7356@stein> +X-Mailer: Evolution 2.30.3 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1064228> + +On Wed, 2010-11-17 at 22:07 +0100, Stefan Richter wrote: +> So, if this boring thread does at least yield the conclusion that +> ${path}/${filename}: is a bad title prefix, at least something was +> won. :-) + +I've changed my scripts to use this style: + +Subject: [PATCH] $(basename $(dirname $file)): commit desc... + +until a better tool is available. + + + diff --git a/test/corpora/lkml/cur/1382298795.000299:2, b/test/corpora/lkml/cur/1382298795.000299:2, new file mode 100644 index 00000000..ea8522f0 --- /dev/null +++ b/test/corpora/lkml/cur/1382298795.000299:2, @@ -0,0 +1,79 @@ +From: Artem Bityutskiy <dedekind1@gmail.com> +Subject: Re: [PATCH 37/44] fs/ubifs: Remove unnecessary semicolons +Date: Fri, 19 Nov 2010 15:21:08 +0200 +Lines: 13 +Message-ID: <1290172868.4768.2.camel@localhost> +References: <cover.1289789604.git.joe@perches.com> + <902d76520da2f65e5dc44339dccb07159947f23d.1289789605.git.joe@perches.com> +Reply-To: dedekind1@gmail.com +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: QUOTED-PRINTABLE +Cc: Jiri Kosina <trivial@kernel.org>, + Adrian Hunter <adrian.hunter@nokia.com>, + linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org +To: Joe Perches <joe@perches.com> +X-From: linux-kernel-owner@vger.kernel.org Fri Nov 19 14:22:08 2010 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PJQuj-00008T-0Z + for glk-linux-kernel-3@lo.gmane.org; Fri, 19 Nov 2010 14:22:05 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1754099Ab0KSNVg convert rfc822-to-quoted-printable (ORCPT + <rfc822;glk-linux-kernel-3@m.gmane.org>); + Fri, 19 Nov 2010 08:21:36 -0500 +Received: from mail-bw0-f46.google.com ([209.85.214.46]:60443 "EHLO + mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1753270Ab0KSNVf (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Fri, 19 Nov 2010 08:21:35 -0500 +Received: by bwz15 with SMTP id 15so3864554bwz.19 + for <linux-kernel@vger.kernel.org>; Fri, 19 Nov 2010 05:21:33 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:received:received:subject:from:reply-to:to:cc + :in-reply-to:references:content-type:date:message-id:mime-version + :x-mailer:content-transfer-encoding; + bh=I+JFeMB9svh3ZIIGdVlHav4mOQmOa+QTh4VZGVL0a/0=; + b=hLukn/U4YkodFZ8CEkuJJmYvpTDXhavKiL1YZ12QApXyCb9xBeYORheXEIQUygjUpL + Fy9zyFIWzw3YAiLEa4WUJnC4L+VWq4Nhtua9a1XBQBCK8HZuDITUcmtYcobib1kBg4KE + 0nBOF7IL6d17HN8QGC+Nn+YTu7JxHSq4cHy8Y= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=subject:from:reply-to:to:cc:in-reply-to:references:content-type + :date:message-id:mime-version:x-mailer:content-transfer-encoding; + b=WiSerhUAnUL/tGRi8PqwwkXymz8N1Uf58rludUDWzSk+L3KSJqGtAvdv8xYqW8x4PQ + Vla/qoLPjcqQQmaLgLKtDvGIL9BFQ86dXrgokJhcrT1qSs2xN3VKGdhm49MOd/HrYZ/F + v4wespzjVohrMt2tOP38nOKZpPeu4t1wUJYOQ= +Received: by 10.204.79.142 with SMTP id p14mr1988895bkk.175.1290172893650; + Fri, 19 Nov 2010 05:21:33 -0800 (PST) +Received: from ?IPv6:::1? (shutemov.name [188.40.19.243]) + by mx.google.com with ESMTPS id v25sm850549bkt.6.2010.11.19.05.21.30 + (version=SSLv3 cipher=RC4-MD5); + Fri, 19 Nov 2010 05:21:31 -0800 (PST) +In-Reply-To: <902d76520da2f65e5dc44339dccb07159947f23d.1289789605.git.joe@perches.com> +X-Mailer: Evolution 2.32.0 (2.32.0-2.fc14) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1065301> + +On Sun, 2010-11-14 at 19:04 -0800, Joe Perches wrote: +> Signed-off-by: Joe Perches <joe@perches.com> +> --- +> fs/ubifs/scan.c | 2 +- +> 1 files changed, 1 insertions(+), 1 deletions(-) + +Thanks, I'll pick this up. + +--=20 +Best Regards, +Artem Bityutskiy (=D0=90=D1=80=D1=82=D1=91=D0=BC =D0=91=D0=B8=D1=82=D1=8E= +=D1=86=D0=BA=D0=B8=D0=B9) + + + diff --git a/test/corpora/lkml/cur/1382298795.001362:2, b/test/corpora/lkml/cur/1382298795.001362:2, new file mode 100644 index 00000000..a723d580 --- /dev/null +++ b/test/corpora/lkml/cur/1382298795.001362:2, @@ -0,0 +1,96 @@ +From: Takashi Iwai <tiwai@suse.de> +Subject: Re: [PATCH 43/44] sound/core/pcm_lib.c: Remove + unnecessary semicolons +Date: Mon, 22 Nov 2010 07:44:21 +0100 +Lines: 31 +Message-ID: <s5h4ob9svqy.wl%tiwai@suse.de> +References: <cover.1289789604.git.joe@perches.com> + <9fa8e193ce125ef4fd19a952792629c5ee84953f.1289789605.git.joe@perches.com> +Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Cc: alsa-devel@alsa-project.org, Jiri Kosina <trivial@kernel.org>, + linux-kernel@vger.kernel.org +To: Joe Perches <joe@perches.com> +X-From: alsa-devel-bounces@alsa-project.org Mon Nov 22 07:44:31 2010 +Return-path: <alsa-devel-bounces@alsa-project.org> +Envelope-to: glad-alsa-devel-2@m.gmane.org +Received: from alsa0.perex.cz ([212.20.107.51]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <alsa-devel-bounces@alsa-project.org>) + id 1PKQ8Y-0002qf-F0 + for glad-alsa-devel-2@m.gmane.org; Mon, 22 Nov 2010 07:44:26 +0100 +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 26BFF103863; Mon, 22 Nov 2010 07:44:26 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz +X-Spam-Level: +X-Spam-Status: No, score=-8.0 required=5.0 tests=RCVD_IN_DNSWL_HI + autolearn=disabled version=3.2.4 +Received: from alsa0.perex.cz (localhost [127.0.0.1]) + by alsa0.perex.cz (Postfix) with ESMTP id 1E4EF103848; + Mon, 22 Nov 2010 07:44:24 +0100 (CET) +X-Original-To: alsa-devel@alsa-project.org +Delivered-To: alsa-devel@alsa-project.org +Received: by alsa0.perex.cz (Postfix, from userid 1000) + id 0861E103851; Mon, 22 Nov 2010 07:44:22 +0100 (CET) +Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) + by alsa0.perex.cz (Postfix) with ESMTP id 7007710383C + for <alsa-devel@alsa-project.org>; Mon, 22 Nov 2010 07:44:21 +0100 (CET) +Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mx1.suse.de (Postfix) with ESMTP id 53C1B947B6; + Mon, 22 Nov 2010 07:44:21 +0100 (CET) +In-Reply-To: <9fa8e193ce125ef4fd19a952792629c5ee84953f.1289789605.git.joe@perches.com> +User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) + FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 + (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) +X-BeenThere: alsa-devel@alsa-project.org +X-Mailman-Version: 2.1.9 +Precedence: list +List-Id: "Alsa-devel mailing list for ALSA developers - + http://www.alsa-project.org" <alsa-devel.alsa-project.org> +List-Unsubscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> +List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel> +List-Post: <mailto:alsa-devel@alsa-project.org> +List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> +List-Subscribe: <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, + <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> +Sender: alsa-devel-bounces@alsa-project.org +Errors-To: alsa-devel-bounces@alsa-project.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1066369> + +At Sun, 14 Nov 2010 19:05:02 -0800, +Joe Perches wrote: +> +> Signed-off-by: Joe Perches <joe@perches.com> + +Applied now. Thanks. + + +Takashi + + +> --- +> sound/core/pcm_lib.c | 2 +- +> 1 files changed, 1 insertions(+), 1 deletions(-) +> +> diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c +> index a1707cc..b75db8e 100644 +> --- a/sound/core/pcm_lib.c +> +++ b/sound/core/pcm_lib.c +> @@ -223,7 +223,7 @@ static void xrun_log(struct snd_pcm_substream *substream, +> entry->jiffies = jiffies; +> entry->pos = pos; +> entry->period_size = runtime->period_size; +> - entry->buffer_size = runtime->buffer_size;; +> + entry->buffer_size = runtime->buffer_size; +> entry->old_hw_ptr = runtime->status->hw_ptr; +> entry->hw_ptr_base = runtime->hw_ptr_base; +> log->idx = (log->idx + 1) % XRUN_LOG_CNT; +> -- +> 1.7.3.1.g432b3.dirty +> + + diff --git a/test/corpora/lkml/cur/1382298795.002635:2, b/test/corpora/lkml/cur/1382298795.002635:2, new file mode 100644 index 00000000..3c04b86a --- /dev/null +++ b/test/corpora/lkml/cur/1382298795.002635:2, @@ -0,0 +1,54 @@ +From: Matthew Garrett <mjg59@srcf.ucam.org> +Subject: Re: [PATCH 19/44] drivers/platform/x86: Remove unnecessary + semicolons +Date: Wed, 24 Nov 2010 16:52:46 +0000 +Lines: 4 +Message-ID: <20101124165246.GH2150@srcf.ucam.org> +References: <cover.1289789604.git.joe@perches.com> <eda82bcfaad265fc5cd3901bc4f41bfcfac2403b.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: Jiri Kosina <trivial@kernel.org>, + Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>, + Daniel Oliveira Nascimento <don@syst.com.br>, + Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>, + platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, + ibm-acpi-devel@lists.sourceforge.net +To: Joe Perches <joe@perches.com> +X-From: platform-driver-x86-owner@vger.kernel.org Wed Nov 24 17:53:05 2010 +Return-path: <platform-driver-x86-owner@vger.kernel.org> +Envelope-to: gldpxd-platform-driver-x86@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <platform-driver-x86-owner@vger.kernel.org>) + id 1PLIae-0001zN-Vf + for gldpxd-platform-driver-x86@lo.gmane.org; Wed, 24 Nov 2010 17:53:05 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1754012Ab0KXQxE (ORCPT + <rfc822;gldpxd-platform-driver-x86@m.gmane.org>); + Wed, 24 Nov 2010 11:53:04 -0500 +Received: from cavan.codon.org.uk ([93.93.128.6]:37338 "EHLO + cavan.codon.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1753985Ab0KXQxD (ORCPT + <rfc822;platform-driver-x86@vger.kernel.org>); + Wed, 24 Nov 2010 11:53:03 -0500 +Received: from mjg59 by cavan.codon.org.uk with local (Exim 4.69) + (envelope-from <mjg59@cavan.codon.org.uk>) + id 1PLIaM-0000fC-HX; Wed, 24 Nov 2010 16:52:46 +0000 +Content-Disposition: inline +In-Reply-To: <eda82bcfaad265fc5cd3901bc4f41bfcfac2403b.1289789604.git.joe@perches.com> +User-Agent: Mutt/1.5.18 (2008-05-17) +X-SA-Exim-Connect-IP: <locally generated> +X-SA-Exim-Mail-From: mjg59@cavan.codon.org.uk +X-SA-Exim-Scanned: No (on cavan.codon.org.uk); SAEximRunCond expanded to false +Sender: platform-driver-x86-owner@vger.kernel.org +Precedence: bulk +List-ID: <platform-driver-x86.vger.kernel.org> +X-Mailing-List: platform-driver-x86@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1067655> + +Applied, thanks. + +-- +Matthew Garrett | mjg59@srcf.ucam.org + + diff --git a/test/corpora/lkml/cur/1382298796.001941:2, b/test/corpora/lkml/cur/1382298796.001941:2, new file mode 100644 index 00000000..c65a72fa --- /dev/null +++ b/test/corpora/lkml/cur/1382298796.001941:2, @@ -0,0 +1,73 @@ +From: Chris Ball <cjb@laptop.org> +Subject: Re: [PATCH 11/44] drivers/mmc: Remove unnecessary semicolons +Date: Sun, 5 Dec 2010 03:32:32 +0000 +Lines: 33 +Message-ID: <20101205033232.GD24000@void.printf.net> +References: <cover.1289789604.git.joe@perches.com> <6391af02ba7ec4a76c5c5f462d8013fc1f52f999.1289789604.git.joe@perches.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: Jiri Kosina <trivial@kernel.org>, linux-mmc@vger.kernel.org, + linux-kernel@vger.kernel.org +To: Joe Perches <joe@perches.com> +X-From: linux-mmc-owner@vger.kernel.org Sun Dec 05 04:32:38 2010 +Return-path: <linux-mmc-owner@vger.kernel.org> +Envelope-to: glkm-linux-mmc@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-mmc-owner@vger.kernel.org>) + id 1PP5L3-0005AB-4b + for glkm-linux-mmc@lo.gmane.org; Sun, 05 Dec 2010 04:32:37 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1752522Ab0LEDcg (ORCPT <rfc822;glkm-linux-mmc@m.gmane.org>); + Sat, 4 Dec 2010 22:32:36 -0500 +Received: from void.printf.net ([89.145.121.20]:42897 "EHLO void.printf.net" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1752473Ab0LEDcf (ORCPT <rfc822;linux-mmc@vger.kernel.org>); + Sat, 4 Dec 2010 22:32:35 -0500 +Received: from chris by void.printf.net with local (Exim 4.69) + (envelope-from <chris@void.printf.net>) + id 1PP5Ky-0006Ly-KC; Sun, 05 Dec 2010 03:32:32 +0000 +Content-Disposition: inline +In-Reply-To: <6391af02ba7ec4a76c5c5f462d8013fc1f52f999.1289789604.git.joe@perches.com> +User-Agent: Mutt/1.5.18 (2008-05-17) +Sender: linux-mmc-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-mmc.vger.kernel.org> +X-Mailing-List: linux-mmc@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1071959> + +Hi Joe, + +On Sun, Nov 14, 2010 at 07:04:30PM -0800, Joe Perches wrote: +> Signed-off-by: Joe Perches <joe@perches.com> +> --- +> drivers/mmc/host/davinci_mmc.c | 2 +- +> 1 files changed, 1 insertions(+), 1 deletions(-) +> +> diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c +> index e15547c..b643dde 100644 +> --- a/drivers/mmc/host/davinci_mmc.c +> +++ b/drivers/mmc/host/davinci_mmc.c +> @@ -480,7 +480,7 @@ static void mmc_davinci_send_dma_request(struct mmc_davinci_host *host, +> struct scatterlist *sg; +> unsigned sg_len; +> unsigned bytes_left = host->bytes_left; +> - const unsigned shift = ffs(rw_threshold) - 1;; +> + const unsigned shift = ffs(rw_threshold) - 1; +> +> if (host->data_dir == DAVINCI_MMC_DATADIR_WRITE) { +> template = &host->tx_template; +> -- + +Pushed to mmc-next for .38, thanks. + +-- +Chris Ball <cjb@laptop.org> <http://printf.net/> +One Laptop Per Child +-- +To unsubscribe from this list: send the line "unsubscribe linux-mmc" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298805.004526:2, b/test/corpora/lkml/cur/1382298805.004526:2, new file mode 100644 index 00000000..05dbb9d7 --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004526:2, @@ -0,0 +1,89 @@ +From: Colin Cross <ccross@android.com> +Subject: [PATCH] ARM: vfp: Always save VFP state in vfp_pm_suspend +Date: Sun, 13 Feb 2011 15:13:33 -0800 +Lines: 45 +Message-ID: <1297638813-1315-1-git-send-email-ccross@android.com> +Cc: Colin Cross <ccross@android.com>, + Catalin Marinas <catalin.marinas@arm.com>, + Russell King <linux@arm.linux.org.uk>, + linux-kernel@vger.kernel.org +To: linux-arm-kernel@lists.infradead.org +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 00:14:16 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1Pol8x-0007RZ-Hw + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 00:14:15 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1755242Ab1BMXOA (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Sun, 13 Feb 2011 18:14:00 -0500 +Received: from smtp-out.google.com ([74.125.121.67]:10204 "EHLO + smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1753669Ab1BMXN5 (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Sun, 13 Feb 2011 18:13:57 -0500 +Received: from hpaq1.eem.corp.google.com (hpaq1.eem.corp.google.com [172.25.149.1]) + by smtp-out.google.com with ESMTP id p1DNDjFc030645; + Sun, 13 Feb 2011 15:13:45 -0800 +Received: from walnut.mtv.corp.google.com (walnut.mtv.corp.google.com [172.18.102.62]) + by hpaq1.eem.corp.google.com with ESMTP id p1DNDdKg016468; + Sun, 13 Feb 2011 15:13:39 -0800 +Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) + id 1F65025772D; Sun, 13 Feb 2011 15:13:39 -0800 (PST) +X-Mailer: git-send-email 1.7.3.1 +X-System-Of-Record: true +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099558> + +vfp_pm_suspend should save the VFP state any time there is +a last_VFP_context. If it only saves when the VFP is enabled, +the state can get lost when, on a UP system: + Thread 1 uses the VFP + Context switch occurs to thread 2, VFP is disabled but the + VFP context is not saved to allow lazy save and restore + Thread 2 initiates suspend + vfp_pm_suspend is called with the VFP disabled, but the + context has not been saved. + +Modify vfp_pm_suspend to save the VFP context whenever +last_VFP_context is set. + +Cc: Catalin Marinas <catalin.marinas@arm.com> +Signed-off-by: Colin Cross <ccross@android.com> +--- + arch/arm/vfp/vfpmodule.c | 11 +++++------ + 1 files changed, 5 insertions(+), 6 deletions(-) + +diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c +index 66bf8d1..7aea616 100644 +--- a/arch/arm/vfp/vfpmodule.c ++++ b/arch/arm/vfp/vfpmodule.c +@@ -415,13 +415,12 @@ static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state) + struct thread_info *ti = current_thread_info(); + u32 fpexc = fmrx(FPEXC); + +- /* if vfp is on, then save state for resumption */ +- if (fpexc & FPEXC_EN) { ++ /* save state for resume */ ++ if (last_VFP_context[ti->cpu]) { + printk(KERN_DEBUG "%s: saving vfp state\n", __func__); +- vfp_save_state(&ti->vfpstate, fpexc); +- +- /* disable, just in case */ +- fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN); ++ fmxr(FPEXC, fpexc | FPEXC_EN); ++ vfp_save_state(last_VFP_context[ti->cpu], fpexc); ++ fmxr(FPEXC, fpexc & ~FPEXC_EN); + } + + /* clear any information we had about last context state */ +-- +1.7.3.1 + + + diff --git a/test/corpora/lkml/cur/1382298805.004551:2, b/test/corpora/lkml/cur/1382298805.004551:2, new file mode 100644 index 00000000..0e21b167 --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004551:2, @@ -0,0 +1,90 @@ +From: Justin Mattock <justinmattock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> +Subject: bluetooth disabled with current 2.6.38-rc4 +Date: Sun, 13 Feb 2011 17:30:04 -0800 +Lines: 30 +Message-ID: <1A8743E5-65EA-4625-82FD-658C9722629F@gmail.com> +Mime-Version: 1.0 (Apple Message framework v936) +Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes +Content-Transfer-Encoding: 7bit +Cc: "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Mailing List" + <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +To: linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +X-From: linux-bluetooth-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Mon Feb 14 02:30:20 2011 +Return-path: <linux-bluetooth-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> +Envelope-to: glbk-linux-bluetooth-1dZseelyfdZg9hUCZPvPmw@public.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-bluetooth-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>) + id 1PonGb-0000BP-Ns + for glbk-linux-bluetooth-1dZseelyfdZg9hUCZPvPmw@public.gmane.org; Mon, 14 Feb 2011 02:30:18 +0100 +Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand + id S1755415Ab1BNBaO (ORCPT + <rfc822;glbk-linux-bluetooth@m.gmane.org>); + Sun, 13 Feb 2011 20:30:14 -0500 +Received: from mail-iw0-f174.google.com ([209.85.214.174]:33676 "EHLO + mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1755315Ab1BNBaJ (ORCPT + <rfc822;linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>); + Sun, 13 Feb 2011 20:30:09 -0500 +Received: by iwn9 with SMTP id 9so4315727iwn.19 + for <multiple recipients>; Sun, 13 Feb 2011 17:30:08 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:message-id:from:to:content-type + :content-transfer-encoding:mime-version:subject:date:cc:x-mailer; + bh=Hm2xpT9F5uspvKowKW51PBMJXHVySz8oO68WD+15vw4=; + b=CYWbVChg8u/vPwCQijLtu4qwy88RnlkiXipfYaorEsKoqnL/riJzvgVjtYz3uoSWE5 + m9IsBgZBGd2zuZMuDEfGiLQo1h5ReLbCsQ2FSLRM8dW15g3xENkK0Zd86EHNATbnU4CQ + YMF3gYQHr5BffWBu8xllNHnUKHzMGZz827BEk= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=message-id:from:to:content-type:content-transfer-encoding + :mime-version:subject:date:cc:x-mailer; + b=DU4h/EWn8O7B48JT0DuiMTjHma3v+7cSup8eYqLmOgYopjvr42kO9BACgxHMR/mpI/ + sa4AtFAuWg3TkZkPOjJg2SiPiUGQcj7kqjycvHWvWiQHEE6tLEH7g6aGF7ojSTrsiJxN + zpjZBS0EvbDtIrQf8YAV9eFQJSkQ5yYXmK00c= +Received: by 10.42.228.201 with SMTP id jf9mr3782213icb.471.1297647007933; + Sun, 13 Feb 2011 17:30:07 -0800 (PST) +Received: from [10.0.0.13] ([76.89.133.205]) + by mx.google.com with ESMTPS id y8sm1925328ica.2.2011.02.13.17.30.06 + (version=TLSv1/SSLv3 cipher=OTHER); + Sun, 13 Feb 2011 17:30:07 -0800 (PST) +X-Mailer: Apple Mail (2.936) +Sender: linux-bluetooth-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Precedence: bulk +List-ID: <linux-bluetooth.vger.kernel.org> +X-Mailing-List: linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099583> + +maybe I missed something, but my bluetooth is just not functioning with +2.6.38-rc4(works with 2.6.37-rc4) + +I've done a bisect on this, but was pointed to: +c0e45c1ca3162acb2e77b3d9e152ce6e7b6fa3f5 +but doesn't look correct to me + +here is what I am seeing with the bluetooth-applet etc..: + +working correctly: +http://www.flickr.com/photos/44066293@N08/5443727238/ + +not working: +http://www.flickr.com/photos/44066293@N08/5443124859/ + +my /var/log/daemon.log shows: + +Feb 13 17:12:22 Linux-2 acpid: 1 client rule loaded +Feb 13 17:12:23 Linux-2 bluetoothd[1950]: HCI dev 0 registered +Feb 13 17:12:23 Linux-2 bluetoothd[1950]: Listening for HCI events on +hci0 +Feb 13 17:12:23 Linux-2 bluetoothd[1950]: HCI dev 0 up +Feb 13 17:12:23 Linux-2 bluetoothd[1950]: Unable to find matching +adapter + +I can try at another bisect, but might take some time.. let me know if +there is something I can test +or do. + +Justin P. Mattock + + diff --git a/test/corpora/lkml/cur/1382298805.004613:2, b/test/corpora/lkml/cur/1382298805.004613:2, new file mode 100644 index 00000000..5a12c8be --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004613:2, @@ -0,0 +1,94 @@ +From: Henrik Kretzschmar <henne@nachtwindheim.de> +Subject: [PATCH 1/6] x86: move ioapic_irq_destination_types +Date: Mon, 14 Feb 2011 11:00:07 +0100 +Lines: 55 +Message-ID: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +Cc: tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, tj@kernel.org, + yinghai@kernel.org, ak@linux.intel.com, robert.richter@amd.com, + linux-kernel@vger.kernel.org, henne@nachtwindheim.de +To: mingo@readhat.com +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 11:00:33 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PovEP-0006ED-4Z + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 11:00:33 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1752832Ab1BNKAX (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 14 Feb 2011 05:00:23 -0500 +Received: from server103.greatnet.de ([83.133.97.6]:38305 "EHLO + server103.greatnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752268Ab1BNKAW (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 14 Feb 2011 05:00:22 -0500 +Received: from localhost.localdomain (cmnz-d9bab6be.pool.mediaWays.net [217.186.182.190]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by server103.greatnet.de (Postfix) with ESMTPSA id D2234950DB2; + Mon, 14 Feb 2011 10:59:03 +0100 (CET) +X-Mailer: git-send-email 1.7.1 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099645> + +This enum is used also by non-ioapic code, e.g apic_noop, +so its better kept in apicdef.h. + +Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> +--- + arch/x86/include/asm/apicdef.h | 12 ++++++++++++ + arch/x86/include/asm/io_apic.h | 11 ----------- + 2 files changed, 12 insertions(+), 11 deletions(-) + +diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h +index 47a30ff..2de3e95 100644 +--- a/arch/x86/include/asm/apicdef.h ++++ b/arch/x86/include/asm/apicdef.h +@@ -426,4 +426,16 @@ struct local_apic { + #else + #define BAD_APICID 0xFFFFu + #endif ++ ++enum ioapic_irq_destination_types { ++ dest_Fixed = 0, ++ dest_LowestPrio = 1, ++ dest_SMI = 2, ++ dest__reserved_1 = 3, ++ dest_NMI = 4, ++ dest_INIT = 5, ++ dest__reserved_2 = 6, ++ dest_ExtINT = 7 ++}; ++ + #endif /* _ASM_X86_APICDEF_H */ +diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h +index f327d38..e1a9b0e 100644 +--- a/arch/x86/include/asm/io_apic.h ++++ b/arch/x86/include/asm/io_apic.h +@@ -63,17 +63,6 @@ union IO_APIC_reg_03 { + } __attribute__ ((packed)) bits; + }; + +-enum ioapic_irq_destination_types { +- dest_Fixed = 0, +- dest_LowestPrio = 1, +- dest_SMI = 2, +- dest__reserved_1 = 3, +- dest_NMI = 4, +- dest_INIT = 5, +- dest__reserved_2 = 6, +- dest_ExtINT = 7 +-}; +- + struct IO_APIC_route_entry { + __u32 vector : 8, + delivery_mode : 3, /* 000: FIXED +-- +1.7.2.3 + + + diff --git a/test/corpora/lkml/cur/1382298805.004614:2, b/test/corpora/lkml/cur/1382298805.004614:2, new file mode 100644 index 00000000..ce850fff --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004614:2, @@ -0,0 +1,89 @@ +From: Henrik Kretzschmar <henne@nachtwindheim.de> +Subject: [PATCH 2/6] x86: ifdef enable_IR_x2apic() out +Date: Mon, 14 Feb 2011 11:00:08 +0100 +Lines: 48 +Message-ID: <1297677612-12405-2-git-send-email-henne@nachtwindheim.de> +References: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +Cc: tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, tj@kernel.org, + yinghai@kernel.org, ak@linux.intel.com, robert.richter@amd.com, + linux-kernel@vger.kernel.org, henne@nachtwindheim.de +To: mingo@readhat.com +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 11:00:34 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PovEP-0006ED-LT + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 11:00:34 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1752908Ab1BNKA1 (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 14 Feb 2011 05:00:27 -0500 +Received: from server103.greatnet.de ([83.133.97.6]:38321 "EHLO + server103.greatnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752778Ab1BNKAX (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 14 Feb 2011 05:00:23 -0500 +Received: from localhost.localdomain (cmnz-d9bab6be.pool.mediaWays.net [217.186.182.190]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by server103.greatnet.de (Postfix) with ESMTPSA id 1AFC7950DB3; + Mon, 14 Feb 2011 10:59:06 +0100 (CET) +X-Mailer: git-send-email 1.7.1 +In-Reply-To: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099646> + +The only caller of enable_IR_x2apic() is probe_64.c, which is only +compiled on x86-64 bit machines. +This function causes compilation problems on 32-bit machines with no +io-apic enabled, so we remove it from 32s and keep the way it was on 64s. + +Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> +--- + arch/x86/include/asm/apic.h | 2 ++ + arch/x86/kernel/apic/apic.c | 2 +- + 2 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h +index b8a3484..b1d77e1 100644 +--- a/arch/x86/include/asm/apic.h ++++ b/arch/x86/include/asm/apic.h +@@ -216,7 +216,9 @@ static inline void x2apic_force_phys(void) + #define x2apic_supported() 0 + #endif + ++#ifdef CONFIG_X86_64 + extern void enable_IR_x2apic(void); ++#endif + + extern int get_physical_broadcast(void); + +diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c +index 306386f..27a7497 100644 +--- a/arch/x86/kernel/apic/apic.c ++++ b/arch/x86/kernel/apic/apic.c +@@ -1467,6 +1467,7 @@ int __init enable_IR(void) + return 0; + } + ++#ifdef CONFIG_X86_64 + void __init enable_IR_x2apic(void) + { + unsigned long flags; +@@ -1540,7 +1541,6 @@ out: + pr_info("Not enabling x2apic, Intr-remapping init failed.\n"); + } + +-#ifdef CONFIG_X86_64 + /* + * Detect and enable local APICs on non-SMP boards. + * Original code written by Keir Fraser. +-- +1.7.2.3 + + + diff --git a/test/corpora/lkml/cur/1382298805.004615:2, b/test/corpora/lkml/cur/1382298805.004615:2, new file mode 100644 index 00000000..cceabb54 --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004615:2, @@ -0,0 +1,64 @@ +From: Henrik Kretzschmar <henne@nachtwindheim.de> +Subject: [PATCH 4/6] x86: add dummy mp_save_irq() +Date: Mon, 14 Feb 2011 11:00:10 +0100 +Lines: 23 +Message-ID: <1297677612-12405-4-git-send-email-henne@nachtwindheim.de> +References: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +Cc: tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, tj@kernel.org, + yinghai@kernel.org, ak@linux.intel.com, robert.richter@amd.com, + linux-kernel@vger.kernel.org, henne@nachtwindheim.de +To: mingo@readhat.com +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 11:00:36 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PovEQ-0006ED-6t + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 11:00:34 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1752958Ab1BNKA3 (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 14 Feb 2011 05:00:29 -0500 +Received: from server103.greatnet.de ([83.133.97.6]:38321 "EHLO + server103.greatnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752592Ab1BNKAY (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 14 Feb 2011 05:00:24 -0500 +Received: from localhost.localdomain (cmnz-d9bab6be.pool.mediaWays.net [217.186.182.190]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by server103.greatnet.de (Postfix) with ESMTPSA id 4B47D950DB5; + Mon, 14 Feb 2011 10:59:08 +0100 (CET) +X-Mailer: git-send-email 1.7.1 +In-Reply-To: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099647> + +mmparse.c needs a mp_save_irq() function, which is only available +when CONFIG_X86_IO_APIC is defined. So here we give it a dummy one. + +Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> +--- + arch/x86/include/asm/io_apic.h | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h +index e1a9b0e..7af0f5f 100644 +--- a/arch/x86/include/asm/io_apic.h ++++ b/arch/x86/include/asm/io_apic.h +@@ -188,6 +188,7 @@ static inline int mp_find_ioapic(u32 gsi) { return 0; } + struct io_apic_irq_attr; + static inline int io_apic_set_pci_routing(struct device *dev, int irq, + struct io_apic_irq_attr *irq_attr) { return 0; } ++static inline void mp_save_irq(struct mpc_intsrc *m) { } + #endif + + #endif /* _ASM_X86_IO_APIC_H */ +-- +1.7.2.3 + + + diff --git a/test/corpora/lkml/cur/1382298805.004617:2, b/test/corpora/lkml/cur/1382298805.004617:2, new file mode 100644 index 00000000..71f2f1fe --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004617:2, @@ -0,0 +1,67 @@ +From: Henrik Kretzschmar <henne@nachtwindheim.de> +Subject: [PATCH 6/6] x86: makes X86_UP_IOAPIC work again +Date: Mon, 14 Feb 2011 11:00:12 +0100 +Lines: 26 +Message-ID: <1297677612-12405-6-git-send-email-henne@nachtwindheim.de> +References: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +Cc: tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, tj@kernel.org, + yinghai@kernel.org, ak@linux.intel.com, robert.richter@amd.com, + linux-kernel@vger.kernel.org, henne@nachtwindheim.de +To: mingo@readhat.com +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 11:01:26 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PovFD-0006cV-Si + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 11:01:24 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1753137Ab1BNKAo (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 14 Feb 2011 05:00:44 -0500 +Received: from server103.greatnet.de ([83.133.97.6]:38361 "EHLO + server103.greatnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752877Ab1BNKA0 (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 14 Feb 2011 05:00:26 -0500 +Received: from localhost.localdomain (cmnz-d9bab6be.pool.mediaWays.net [217.186.182.190]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by server103.greatnet.de (Postfix) with ESMTPSA id 26BC1950DB7; + Mon, 14 Feb 2011 10:59:10 +0100 (CET) +X-Mailer: git-send-email 1.7.1 +In-Reply-To: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099649> + +This fixes a typo, which made CONFIG_X86_UP_IOAPIC defunctional, +in commit 7cd92366a593246650cc7d6198e2c7d3af8c1d8a. + +This has been successfully tested. + +Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> +--- + arch/x86/Kconfig | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index 95c36c4..66c6801 100644 +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -811,7 +811,7 @@ config X86_LOCAL_APIC + + config X86_IO_APIC + def_bool y +- depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC ++ depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC + + config X86_VISWS_APIC + def_bool y +-- +1.7.2.3 + + + diff --git a/test/corpora/lkml/cur/1382298805.004618:2, b/test/corpora/lkml/cur/1382298805.004618:2, new file mode 100644 index 00000000..620bed13 --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004618:2, @@ -0,0 +1,70 @@ +From: Henrik Kretzschmar <henne@nachtwindheim.de> +Subject: [PATCH 5/6] x86: ifdef ioapic related function out +Date: Mon, 14 Feb 2011 11:00:11 +0100 +Lines: 29 +Message-ID: <1297677612-12405-5-git-send-email-henne@nachtwindheim.de> +References: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +Cc: tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, tj@kernel.org, + yinghai@kernel.org, ak@linux.intel.com, robert.richter@amd.com, + linux-kernel@vger.kernel.org, henne@nachtwindheim.de +To: mingo@readhat.com +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 11:01:27 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PovFE-0006cV-Cn + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 11:01:24 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1753212Ab1BNKAq (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 14 Feb 2011 05:00:46 -0500 +Received: from server103.greatnet.de ([83.133.97.6]:38350 "EHLO + server103.greatnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752841Ab1BNKAZ (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 14 Feb 2011 05:00:25 -0500 +Received: from localhost.localdomain (cmnz-d9bab6be.pool.mediaWays.net [217.186.182.190]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by server103.greatnet.de (Postfix) with ESMTPSA id 37BBE950DB6; + Mon, 14 Feb 2011 10:59:09 +0100 (CET) +X-Mailer: git-send-email 1.7.1 +In-Reply-To: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099650> + +arch_disable_smp_config() is an IO-APIC related function on x86, +and should only be needed if SMP is enabled. +But the IO-APIC code calls it when the parameter "noapic" is given to +the kernel, which doesn't mean SMP is enabled. + +Anyway this fixes compilation on x86_32 UP systems with APIC and no IO-APIC. + +Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> +--- + arch/x86/kernel/apic/apic.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c +index 999c531..4998f0a 100644 +--- a/arch/x86/kernel/apic/apic.c ++++ b/arch/x86/kernel/apic/apic.c +@@ -1218,7 +1218,9 @@ void __cpuinit setup_local_APIC(void) + rdtscll(tsc); + + if (disable_apic) { ++#ifdef CONFIG_X86_IO_APIC + arch_disable_smp_support(); ++#endif + return; + } + +-- +1.7.2.3 + + + diff --git a/test/corpora/lkml/cur/1382298805.004619:2, b/test/corpora/lkml/cur/1382298805.004619:2, new file mode 100644 index 00000000..f7895dda --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004619:2, @@ -0,0 +1,99 @@ +From: Henrik Kretzschmar <henne@nachtwindheim.de> +Subject: [PATCH 3/6] x86: ifdef INTR_REMAP code out +Date: Mon, 14 Feb 2011 11:00:09 +0100 +Lines: 58 +Message-ID: <1297677612-12405-3-git-send-email-henne@nachtwindheim.de> +References: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +Cc: tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, tj@kernel.org, + yinghai@kernel.org, ak@linux.intel.com, robert.richter@amd.com, + linux-kernel@vger.kernel.org, henne@nachtwindheim.de +To: mingo@readhat.com +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 11:01:30 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PovFF-0006cV-Te + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 11:01:26 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1753126Ab1BNKBX (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 14 Feb 2011 05:01:23 -0500 +Received: from server103.greatnet.de ([83.133.97.6]:38330 "EHLO + server103.greatnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752268Ab1BNKAX (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 14 Feb 2011 05:00:23 -0500 +Received: from localhost.localdomain (cmnz-d9bab6be.pool.mediaWays.net [217.186.182.190]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by server103.greatnet.de (Postfix) with ESMTPSA id 29517950DB4; + Mon, 14 Feb 2011 10:59:07 +0100 (CET) +X-Mailer: git-send-email 1.7.1 +In-Reply-To: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099651> + +Interrupt remapping is only available on 64-bit machines, +so it has no place in lapic_resume() for 32bit machines. + +Compilation on 32bit machines would produce errors here. + +Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> +--- + arch/x86/kernel/apic/apic.c | 8 +++++++- + 1 files changed, 7 insertions(+), 1 deletions(-) + +diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c +index 27a7497..999c531 100644 +--- a/arch/x86/kernel/apic/apic.c ++++ b/arch/x86/kernel/apic/apic.c +@@ -2109,12 +2109,15 @@ static int lapic_resume(struct sys_device *dev) + unsigned long flags; + int maxlvt; + int ret = 0; +- struct IO_APIC_route_entry **ioapic_entries = NULL; + + if (!apic_pm_state.active) + return 0; + + local_irq_save(flags); ++ ++#ifdef CONFIG_INTR_REMAP ++ struct IO_APIC_route_entry **ioapic_entries = NULL; ++ + if (intr_remapping_enabled) { + ioapic_entries = alloc_ioapic_entries(); + if (!ioapic_entries) { +@@ -2133,6 +2136,7 @@ static int lapic_resume(struct sys_device *dev) + mask_IO_APIC_setup(ioapic_entries); + legacy_pic->mask_all(); + } ++#endif + + if (x2apic_mode) + enable_x2apic(); +@@ -2173,6 +2177,7 @@ static int lapic_resume(struct sys_device *dev) + apic_write(APIC_ESR, 0); + apic_read(APIC_ESR); + ++#ifdef CONFIG_INTR_REMAP + if (intr_remapping_enabled) { + reenable_intr_remapping(x2apic_mode); + legacy_pic->restore_mask(); +@@ -2180,6 +2185,7 @@ static int lapic_resume(struct sys_device *dev) + free_ioapic_entries(ioapic_entries); + } + restore: ++#endif + local_irq_restore(flags); + + return ret; +-- +1.7.2.3 + + + diff --git a/test/corpora/lkml/cur/1382298805.004636:2, b/test/corpora/lkml/cur/1382298805.004636:2, new file mode 100644 index 00000000..c14d42c9 --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004636:2, @@ -0,0 +1,93 @@ +From: Vasiliy Kulikov <segoon@openwall.com> +Subject: [PATCH] core: dev: don't call BUG() on bad input +Date: Mon, 14 Feb 2011 13:56:06 +0300 +Lines: 36 +Message-ID: <1297680967-11893-1-git-send-email-segoon@openwall.com> +Cc: "David S. Miller" <davem@davemloft.net>, + Eric Dumazet <eric.dumazet@gmail.com>, + Tom Herbert <therbert@google.com>, + Changli Gao <xiaosuo@gmail.com>, + Jesse Gross <jesse@nicira.com>, netdev@vger.kernel.org +To: linux-kernel@vger.kernel.org +X-From: netdev-owner@vger.kernel.org Mon Feb 14 11:56:26 2011 +Return-path: <netdev-owner@vger.kernel.org> +Envelope-to: linux-netdev-2@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <netdev-owner@vger.kernel.org>) + id 1Pow6Q-0007p5-UJ + for linux-netdev-2@lo.gmane.org; Mon, 14 Feb 2011 11:56:23 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1753243Ab1BNK4O (ORCPT <rfc822;linux-netdev-2@m.gmane.org>); + Mon, 14 Feb 2011 05:56:14 -0500 +Received: from mail-bw0-f46.google.com ([209.85.214.46]:60909 "EHLO + mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1752645Ab1BNK4M (ORCPT + <rfc822;netdev@vger.kernel.org>); Mon, 14 Feb 2011 05:56:12 -0500 +Received: by bwz15 with SMTP id 15so5332720bwz.19 + for <multiple recipients>; Mon, 14 Feb 2011 02:56:11 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:sender:from:to:cc:subject:date:message-id + :x-mailer; + bh=YQn7OCqAZuXaSsRtgaQYckH74o43k6Rppt54AR6UzDo=; + b=CxfBmTAbcMf7ySl3szqU/hLEMbY7aJ+FjefneMcTm/AmBnyihy20JuV2k0yYJzcIBi + 9+2npC4H9oJn7/ocVARq88j9ZA/4firOi9ZddgGu6c8+o0tWoZylA1ehtHzzk+4I173l + H8guqK5rplkryj6+PStELYYt36SpAVfaL2EdY= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=sender:from:to:cc:subject:date:message-id:x-mailer; + b=G0AqVbcip2oFA2IqAQa6TWwQydu/mJFzt98tGkR1fVNl3m+HaKY433gNCR+Dqdv0gA + SGL/R3HRiBBBku/GM4x3gQ8SoAFZiREw6PDtkU55l/mk+yS+v+8YTq7/InPxHoHeTWsv + pX0mWUI2HtTXKALBiM+nLsnBWtcC8yInYtyeQ= +Received: by 10.204.61.73 with SMTP id s9mr6247440bkh.185.1297680970948; + Mon, 14 Feb 2011 02:56:10 -0800 (PST) +Received: from localhost (ppp91-77-40-235.pppoe.mtu-net.ru [91.77.40.235]) + by mx.google.com with ESMTPS id u23sm1686152bkw.9.2011.02.14.02.56.09 + (version=TLSv1/SSLv3 cipher=OTHER); + Mon, 14 Feb 2011 02:56:10 -0800 (PST) +X-Mailer: git-send-email 1.7.0.4 +Sender: netdev-owner@vger.kernel.org +Precedence: bulk +List-ID: <netdev.vger.kernel.org> +X-Mailing-List: netdev@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099668> + +alloc_netdev() may be called with too long name (more that IFNAMSIZ bytes). +Currently this leads to BUG(). Other insane inputs (bad txqs, rxqs) and +even OOM don't lead to BUG(). Made alloc_netdev() return NULL, like on +other errors. + +Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> +--- + Compile tested. + + net/core/dev.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/net/core/dev.c b/net/core/dev.c +index 6392ea0..12ef4b0 100644 +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -5761,7 +5761,10 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, + size_t alloc_size; + struct net_device *p; + +- BUG_ON(strlen(name) >= sizeof(dev->name)); ++ if (strnlen(name, sizeof(dev->name)) >= sizeof(dev->name)) { ++ pr_err("alloc_netdev: Too long device name \n"); ++ return NULL; ++ } + + if (txqs < 1) { + pr_err("alloc_netdev: Unable to allocate device " +-- +1.7.0.4 + +-- +To unsubscribe from this list: send the line "unsubscribe netdev" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298805.004638:2, b/test/corpora/lkml/cur/1382298805.004638:2, new file mode 100644 index 00000000..551ce5be --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004638:2, @@ -0,0 +1,88 @@ +From: Ingo Molnar <mingo@elte.hu> +Subject: Re: [PATCH 5/6] x86: ifdef ioapic related function out +Date: Mon, 14 Feb 2011 12:00:39 +0100 +Lines: 34 +Message-ID: <20110214110039.GA7140@elte.hu> +References: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> + <1297677612-12405-5-git-send-email-henne@nachtwindheim.de> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: mingo@readhat.com, tglx@linutronix.de, hpa@zytor.com, + x86@kernel.org, tj@kernel.org, yinghai@kernel.org, + ak@linux.intel.com, robert.richter@amd.com, + linux-kernel@vger.kernel.org +To: Henrik Kretzschmar <henne@nachtwindheim.de> +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 12:01:04 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PowAx-0001Lu-Lk + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 12:01:04 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1752962Ab1BNLA5 (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 14 Feb 2011 06:00:57 -0500 +Received: from mx3.mail.elte.hu ([157.181.1.138]:38470 "EHLO mx3.mail.elte.hu" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1752556Ab1BNLAz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Mon, 14 Feb 2011 06:00:55 -0500 +Received: from elvis.elte.hu ([157.181.1.14]) + by mx3.mail.elte.hu with esmtp (Exim) + id 1PowAd-0003Lr-F7 + from <mingo@elte.hu>; Mon, 14 Feb 2011 12:00:48 +0100 +Received: by elvis.elte.hu (Postfix, from userid 1004) + id 7726F3E236B; Mon, 14 Feb 2011 12:00:41 +0100 (CET) +Content-Disposition: inline +In-Reply-To: <1297677612-12405-5-git-send-email-henne@nachtwindheim.de> +User-Agent: Mutt/1.5.20 (2009-08-17) +Received-SPF: neutral (mx3: 157.181.1.14 is neither permitted nor denied by domain of elte.hu) client-ip=157.181.1.14; envelope-from=mingo@elte.hu; helo=elvis.elte.hu; +X-ELTE-SpamScore: -2.0 +X-ELTE-SpamLevel: +X-ELTE-SpamCheck: no +X-ELTE-SpamVersion: ELTE 2.0 +X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 + -2.0 BAYES_00 BODY: Bayesian spam probability is 0 to 1% + [score: 0.0000] +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099670> + + +* Henrik Kretzschmar <henne@nachtwindheim.de> wrote: + +> arch_disable_smp_config() is an IO-APIC related function on x86, +> and should only be needed if SMP is enabled. +> But the IO-APIC code calls it when the parameter "noapic" is given to +> the kernel, which doesn't mean SMP is enabled. +> +> Anyway this fixes compilation on x86_32 UP systems with APIC and no IO-APIC. +> +> Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> +> --- +> arch/x86/kernel/apic/apic.c | 2 ++ +> 1 files changed, 2 insertions(+), 0 deletions(-) +> +> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c +> index 999c531..4998f0a 100644 +> --- a/arch/x86/kernel/apic/apic.c +> +++ b/arch/x86/kernel/apic/apic.c +> @@ -1218,7 +1218,9 @@ void __cpuinit setup_local_APIC(void) +> rdtscll(tsc); +> +> if (disable_apic) { +> +#ifdef CONFIG_X86_IO_APIC +> arch_disable_smp_support(); +> +#endif + +Why not make the arch_disable_smp_support() call generic in the +arch/x86/include/asm/smp.h file (via an inline helper) and thus +avoid an ugly #ifdef in the .c file? + +Thanks, + + Ingo + + diff --git a/test/corpora/lkml/cur/1382298805.004639:2, b/test/corpora/lkml/cur/1382298805.004639:2, new file mode 100644 index 00000000..56118aa9 --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004639:2, @@ -0,0 +1,95 @@ +From: Ingo Molnar <mingo@elte.hu> +Subject: Re: [PATCH 3/6] x86: ifdef INTR_REMAP code out +Date: Mon, 14 Feb 2011 12:02:31 +0100 +Lines: 41 +Message-ID: <20110214110231.GB7140@elte.hu> +References: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> + <1297677612-12405-3-git-send-email-henne@nachtwindheim.de> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: mingo@readhat.com, tglx@linutronix.de, hpa@zytor.com, + x86@kernel.org, tj@kernel.org, yinghai@kernel.org, + ak@linux.intel.com, robert.richter@amd.com, + linux-kernel@vger.kernel.org +To: Henrik Kretzschmar <henne@nachtwindheim.de> +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 12:02:52 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PowCg-00022G-BR + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 12:02:50 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1752997Ab1BNLCn (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 14 Feb 2011 06:02:43 -0500 +Received: from mx3.mail.elte.hu ([157.181.1.138]:38974 "EHLO mx3.mail.elte.hu" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1751314Ab1BNLCl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Mon, 14 Feb 2011 06:02:41 -0500 +Received: from elvis.elte.hu ([157.181.1.14]) + by mx3.mail.elte.hu with esmtp (Exim) + id 1PowCQ-0003df-Gk + from <mingo@elte.hu>; Mon, 14 Feb 2011 12:02:34 +0100 +Received: by elvis.elte.hu (Postfix, from userid 1004) + id 0D9343E2369; Mon, 14 Feb 2011 12:02:32 +0100 (CET) +Content-Disposition: inline +In-Reply-To: <1297677612-12405-3-git-send-email-henne@nachtwindheim.de> +User-Agent: Mutt/1.5.20 (2009-08-17) +Received-SPF: neutral (mx3: 157.181.1.14 is neither permitted nor denied by domain of elte.hu) client-ip=157.181.1.14; envelope-from=mingo@elte.hu; helo=elvis.elte.hu; +X-ELTE-SpamScore: -2.0 +X-ELTE-SpamLevel: +X-ELTE-SpamCheck: no +X-ELTE-SpamVersion: ELTE 2.0 +X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 + -2.0 BAYES_00 BODY: Bayesian spam probability is 0 to 1% + [score: 0.0000] +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099671> + + +* Henrik Kretzschmar <henne@nachtwindheim.de> wrote: + +> +#ifdef CONFIG_INTR_REMAP +> + struct IO_APIC_route_entry **ioapic_entries = NULL; +> + +> if (intr_remapping_enabled) { +> ioapic_entries = alloc_ioapic_entries(); +> if (!ioapic_entries) { +> @@ -2133,6 +2136,7 @@ static int lapic_resume(struct sys_device *dev) +> mask_IO_APIC_setup(ioapic_entries); +> legacy_pic->mask_all(); +> } +> +#endif +> +> if (x2apic_mode) +> enable_x2apic(); +> @@ -2173,6 +2177,7 @@ static int lapic_resume(struct sys_device *dev) +> apic_write(APIC_ESR, 0); +> apic_read(APIC_ESR); +> +> +#ifdef CONFIG_INTR_REMAP +> if (intr_remapping_enabled) { +> reenable_intr_remapping(x2apic_mode); +> legacy_pic->restore_mask(); +> @@ -2180,6 +2185,7 @@ static int lapic_resume(struct sys_device *dev) +> free_ioapic_entries(ioapic_entries); +> } +> restore: +> +#endif + +Hm, these bits should be factored out in a cleaner fashion - by adding helper +functions, etc. The x2apic code's integration into the lapic code was done in a +pretty ugly fashion so it's not your fault - but if we want to reintroduce UP-IOAPIC +we need to do it cleanly. + +Do you still want to do it? :-) + +Thanks, + + Ingo + + diff --git a/test/corpora/lkml/cur/1382298805.004640:2, b/test/corpora/lkml/cur/1382298805.004640:2, new file mode 100644 index 00000000..af16a62a --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004640:2, @@ -0,0 +1,69 @@ +From: Ingo Molnar <mingo@elte.hu> +Subject: Re: [PATCH 2/6] x86: ifdef enable_IR_x2apic() out +Date: Mon, 14 Feb 2011 12:03:40 +0100 +Lines: 15 +Message-ID: <20110214110340.GC7140@elte.hu> +References: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> + <1297677612-12405-2-git-send-email-henne@nachtwindheim.de> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: mingo@readhat.com, tglx@linutronix.de, hpa@zytor.com, + x86@kernel.org, tj@kernel.org, yinghai@kernel.org, + ak@linux.intel.com, robert.richter@amd.com, + linux-kernel@vger.kernel.org +To: Henrik Kretzschmar <henne@nachtwindheim.de> +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 12:04:03 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PowDr-0002js-9K + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 12:04:03 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1753399Ab1BNLDz (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 14 Feb 2011 06:03:55 -0500 +Received: from mx2.mail.elte.hu ([157.181.151.9]:54341 "EHLO mx2.mail.elte.hu" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1753317Ab1BNLDx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Mon, 14 Feb 2011 06:03:53 -0500 +Received: from elvis.elte.hu ([157.181.1.14]) + by mx2.mail.elte.hu with esmtp (Exim) + id 1PowDY-0002Mp-4N + from <mingo@elte.hu>; Mon, 14 Feb 2011 12:03:45 +0100 +Received: by elvis.elte.hu (Postfix, from userid 1004) + id 458B63E2369; Mon, 14 Feb 2011 12:03:40 +0100 (CET) +Content-Disposition: inline +In-Reply-To: <1297677612-12405-2-git-send-email-henne@nachtwindheim.de> +User-Agent: Mutt/1.5.20 (2009-08-17) +Received-SPF: neutral (mx2.mail.elte.hu: 157.181.1.14 is neither permitted nor denied by domain of elte.hu) client-ip=157.181.1.14; envelope-from=mingo@elte.hu; helo=elvis.elte.hu; +X-ELTE-SpamScore: -2.0 +X-ELTE-SpamLevel: +X-ELTE-SpamCheck: no +X-ELTE-SpamVersion: ELTE 2.0 +X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 + -2.0 BAYES_00 BODY: Bayesian spam probability is 0 to 1% + [score: 0.0000] +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099672> + + + +* Henrik Kretzschmar <henne@nachtwindheim.de> wrote: + +> +#ifdef CONFIG_X86_64 +> extern void enable_IR_x2apic(void); +> +#endif + +Cannot we use the CONFIG_X86_X2APIC Kconfig switch here, instead of CONFIG_X86_64? + +enable_IR_x2apic() is not a 64-bit CPU feature. + +Thanks, + + Ingo + + diff --git a/test/corpora/lkml/cur/1382298805.004642:2, b/test/corpora/lkml/cur/1382298805.004642:2, new file mode 100644 index 00000000..ce8ac112 --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004642:2, @@ -0,0 +1,93 @@ +From: Ingo Molnar <mingo@elte.hu> +Subject: Re: [PATCH 1/6] x86: move ioapic_irq_destination_types +Date: Mon, 14 Feb 2011 12:05:28 +0100 +Lines: 40 +Message-ID: <20110214110528.GD7140@elte.hu> +References: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: mingo@readhat.com, tglx@linutronix.de, hpa@zytor.com, + x86@kernel.org, tj@kernel.org, yinghai@kernel.org, + ak@linux.intel.com, robert.richter@amd.com, + linux-kernel@vger.kernel.org +To: Henrik Kretzschmar <henne@nachtwindheim.de> +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 12:06:00 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PowFj-0003bW-W9 + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 12:06:00 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1753317Ab1BNLFq (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 14 Feb 2011 06:05:46 -0500 +Received: from mx3.mail.elte.hu ([157.181.1.138]:46158 "EHLO mx3.mail.elte.hu" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1752958Ab1BNLFn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); + Mon, 14 Feb 2011 06:05:43 -0500 +Received: from elvis.elte.hu ([157.181.1.14]) + by mx3.mail.elte.hu with esmtp (Exim) + id 1PowFH-0003wc-2d + from <mingo@elte.hu>; Mon, 14 Feb 2011 12:05:36 +0100 +Received: by elvis.elte.hu (Postfix, from userid 1004) + id 30C323E2369; Mon, 14 Feb 2011 12:05:27 +0100 (CET) +Content-Disposition: inline +In-Reply-To: <1297677612-12405-1-git-send-email-henne@nachtwindheim.de> +User-Agent: Mutt/1.5.20 (2009-08-17) +Received-SPF: neutral (mx3: 157.181.1.14 is neither permitted nor denied by domain of elte.hu) client-ip=157.181.1.14; envelope-from=mingo@elte.hu; helo=elvis.elte.hu; +X-ELTE-SpamScore: -2.0 +X-ELTE-SpamLevel: +X-ELTE-SpamCheck: no +X-ELTE-SpamVersion: ELTE 2.0 +X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 + -2.0 BAYES_00 BODY: Bayesian spam probability is 0 to 1% + [score: 0.0000] +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099674> + + +* Henrik Kretzschmar <henne@nachtwindheim.de> wrote: + +> +++ b/arch/x86/include/asm/apicdef.h +> @@ -426,4 +426,16 @@ struct local_apic { +> #else +> #define BAD_APICID 0xFFFFu +> #endif +> + +> +enum ioapic_irq_destination_types { +> + dest_Fixed = 0, +> + dest_LowestPrio = 1, +> + dest_SMI = 2, +> + dest__reserved_1 = 3, +> + dest_NMI = 4, +> + dest_INIT = 5, +> + dest__reserved_2 = 6, +> + dest_ExtINT = 7 +> +}; + +one very small request, while we are moving it could you please align the value +enumeration vertically? Something like: + +enum ioapic_irq_destination_types { + + dest_Fixed = 0, + dest_LowestPrio = 1, + dest_SMI = 2, + dest__reserved_1 = 3, + dest_NMI = 4, + dest_INIT = 5, + dest__reserved_2 = 6, + dest_ExtINT = 7 +}; + +... would be much more readable, right? + +Thanks, + + Ingo + + diff --git a/test/corpora/lkml/cur/1382298805.004653:2, b/test/corpora/lkml/cur/1382298805.004653:2, new file mode 100644 index 00000000..d6bd8d14 --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004653:2, @@ -0,0 +1,90 @@ +From: Catalin Marinas <catalin.marinas@arm.com> +Subject: Re: [PATCH] ARM: vfp: Always save VFP state in vfp_pm_suspend +Date: Mon, 14 Feb 2011 11:42:22 +0000 +Organization: ARM Limited +Lines: 43 +Message-ID: <1297683742.30092.11.camel@e102109-lin.cambridge.arm.com> +References: <1297638813-1315-1-git-send-email-ccross@android.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8BIT +Cc: linux-arm-kernel@lists.infradead.org, + Russell King <linux@arm.linux.org.uk>, + linux-kernel@vger.kernel.org +To: Colin Cross <ccross@android.com> +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 12:42:45 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1PowpJ-00069R-8c + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 12:42:45 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1753535Ab1BNLmi (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 14 Feb 2011 06:42:38 -0500 +Received: from service87.mimecast.com ([94.185.240.25]:56758 "HELO + service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with SMTP id S1752997Ab1BNLmg convert rfc822-to-8bit (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 14 Feb 2011 06:42:36 -0500 +Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) + by service87.mimecast.com; + Mon, 14 Feb 2011 11:42:31 +0000 +Received: from [10.1.77.95] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); + Mon, 14 Feb 2011 11:42:28 +0000 +In-Reply-To: <1297638813-1315-1-git-send-email-ccross@android.com> +X-Mailer: Evolution 2.28.1 +X-OriginalArrivalTime: 14 Feb 2011 11:42:28.0658 (UTC) FILETIME=[41F09120:01CBCC3C] +X-MC-Unique: 111021411423105201 +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099685> + +On Sun, 2011-02-13 at 23:13 +0000, Colin Cross wrote: +> vfp_pm_suspend should save the VFP state any time there is +> a last_VFP_context. If it only saves when the VFP is enabled, +> the state can get lost when, on a UP system: +> Thread 1 uses the VFP +> Context switch occurs to thread 2, VFP is disabled but the +> VFP context is not saved to allow lazy save and restore +> Thread 2 initiates suspend +> vfp_pm_suspend is called with the VFP disabled, but the +> context has not been saved. + +At this point is it guaranteed that the thread won't migrate to another +CPU? If not, we should use get/put_cpu. + +> --- a/arch/arm/vfp/vfpmodule.c +> +++ b/arch/arm/vfp/vfpmodule.c +> @@ -415,13 +415,12 @@ static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state) +> struct thread_info *ti = current_thread_info(); +> u32 fpexc = fmrx(FPEXC); +> +> - /* if vfp is on, then save state for resumption */ +> - if (fpexc & FPEXC_EN) { +> + /* save state for resume */ +> + if (last_VFP_context[ti->cpu]) { +> printk(KERN_DEBUG "%s: saving vfp state\n", __func__); +> - vfp_save_state(&ti->vfpstate, fpexc); +> - +> - /* disable, just in case */ +> - fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN); +> + fmxr(FPEXC, fpexc | FPEXC_EN); +> + vfp_save_state(last_VFP_context[ti->cpu], fpexc); +> + fmxr(FPEXC, fpexc & ~FPEXC_EN); +> } + +We may want to set the last_VFP_context to NULL so that after resuming +(to the same thread) we force the VFP reload from the vfpstate +structure. The vfp_support_entry code ignores the reloading if the +last_VFP_context is the same as vfpstate. + +-- +Catalin + + + + diff --git a/test/corpora/lkml/cur/1382298805.004665:2, b/test/corpora/lkml/cur/1382298805.004665:2, new file mode 100644 index 00000000..bfba805a --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004665:2, @@ -0,0 +1,121 @@ +From: =?ISO-8859-1?Q?Nicolas_de_Peslo=FCan?= + <nicolas.2p.debian@gmail.com> +Subject: Re: [PATCH] core: dev: don't call BUG() on bad input +Date: Mon, 14 Feb 2011 13:16:04 +0100 +Lines: 54 +Message-ID: <4D591D04.4050000@gmail.com> +References: <1297680967-11893-1-git-send-email-segoon@openwall.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; + format=flowed +Content-Transfer-Encoding: QUOTED-PRINTABLE +Cc: linux-kernel@vger.kernel.org, + "David S. Miller" <davem@davemloft.net>, + Eric Dumazet <eric.dumazet@gmail.com>, + Tom Herbert <therbert@google.com>, + Changli Gao <xiaosuo@gmail.com>, + Jesse Gross <jesse@nicira.com>, netdev@vger.kernel.org +To: Vasiliy Kulikov <segoon@openwall.com> +X-From: netdev-owner@vger.kernel.org Mon Feb 14 13:16:23 2011 +Return-path: <netdev-owner@vger.kernel.org> +Envelope-to: linux-netdev-2@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <netdev-owner@vger.kernel.org>) + id 1PoxLn-0007s8-Rx + for linux-netdev-2@lo.gmane.org; Mon, 14 Feb 2011 13:16:20 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1753819Ab1BNMQQ convert rfc822-to-quoted-printable (ORCPT + <rfc822;linux-netdev-2@m.gmane.org>); Mon, 14 Feb 2011 07:16:16 -0500 +Received: from mail-bw0-f46.google.com ([209.85.214.46]:53692 "EHLO + mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1753690Ab1BNMQO (ORCPT + <rfc822;netdev@vger.kernel.org>); Mon, 14 Feb 2011 07:16:14 -0500 +Received: by bwz15 with SMTP id 15so5395788bwz.19 + for <multiple recipients>; Mon, 14 Feb 2011 04:16:13 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:message-id:date:from:user-agent:mime-version:to + :cc:subject:references:in-reply-to:content-type + :content-transfer-encoding; + bh=xx3YxuXgqhBANV8wzcWyUMECJelpRfdmoRSp1AKdYdc=; + b=N0KOUEiWNDJjbwFsNkzabK7eGUNcoUNkqBGVRMNJFQ1jIgKtMC9sXdcmSFkLf2G3W0 + zzRsPc9T6wnstCSnGFjIStR1GQK4bQ7o7SC+bmV0UqsBQAMW8sdDkT20PMZlBl2X7PkF + a2TGrPtJKfEcGFXay9Xo1ZMu1aYODhlRfsZKo= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=message-id:date:from:user-agent:mime-version:to:cc:subject + :references:in-reply-to:content-type:content-transfer-encoding; + b=vyCGwBn8dYUhOjmcV0am255nAUilQntfBxUI4yId3MocKlSBfEE0jJCJIVDySIAYOj + 4g7FzXDeqZ5brwXgwA1derVfTXYvhKUC/60QA9/377l/PZ0vvRfqyPQcinMoOSCc+Kvv + vnBZtq/Kr+D4nUnefIwwjJ/dXS3dGjFBvis6w= +Received: by 10.204.98.65 with SMTP id p1mr25300616bkn.198.1297685772974; + Mon, 14 Feb 2011 04:16:12 -0800 (PST) +Received: from [192.168.0.101] (eab95-4-88-175-177-37.fbx.proxad.net [88.175.177.37]) + by mx.google.com with ESMTPS id a17sm1733557bku.23.2011.02.14.04.16.07 + (version=SSLv3 cipher=OTHER); + Mon, 14 Feb 2011 04:16:09 -0800 (PST) +User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101226 Icedove/3.0.11 +In-Reply-To: <1297680967-11893-1-git-send-email-segoon@openwall.com> +Sender: netdev-owner@vger.kernel.org +Precedence: bulk +List-ID: <netdev.vger.kernel.org> +X-Mailing-List: netdev@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099697> + +Le 14/02/2011 11:56, Vasiliy Kulikov a =E9crit : +> alloc_netdev() may be called with too long name (more that IFNAMSIZ b= +ytes). +> Currently this leads to BUG(). Other insane inputs (bad txqs, rxqs) = +and +> even OOM don't lead to BUG(). Made alloc_netdev() return NULL, like = +on +> other errors. +> +> Signed-off-by: Vasiliy Kulikov<segoon@openwall.com> +> --- +> Compile tested. +> +> net/core/dev.c | 5 ++++- +> 1 files changed, 4 insertions(+), 1 deletions(-) +> +> diff --git a/net/core/dev.c b/net/core/dev.c +> index 6392ea0..12ef4b0 100644 +> --- a/net/core/dev.c +> +++ b/net/core/dev.c +> @@ -5761,7 +5761,10 @@ struct net_device *alloc_netdev_mqs(int sizeof= +_priv, const char *name, +> size_t alloc_size; +> struct net_device *p; +> +> - BUG_ON(strlen(name)>=3D sizeof(dev->name)); +> + if (strnlen(name, sizeof(dev->name))>=3D sizeof(dev->name)) { + +"size_t strnlen(const char *s, size_t maxlen) : The strnlen() function = +returns strlen(s), if that is=20 +less than maxlen, or maxlen if there is no '\0' character among the fir= +st maxlen characters pointed=20 +to by s." + +How can strnlen(name, sizeof(dev->name)) be greater than sizeof(dev->na= +me)? + +Shouldn't it be "if (strnlen(name, sizeof(dev->name)) =3D=3D sizeof(dev= +->name))" instead? + + Nicolas. + +> + pr_err("alloc_netdev: Too long device name \n"); +> + return NULL; +> + } +> +> if (txqs< 1) { +> pr_err("alloc_netdev: Unable to allocate device " + +-- +To unsubscribe from this list: send the line "unsubscribe netdev" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298805.004680:2, b/test/corpora/lkml/cur/1382298805.004680:2, new file mode 100644 index 00000000..e0e74ce2 --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004680:2, @@ -0,0 +1,103 @@ +From: Vasiliy Kulikov <segoon@openwall.com> +Subject: Re: [PATCH] core: dev: don't call BUG() on bad input +Date: Mon, 14 Feb 2011 15:23:13 +0300 +Lines: 34 +Message-ID: <20110214122313.GA10062@albatros> +References: <1297680967-11893-1-git-send-email-segoon@openwall.com> + <4D591D04.4050000@gmail.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: QUOTED-PRINTABLE +Cc: linux-kernel@vger.kernel.org, + "David S. Miller" <davem@davemloft.net>, + Eric Dumazet <eric.dumazet@gmail.com>, + Tom Herbert <therbert@google.com>, + Changli Gao <xiaosuo@gmail.com>, + Jesse Gross <jesse@nicira.com>, netdev@vger.kernel.org +To: Nicolas de =?iso-8859-1?Q?Peslo=FCan?= + <nicolas.2p.debian@gmail.com> +X-From: netdev-owner@vger.kernel.org Mon Feb 14 13:24:40 2011 +Return-path: <netdev-owner@vger.kernel.org> +Envelope-to: linux-netdev-2@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <netdev-owner@vger.kernel.org>) + id 1PoxTr-00046W-DE + for linux-netdev-2@lo.gmane.org; Mon, 14 Feb 2011 13:24:39 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1754719Ab1BNMXX convert rfc822-to-quoted-printable (ORCPT + <rfc822;linux-netdev-2@m.gmane.org>); Mon, 14 Feb 2011 07:23:23 -0500 +Received: from mail-bw0-f46.google.com ([209.85.214.46]:64487 "EHLO + mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1754086Ab1BNMXU (ORCPT + <rfc822;netdev@vger.kernel.org>); Mon, 14 Feb 2011 07:23:20 -0500 +Received: by bwz15 with SMTP id 15so5401470bwz.19 + for <multiple recipients>; Mon, 14 Feb 2011 04:23:18 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:sender:date:from:to:cc:subject:message-id + :references:mime-version:content-type:content-disposition + :content-transfer-encoding:in-reply-to:user-agent; + bh=4cv3J11meWILtVQ6Drgqk74suEYFVRQKnvtS62ZKPMU=; + b=oson8MDOPhFFO5h9lGEmq3EcDJ7bfOy60AsJ8ka5Q45h/Fg5LvGyVGBWB48YesHBg+ + 51Kdb4VrtCWazj2/c1Eauv2jvrGXUjj1hZdo3Rq0jZb5eU+Nvf+7Gl8nWE1S47XmT8YW + ed9CdFnNDgvkVUw+Rg48e2nG79kDRNUGWlpKI= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=sender:date:from:to:cc:subject:message-id:references:mime-version + :content-type:content-disposition:content-transfer-encoding + :in-reply-to:user-agent; + b=lEIU6CLzqKxhpDXukIqjR49CQZ370NKAkb0Aah7A1uyEdLZ9ctYpgg1oPjsQX/V9IR + TqyIP0zocVjBhUgCi32M9DPe/qjiqe+YS+EXNGLMMrF1oEUY+yFfq1jChaHkk2xuf/EM + MaGyK3svEz1q2iV1bgkTLcXCLWyK+A/M1WFlg= +Received: by 10.204.80.161 with SMTP id t33mr15020786bkk.121.1297686197182; + Mon, 14 Feb 2011 04:23:17 -0800 (PST) +Received: from localhost (ppp91-77-40-235.pppoe.mtu-net.ru [91.77.40.235]) + by mx.google.com with ESMTPS id w3sm1684029bkt.5.2011.02.14.04.23.14 + (version=TLSv1/SSLv3 cipher=OTHER); + Mon, 14 Feb 2011 04:23:16 -0800 (PST) +Content-Disposition: inline +In-Reply-To: <4D591D04.4050000@gmail.com> +User-Agent: Mutt/1.5.20 (2009-06-14) +Sender: netdev-owner@vger.kernel.org +Precedence: bulk +List-ID: <netdev.vger.kernel.org> +X-Mailing-List: netdev@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099712> + +Hi Nicolas, + +On Mon, Feb 14, 2011 at 13:16 +0100, Nicolas de Peslo=FCan wrote: +> >- BUG_ON(strlen(name)>=3D sizeof(dev->name)); +> >+ if (strnlen(name, sizeof(dev->name))>=3D sizeof(dev->name)) { + +Ehh... Space after ")" is needed :) + +> "size_t strnlen(const char *s, size_t maxlen) : The strnlen() +> function returns strlen(s), if that is less than maxlen, or maxlen +> if there is no '\0' character among the first maxlen characters +> pointed to by s." +>=20 +> How can strnlen(name, sizeof(dev->name)) be greater than sizeof(dev->= +name)? +>=20 +> Shouldn't it be "if (strnlen(name, sizeof(dev->name)) =3D=3D sizeof(d= +ev->name))" instead? + +Not a big deal, but MO it's better to guard from everything that +is not a good input by negating the check. strnlen() < sizeof() is OK, +strnlen() >=3D sizeof() is bad. Is "=3D=3D" more preferable for net/ c= +oding style? + + +--=20 +Vasiliy Kulikov +http://www.openwall.com - bringing security into open computing environ= +ments +-- +To unsubscribe from this list: send the line "unsubscribe netdev" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298805.004688:2, b/test/corpora/lkml/cur/1382298805.004688:2, new file mode 100644 index 00000000..dd935b6b --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004688:2, @@ -0,0 +1,107 @@ +From: =?ISO-8859-1?Q?Nicolas_de_Peslo=FCan?= + <nicolas.2p.debian@gmail.com> +Subject: Re: [PATCH] core: dev: don't call BUG() on bad input +Date: Mon, 14 Feb 2011 14:01:44 +0100 +Lines: 40 +Message-ID: <4D5927B8.2070704@gmail.com> +References: <1297680967-11893-1-git-send-email-segoon@openwall.com> <4D591D04.4050000@gmail.com> <20110214122313.GA10062@albatros> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; + format=flowed +Content-Transfer-Encoding: QUOTED-PRINTABLE +Cc: linux-kernel@vger.kernel.org, + "David S. Miller" <davem@davemloft.net>, + Eric Dumazet <eric.dumazet@gmail.com>, + Tom Herbert <therbert@google.com>, + Changli Gao <xiaosuo@gmail.com>, + Jesse Gross <jesse@nicira.com>, netdev@vger.kernel.org +To: Vasiliy Kulikov <segoon@openwall.com> +X-From: netdev-owner@vger.kernel.org Mon Feb 14 14:02:23 2011 +Return-path: <netdev-owner@vger.kernel.org> +Envelope-to: linux-netdev-2@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <netdev-owner@vger.kernel.org>) + id 1Poy4M-0006df-J5 + for linux-netdev-2@lo.gmane.org; Mon, 14 Feb 2011 14:02:22 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1754233Ab1BNNBu convert rfc822-to-quoted-printable (ORCPT + <rfc822;linux-netdev-2@m.gmane.org>); Mon, 14 Feb 2011 08:01:50 -0500 +Received: from mail-fx0-f46.google.com ([209.85.161.46]:54545 "EHLO + mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1753647Ab1BNNBs (ORCPT + <rfc822;netdev@vger.kernel.org>); Mon, 14 Feb 2011 08:01:48 -0500 +Received: by fxm20 with SMTP id 20so5178314fxm.19 + for <multiple recipients>; Mon, 14 Feb 2011 05:01:47 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:message-id:date:from:user-agent:mime-version:to + :cc:subject:references:in-reply-to:content-type + :content-transfer-encoding; + bh=AbxlHNh3L+hBj6Vij/+GRK5xyYUXmvKoB1QZLa2ZBj0=; + b=b/GQO7FpiFoh6WrR9d9qEW2Q1ZOK0YtYzl/fLoXZS49QbuYiuExhWkohPnHsdH/n7s + liu8crpx1n3Ajna/7GX1mHBP6V4lfhH+NyF0Rmw3w+fx154lFiY9dbyPX7H9MZNdW60a + 8TmPRR356gmV+7bijgKwyMN1FRVMPNV0Zg0i8= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=message-id:date:from:user-agent:mime-version:to:cc:subject + :references:in-reply-to:content-type:content-transfer-encoding; + b=C+hWB2Aof37xOLi8SWuN+D3QsDtf/f4yCxcLrNGhRYytyr/7CUmq/rS7PpgnfvBVBr + yaKwVZXs7QRxIWbPnzmV38e1K+eUwZ+dd9XuEFN1dnXd5KJVv4CjWr2N84NIHx/NvOBL + 7QYK5+DuuRaccybcS4xWMNK8mujh9ebSBXTgM= +Received: by 10.223.87.1 with SMTP id u1mr4464553fal.112.1297688507260; + Mon, 14 Feb 2011 05:01:47 -0800 (PST) +Received: from [192.168.0.101] (eab95-4-88-175-177-37.fbx.proxad.net [88.175.177.37]) + by mx.google.com with ESMTPS id y3sm1031898fai.38.2011.02.14.05.01.45 + (version=SSLv3 cipher=OTHER); + Mon, 14 Feb 2011 05:01:46 -0800 (PST) +User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101226 Icedove/3.0.11 +In-Reply-To: <20110214122313.GA10062@albatros> +Sender: netdev-owner@vger.kernel.org +Precedence: bulk +List-ID: <netdev.vger.kernel.org> +X-Mailing-List: netdev@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099723> + +Le 14/02/2011 13:23, Vasiliy Kulikov a =E9crit : +> Hi Nicolas, + +Hi Vasiliy, + +> On Mon, Feb 14, 2011 at 13:16 +0100, Nicolas de Peslo=FCan wrote: +>>> - BUG_ON(strlen(name)>=3D sizeof(dev->name)); +>>> + if (strnlen(name, sizeof(dev->name))>=3D sizeof(dev->name)) { +> +> Ehh... Space after ")" is needed :) + +:-D + +>> "size_t strnlen(const char *s, size_t maxlen) : The strnlen() +>> function returns strlen(s), if that is less than maxlen, or maxlen +>> if there is no '\0' character among the first maxlen characters +>> pointed to by s." +>> +>> How can strnlen(name, sizeof(dev->name)) be greater than sizeof(dev-= +>name)? +>> +>> Shouldn't it be "if (strnlen(name, sizeof(dev->name)) =3D=3D sizeof(= +dev->name))" instead? +> +> Not a big deal, but MO it's better to guard from everything that +> is not a good input by negating the check. strnlen()< sizeof() is O= +K, +> strnlen()>=3D sizeof() is bad. Is "=3D=3D" more preferable for net/ = +coding style? + +Agreed, both cannot cause any troubles. =3D=3D is supposed to be better= + from the API point of view, but=20 + >=3D is probably more readable. + + Nicolas. +-- +To unsubscribe from this list: send the line "unsubscribe netdev" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + + + diff --git a/test/corpora/lkml/cur/1382298805.004906:2, b/test/corpora/lkml/cur/1382298805.004906:2, new file mode 100644 index 00000000..fb3510a2 --- /dev/null +++ b/test/corpora/lkml/cur/1382298805.004906:2, @@ -0,0 +1,125 @@ +From: Colin Cross <ccross@android.com> +Subject: Re: [PATCH] ARM: vfp: Always save VFP state in vfp_pm_suspend +Date: Mon, 14 Feb 2011 10:35:37 -0800 +Lines: 50 +Message-ID: <AANLkTik_Jey_PtRmr530FVckA6RXHESeX+CyoJC=ZTkR@mail.gmail.com> +References: <1297638813-1315-1-git-send-email-ccross@android.com> + <1297683742.30092.11.camel@e102109-lin.cambridge.arm.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: QUOTED-PRINTABLE +Cc: linux-arm-kernel@lists.infradead.org, + Russell King <linux@arm.linux.org.uk>, + linux-kernel@vger.kernel.org +To: Catalin Marinas <catalin.marinas@arm.com> +X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 19:36:14 2011 +Return-path: <linux-kernel-owner@vger.kernel.org> +Envelope-to: glk-linux-kernel-3@lo.gmane.org +Received: from vger.kernel.org ([209.132.180.67]) + by lo.gmane.org with esmtp (Exim 4.69) + (envelope-from <linux-kernel-owner@vger.kernel.org>) + id 1Pp3HR-0002ph-ME + for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 19:36:14 +0100 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1751716Ab1BNSf7 convert rfc822-to-quoted-printable (ORCPT + <rfc822;glk-linux-kernel-3@m.gmane.org>); + Mon, 14 Feb 2011 13:35:59 -0500 +Received: from smtp-out.google.com ([74.125.121.67]:16138 "EHLO + smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1751472Ab1BNSf5 convert rfc822-to-8bit (ORCPT + <rfc822;linux-kernel@vger.kernel.org>); + Mon, 14 Feb 2011 13:35:57 -0500 +Received: from kpbe14.cbf.corp.google.com (kpbe14.cbf.corp.google.com [172.25.105.78]) + by smtp-out.google.com with ESMTP id p1EIZtnZ010066 + for <linux-kernel@vger.kernel.org>; Mon, 14 Feb 2011 10:35:55 -0800 +DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; + t=1297708556; bh=zHQvHco6EycqYjYMR9YZftpchts=; + h=MIME-Version:Sender:In-Reply-To:References:Date:Message-ID: + Subject:From:To:Cc:Content-Type:Content-Transfer-Encoding; + b=vMdLxEMc5VUxTbXeXOfO9iAKtgTlVwOwZrVZEhG7GNUReOYWZKzblAuPHuJUWHr5q + 8s7bNLIdGKiRH4q28mv9w== +Received: from vws17 (vws17.prod.google.com [10.241.21.145]) + by kpbe14.cbf.corp.google.com with ESMTP id p1EIYaTC004311 + (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) + for <linux-kernel@vger.kernel.org>; Mon, 14 Feb 2011 10:35:54 -0800 +Received: by vws17 with SMTP id 17so3300387vws.2 + for <linux-kernel@vger.kernel.org>; Mon, 14 Feb 2011 10:35:54 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=beta; + h=domainkey-signature:mime-version:sender:in-reply-to:references:date + :x-google-sender-auth:message-id:subject:from:to:cc:content-type + :content-transfer-encoding; + bh=FyW95sl8WRQv1ev+TqjP0gzPcCabtWdW1//GAc6oFnY=; + b=MNkyYY1htITiUX23N5enGCjsYq2mGBCW4BadxXMha/29ZeIyVP6jrUHlViT88u79RG + SxLMzz7lijwW38xTiBfw== +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=google.com; s=beta; + h=mime-version:sender:in-reply-to:references:date + :x-google-sender-auth:message-id:subject:from:to:cc:content-type + :content-transfer-encoding; + b=Lio4jom4+RruCzH/a6zheXvUcTpZvSX7eMk6Ld1+PQQybP02I0+Cv4+PgGac2GoAYX + tXciu0c/KOGts2phbyMg== +Received: by 10.220.94.201 with SMTP id a9mr1430388vcn.56.1297708537386; Mon, + 14 Feb 2011 10:35:37 -0800 (PST) +Received: by 10.220.43.142 with HTTP; Mon, 14 Feb 2011 10:35:37 -0800 (PST) +In-Reply-To: <1297683742.30092.11.camel@e102109-lin.cambridge.arm.com> +X-Google-Sender-Auth: 47_39DbBbWrnAh28bpWvfpwmbLw +X-System-Of-Record: true +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-kernel.vger.kernel.org> +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099943> + +On Mon, Feb 14, 2011 at 3:42 AM, Catalin Marinas +<catalin.marinas@arm.com> wrote: +> On Sun, 2011-02-13 at 23:13 +0000, Colin Cross wrote: +>> vfp_pm_suspend should save the VFP state any time there is +>> a last_VFP_context. =A0If it only saves when the VFP is enabled, +>> the state can get lost when, on a UP system: +>> =A0 =A0Thread 1 uses the VFP +>> =A0 =A0Context switch occurs to thread 2, VFP is disabled but the +>> =A0 =A0 =A0 VFP context is not saved to allow lazy save and restore +>> =A0 =A0Thread 2 initiates suspend +>> =A0 =A0vfp_pm_suspend is called with the VFP disabled, but the +>> =A0 =A0 =A0 context has not been saved. +> +> At this point is it guaranteed that the thread won't migrate to anoth= +er +> CPU? If not, we should use get/put_cpu. + +Yes, VFP suspend is implemented with a sysdev, which is suspended +after disable_nonboot_cpus. + +>> --- a/arch/arm/vfp/vfpmodule.c +>> +++ b/arch/arm/vfp/vfpmodule.c +>> @@ -415,13 +415,12 @@ static int vfp_pm_suspend(struct sys_device *d= +ev, pm_message_t state) +>> =A0 =A0 =A0 =A0 struct thread_info *ti =3D current_thread_info(); +>> =A0 =A0 =A0 =A0 u32 fpexc =3D fmrx(FPEXC); +>> +>> - =A0 =A0 =A0 /* if vfp is on, then save state for resumption */ +>> - =A0 =A0 =A0 if (fpexc & FPEXC_EN) { +>> + =A0 =A0 =A0 /* save state for resume */ +>> + =A0 =A0 =A0 if (last_VFP_context[ti->cpu]) { +>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_DEBUG "%s: saving vfp st= +ate\n", __func__); +>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 vfp_save_state(&ti->vfpstate, fpexc); +>> - +>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* disable, just in case */ +>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN); +>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 fmxr(FPEXC, fpexc | FPEXC_EN); +>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 vfp_save_state(last_VFP_context[ti->cp= +u], fpexc); +>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 fmxr(FPEXC, fpexc & ~FPEXC_EN); +>> =A0 =A0 =A0 =A0 } +> +> We may want to set the last_VFP_context to NULL so that after resumin= +g +> (to the same thread) we force the VFP reload from the vfpstate +> structure. The vfp_support_entry code ignores the reloading if the +> last_VFP_context is the same as vfpstate. + +Right, will fix. + + diff --git a/test/corpora/threading/ghost-root/1529425589.M615261P21663.len:2,S b/test/corpora/threading/ghost-root/1529425589.M615261P21663.len:2,S new file mode 100644 index 00000000..62bf98db --- /dev/null +++ b/test/corpora/threading/ghost-root/1529425589.M615261P21663.len:2,S @@ -0,0 +1,9 @@ +From: Gregor Zattler <g.zattler@xxxxxxx-xxxxxxxxx.de> +To: xxx request tracker <rt-xxx@xxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de> +Subject: FYI: xxxx xxxxxxx xxxxxxxxxxxx xxx +Date: Tue, 19 Jun 2016 18:26:26 +0200 +Message-ID: <87bmc6lp3h.fsf@len.workgroup> +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable + diff --git a/test/corpora/threading/ghost-root/1532672447.R3166642290392477575.len:2,S b/test/corpora/threading/ghost-root/1532672447.R3166642290392477575.len:2,S new file mode 100644 index 00000000..b79eaf7a --- /dev/null +++ b/test/corpora/threading/ghost-root/1532672447.R3166642290392477575.len:2,S @@ -0,0 +1,17 @@ +Return-Path: <prvs=701fd58e1=www-data@support.xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de> +Subject: [support.xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de #33575] AutoReply: FYI: xxxx xxxxxxx xxxxxxxxxxxx xxx +From: " via RT" <rt-xxx@xxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de> +Reply-To: rt-xxx@xxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de +In-Reply-To: <87bmc6lp3h.fsf@len.workgroup> +References: <RT-Ticket-33575@xxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de> + <87bmc6lp3h.fsf@len.workgroup> +Message-ID: <rt-4.2.8-22046-1529425595-591.33575-211-0@xxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de> +To: g.zattler@xxxxxxx-xxxxxxxxx.de +Content-Type: text/plain; charset="utf-8" +Date: Tue, 19 Jun 2016 18:26:36 +0200 +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit + + + + diff --git a/test/corpora/threading/ghost-root/1532672447.R6968667928580738175.len:2,S b/test/corpora/threading/ghost-root/1532672447.R6968667928580738175.len:2,S new file mode 100644 index 00000000..343a855e --- /dev/null +++ b/test/corpora/threading/ghost-root/1532672447.R6968667928580738175.len:2,S @@ -0,0 +1,18 @@ +Return-Path: <prvs=708ebe06b=www-data@support.xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de> +Subject: [support.xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de #33575] Resolved: FYI: xxxx xxxxxxx xxxxxxxxxxxx xxx +From: " via RT" <rt-xxx@xxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de> +Reply-To: rt-xxx@xxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de +References: <RT-Ticket-33575@xxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de> +Message-ID: <rt-4.2.8-6644-1530017064-1465.33575-215-0@xxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de> +To: g.zattler@xxxxxxx-xxxxxxxxx.de +Content-Type: text/plain; charset="utf-8" +Date: Tue, 26 Jun 2016 14:44:24 +0200 +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit + + + + +According to our records, your request has been resolved. If you have any +further questions or concerns, please respond to this message. + diff --git a/test/corpora/threading/ghost-root/child b/test/corpora/threading/ghost-root/child new file mode 100644 index 00000000..4c36af95 --- /dev/null +++ b/test/corpora/threading/ghost-root/child @@ -0,0 +1,9 @@ +From: Alice <alice@example.org> +To: Daniel <daniel@example.org> +Subject: child message +Message-ID: <001-child@example.org> +In-Reply-To: <000-real-root@example.org> +References: <000-real-root@example.org> +Date: Fri, 17 Jun 2016 22:14:41 -0400 + + diff --git a/test/corpora/threading/ghost-root/fake-root b/test/corpora/threading/ghost-root/fake-root new file mode 100644 index 00000000..a698185d --- /dev/null +++ b/test/corpora/threading/ghost-root/fake-root @@ -0,0 +1,9 @@ +From: Mallory <mallory@example.org> +To: Daniel <daniel@example.org> +Subject: fake root message +Message-ID: <001-fake-message-root@example.org> +In-Reply-to: <nonexistent-message@example.org> +References: <000-real-root@example.org> <001-child@example.org> <nonexistent-message@example.org> +Date: Thu, 16 Jun 2016 22:14:41 -0400 + +This message has an in-reply-to pointing to a non-existent message diff --git a/test/corpora/threading/ghost-root/grand-child b/test/corpora/threading/ghost-root/grand-child new file mode 100644 index 00000000..5f77ac36 --- /dev/null +++ b/test/corpora/threading/ghost-root/grand-child @@ -0,0 +1,9 @@ +From: Alice <alice@example.org> +To: Daniel <daniel@example.org> +Subject: grand-child message +Message-ID: <001-grand-child@example.org> +In-Reply-To: <001-child@example.org> +References: <000-real-root@example.org> <001-child@example.org> +Date: Fri, 17 Jun 2016 22:24:41 -0400 + + diff --git a/test/corpora/threading/ghost-root/grand-child2 b/test/corpora/threading/ghost-root/grand-child2 new file mode 100644 index 00000000..59682a95 --- /dev/null +++ b/test/corpora/threading/ghost-root/grand-child2 @@ -0,0 +1,9 @@ +From: Daniel <daniel@example.org> +To: Alice <alice@example.org> +Subject: grand-child message 2 +Message-ID: <001-grand-child2@example.org> +In-Reply-To: <001-child@example.org> +References: <000-real-root@example.org> <001-child@example.org> +Date: Fri, 17 Jun 2016 22:34:41 -0400 + + diff --git a/test/corpora/threading/ghost-root/great-grand-child b/test/corpora/threading/ghost-root/great-grand-child new file mode 100644 index 00000000..287a8954 --- /dev/null +++ b/test/corpora/threading/ghost-root/great-grand-child @@ -0,0 +1,9 @@ +From: Alice <alice@example.org> +To: Daniel <daniel@example.org> +Subject: great grand-child message +Message-ID: <001-great-grand-child@example.org> +In-Reply-To: <001-grand-child@example.org> +References: <000-real-root@example.org> <001-grand-child@example.org> +Date: Fri, 17 Jun 2016 22:44:41 -0400 + + diff --git a/test/corpora/threading/ghost-root/real-root b/test/corpora/threading/ghost-root/real-root new file mode 100644 index 00000000..f1b16a0c --- /dev/null +++ b/test/corpora/threading/ghost-root/real-root @@ -0,0 +1,7 @@ +From: Alice <alice@example.org> +To: Daniel <daniel@example.org> +Subject: root message +Message-ID: <000-real-root@example.org> +Date: Thu, 16 Jun 2016 22:14:41 -0400 + +This message has no in-reply-to diff --git a/test/corpora/threading/parent-priority/cur/child b/test/corpora/threading/parent-priority/cur/child new file mode 100644 index 00000000..23ee6495 --- /dev/null +++ b/test/corpora/threading/parent-priority/cur/child @@ -0,0 +1,11 @@ +From: Alice <alice@example.org> +To: Daniel <daniel@example.org> +Subject: child message +Message-ID: <B01-child@example.org> +In-Reply-To: <B00-root@example.org> +References: <B00--root@example.org> +Date: Fri, 17 Jun 2016 22:14:41 -0400 + +This is a normal-ish reply, and has both a references header and an +in-reply-to header. + diff --git a/test/corpora/threading/parent-priority/cur/grand-child b/test/corpora/threading/parent-priority/cur/grand-child new file mode 100644 index 00000000..028371d4 --- /dev/null +++ b/test/corpora/threading/parent-priority/cur/grand-child @@ -0,0 +1,10 @@ +From: Alice <alice@example.org> +To: Daniel <daniel@example.org> +Subject: grand-child message +Message-ID: <B01-grand-child@example.org> +In-Reply-To: <B01-child@example.org> +References: <B01-child@example.org> <B00-root@example.org> +Date: Fri, 17 Jun 2016 22:24:41 -0400 + +This has the references headers in the wrong order, with oldest first. +Debbugs does this. diff --git a/test/corpora/threading/parent-priority/cur/root b/test/corpora/threading/parent-priority/cur/root new file mode 100644 index 00000000..3990843d --- /dev/null +++ b/test/corpora/threading/parent-priority/cur/root @@ -0,0 +1,7 @@ +From: Alice <alice@example.org> +To: Daniel <daniel@example.org> +Subject: root message +Message-ID: <B00-root@example.org> +Date: Thu, 16 Jun 2016 22:14:41 -0400 + +This message has no reply-to diff --git a/test/database-test.c b/test/database-test.c new file mode 100644 index 00000000..42f66559 --- /dev/null +++ b/test/database-test.c @@ -0,0 +1,71 @@ +/* + * Database routines intended only for testing, not exported from + * library. + * + * Copyright (c) 2012 David Bremner + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see https://www.gnu.org/licenses/ . + * + * Author: David Bremner <david@tethera.net> + */ + +#include "notmuch-private.h" +#include "database-test.h" + +notmuch_status_t +notmuch_database_add_stub_message (notmuch_database_t *notmuch, + const char *message_id, + const char **tags) +{ + const char **tag; + notmuch_status_t ret; + notmuch_private_status_t private_status; + notmuch_message_t *message; + + ret = _notmuch_database_ensure_writable (notmuch); + if (ret) + return ret; + + message = _notmuch_message_create_for_message_id (notmuch, + message_id, + &private_status); + if (message == NULL) { + return COERCE_STATUS (private_status, + "Unexpected status value from _notmuch_message_create_for_message_id"); + + } + + if (private_status != NOTMUCH_PRIVATE_STATUS_NO_DOCUMENT_FOUND) + return NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID; + + _notmuch_message_add_term (message, "type", "mail"); + + if (tags) { + ret = notmuch_message_freeze (message); + if (ret) + return ret; + + for (tag = tags; *tag; tag++) { + ret = notmuch_message_add_tag (message, *tag); + if (ret) + return ret; + } + + ret = notmuch_message_thaw (message); + if (ret) + return ret; + } + + return NOTMUCH_STATUS_SUCCESS; +} diff --git a/test/database-test.h b/test/database-test.h new file mode 100644 index 00000000..84f79887 --- /dev/null +++ b/test/database-test.h @@ -0,0 +1,21 @@ +#ifndef _DATABASE_TEST_H +#define _DATABASE_TEST_H +/* Add a new stub message to the given notmuch database. + * + * At least the following return values are possible: + * + * NOTMUCH_STATUS_SUCCESS: Message successfully added to database. + * + * NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: Message has the same message + * ID as another message already in the database. + * + * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only + * mode so no message can be added. + */ + +notmuch_status_t +notmuch_database_add_stub_message (notmuch_database_t *database, + const char *message_id, + const char **tag_list); + +#endif diff --git a/test/emacs-address-cleaning.el b/test/emacs-address-cleaning.el new file mode 100644 index 00000000..8423245f --- /dev/null +++ b/test/emacs-address-cleaning.el @@ -0,0 +1,39 @@ +(defun notmuch-test-address-cleaning-1 () + (notmuch-test-expect-equal (notmuch-show-clean-address "dme@dme.org") + "dme@dme.org")) + +(defun notmuch-test-address-cleaning-2 () + (let* ((input '("foo@bar.com" + "<foo@bar.com>" + "Foo Bar <foo@bar.com>" + "foo@bar.com <foo@bar.com>" + "\"Foo Bar\" <foo@bar.com>")) + (expected '("foo@bar.com" + "foo@bar.com" + "Foo Bar <foo@bar.com>" + "foo@bar.com" + "Foo Bar <foo@bar.com>")) + (output (mapcar #'notmuch-show-clean-address input))) + (notmuch-test-expect-equal output expected))) + +(defun notmuch-test-address-cleaning-3 () + (let* ((input '("ДБ <db-uknot@stop.me.uk>" + "foo (at home) <foo@bar.com>" + "foo [at home] <foo@bar.com>" + "Foo Bar" + "'Foo Bar' <foo@bar.com>" + "\"'Foo Bar'\" <foo@bar.com>" + "'\"Foo Bar\"' <foo@bar.com>" + "'\"'Foo Bar'\"' <foo@bar.com>" + "Fred Dibna \\[extraordinaire\\] <fred@dibna.com>")) + (expected '("ДБ <db-uknot@stop.me.uk>" + "foo (at home) <foo@bar.com>" + "foo [at home] <foo@bar.com>" + "Foo Bar" + "Foo Bar <foo@bar.com>" + "Foo Bar <foo@bar.com>" + "Foo Bar <foo@bar.com>" + "Foo Bar <foo@bar.com>" + "Fred Dibna [extraordinaire] <fred@dibna.com>")) + (output (mapcar #'notmuch-show-clean-address input))) + (notmuch-test-expect-equal output expected))) diff --git a/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-off b/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-off new file mode 100644 index 00000000..e0bd2c73 --- /dev/null +++ b/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-off @@ -0,0 +1,82 @@ +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed) +Subject: [notmuch] Working with Maildir storage? +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 14:00:54 -0500 + +[ multipart/mixed ] +[ multipart/signed ] +[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] +[ text/plain ] +I saw the LWN article and decided to take a look at notmuch. I'm +currently using mutt and mairix to index and read a collection of +Maildir mail folders (around 40,000 messages total). + +notmuch indexed the messages without complaint, but my attempt at +searching bombed out. Running, for example: + + notmuch search storage + +Resulted in 4604 lines of errors along the lines of: + + Error opening + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: + Too many open files + +I'm curious if this is expected behavior (i.e., notmuch does not work +with Maildir) or if something else is going on. + +Cheers, + +[ 4-line signature. Click/Enter to show. ] +[ application/pgp-signature ] +[ text/plain ] +[ 4-line signature. Click/Enter to show. ] + Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox signed unread) + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed) + Subject: Re: [notmuch] Working with Maildir storage? + To: Mikhail Gusarov <dottedmag@dottedmag.net> + Cc: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 15:33:01 -0500 + + [ multipart/mixed ] + [ multipart/signed ] + [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] + [ text/plain ] + > See the patch just posted here. + + Is the list archived anywhere? The obvious archives + (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I + think I subscribed too late to get the patch (I only just saw the + discussion about it). + + It doesn't look like the patch is in git yet. + + -- Lars + + [ 4-line signature. Click/Enter to show. ] + [ application/pgp-signature ] + [ text/plain ] + [ 4-line signature. Click/Enter to show. ] + Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox unread) + Keith Packard <keithp@keithp.com> (2009-11-17) (inbox unread) + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-18) (inbox signed unread) + Subject: Re: [notmuch] Working with Maildir storage? + To: Keith Packard <keithp@keithp.com> + Cc: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 19:50:40 -0500 + + [ multipart/mixed ] + [ multipart/signed ] + [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] + [ text/plain ] + > I've also pushed a slightly more complicated (and complete) fix to my + > private notmuch repository + + The version of lib/messages.cc in your repo doesn't build because it's + missing "#include <stdint.h>" (for the uint32_t on line 466). + + [ 4-line signature. Click/Enter to show. ] + [ application/pgp-signature ] + [ text/plain ] + [ 4-line signature. Click/Enter to show. ] + Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread) diff --git a/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-on b/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-on new file mode 100644 index 00000000..d76d0952 --- /dev/null +++ b/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-on @@ -0,0 +1,78 @@ +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed) +Subject: [notmuch] Working with Maildir storage? +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 14:00:54 -0500 + +[ multipart/mixed ] +[ multipart/signed ] +[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] +[ text/plain ] +I saw the LWN article and decided to take a look at notmuch. I'm +currently using mutt and mairix to index and read a collection of +Maildir mail folders (around 40,000 messages total). + +notmuch indexed the messages without complaint, but my attempt at +searching bombed out. Running, for example: + + notmuch search storage + +Resulted in 4604 lines of errors along the lines of: + + Error opening + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: + Too many open files + +I'm curious if this is expected behavior (i.e., notmuch does not work +with Maildir) or if something else is going on. + +Cheers, + +[ 4-line signature. Click/Enter to show. ] +[ application/pgp-signature ] +[ text/plain ] +[ 4-line signature. Click/Enter to show. ] + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed) + Subject: Re: [notmuch] Working with Maildir storage? + To: Mikhail Gusarov <dottedmag@dottedmag.net> + Cc: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 15:33:01 -0500 + + [ multipart/mixed ] + [ multipart/signed ] + [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] + [ text/plain ] + > See the patch just posted here. + + Is the list archived anywhere? The obvious archives + (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I + think I subscribed too late to get the patch (I only just saw the + discussion about it). + + It doesn't look like the patch is in git yet. + + -- Lars + + [ 4-line signature. Click/Enter to show. ] + [ application/pgp-signature ] + [ text/plain ] + [ 4-line signature. Click/Enter to show. ] + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-18) (inbox signed unread) + Subject: Re: [notmuch] Working with Maildir storage? + To: Keith Packard <keithp@keithp.com> + Cc: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 19:50:40 -0500 + + [ multipart/mixed ] + [ multipart/signed ] + [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] + [ text/plain ] + > I've also pushed a slightly more complicated (and complete) fix to my + > private notmuch repository + + The version of lib/messages.cc in your repo doesn't build because it's + missing "#include <stdint.h>" (for the uint32_t on line 466). + + [ 4-line signature. Click/Enter to show. ] + [ application/pgp-signature ] + [ text/plain ] + [ 4-line signature. Click/Enter to show. ] diff --git a/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off b/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off new file mode 100644 index 00000000..1a06374d --- /dev/null +++ b/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off @@ -0,0 +1,82 @@ +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed) +Subject: [notmuch] Working with Maildir storage? +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 14:00:54 -0500 + +[ multipart/mixed ] +[ multipart/signed ] +[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] +[ text/plain ] +I saw the LWN article and decided to take a look at notmuch. I'm +currently using mutt and mairix to index and read a collection of +Maildir mail folders (around 40,000 messages total). + +notmuch indexed the messages without complaint, but my attempt at +searching bombed out. Running, for example: + + notmuch search storage + +Resulted in 4604 lines of errors along the lines of: + + Error opening + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: + Too many open files + +I'm curious if this is expected behavior (i.e., notmuch does not work +with Maildir) or if something else is going on. + +Cheers, + +[ 4-line signature. Click/Enter to show. ] +[ application/pgp-signature ] +[ text/plain ] +[ 4-line signature. Click/Enter to show. ] + Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox signed unread) + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed) +Subject: Re: [notmuch] Working with Maildir storage? +To: Mikhail Gusarov <dottedmag@dottedmag.net> +Cc: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 15:33:01 -0500 + +[ multipart/mixed ] +[ multipart/signed ] +[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] +[ text/plain ] +> See the patch just posted here. + +Is the list archived anywhere? The obvious archives +(http://notmuchmail.org/pipermail/notmuch/) aren't available, and I +think I subscribed too late to get the patch (I only just saw the +discussion about it). + +It doesn't look like the patch is in git yet. + +-- Lars + +[ 4-line signature. Click/Enter to show. ] +[ application/pgp-signature ] +[ text/plain ] +[ 4-line signature. Click/Enter to show. ] + Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox unread) + Keith Packard <keithp@keithp.com> (2009-11-17) (inbox unread) + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-18) (inbox signed unread) +Subject: Re: [notmuch] Working with Maildir storage? +To: Keith Packard <keithp@keithp.com> +Cc: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 19:50:40 -0500 + +[ multipart/mixed ] +[ multipart/signed ] +[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] +[ text/plain ] +> I've also pushed a slightly more complicated (and complete) fix to my +> private notmuch repository + +The version of lib/messages.cc in your repo doesn't build because it's +missing "#include <stdint.h>" (for the uint32_t on line 466). + +[ 4-line signature. Click/Enter to show. ] +[ application/pgp-signature ] +[ text/plain ] +[ 4-line signature. Click/Enter to show. ] + Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread) diff --git a/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off b/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off new file mode 100644 index 00000000..ce2892a0 --- /dev/null +++ b/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off @@ -0,0 +1,32 @@ +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed unread) +Subject: [notmuch] Working with Maildir storage? + Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox signed unread) + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed) + Subject: Re: [notmuch] Working with Maildir storage? + To: Mikhail Gusarov <dottedmag@dottedmag.net> + Cc: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 15:33:01 -0500 + + [ multipart/mixed ] + [ multipart/signed ] + [ Unknown signature status ] + [ text/plain ] + > See the patch just posted here. + + Is the list archived anywhere? The obvious archives + (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I + think I subscribed too late to get the patch (I only just saw the + discussion about it). + + It doesn't look like the patch is in git yet. + + -- Lars + + [ 4-line signature. Click/Enter to show. ] + [ application/pgp-signature ] + [ text/plain ] + [ 4-line signature. Click/Enter to show. ] + Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox unread) + Keith Packard <keithp@keithp.com> (2009-11-17) (inbox unread) + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-18) (inbox signed unread) + Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread) diff --git a/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-on b/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-on new file mode 100644 index 00000000..eaa557a0 --- /dev/null +++ b/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-on @@ -0,0 +1,32 @@ +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed unread) +Subject: [notmuch] Working with Maildir storage? + Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox signed unread) + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed) + Subject: Re: [notmuch] Working with Maildir storage? + To: Mikhail Gusarov <dottedmag@dottedmag.net> + Cc: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 15:33:01 -0500 + + [ multipart/mixed ] + [ multipart/signed ] + [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] + [ text/plain ] + > See the patch just posted here. + + Is the list archived anywhere? The obvious archives + (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I + think I subscribed too late to get the patch (I only just saw the + discussion about it). + + It doesn't look like the patch is in git yet. + + -- Lars + + [ 4-line signature. Click/Enter to show. ] + [ application/pgp-signature ] + [ text/plain ] + [ 4-line signature. Click/Enter to show. ] + Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox unread) + Keith Packard <keithp@keithp.com> (2009-11-17) (inbox unread) + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-18) (inbox signed unread) + Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread) diff --git a/test/emacs-tree.expected-output/notmuch-tree-show-window b/test/emacs-tree.expected-output/notmuch-tree-show-window new file mode 100644 index 00000000..7d860c6f --- /dev/null +++ b/test/emacs-tree.expected-output/notmuch-tree-show-window @@ -0,0 +1,41 @@ +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed) +Subject: [notmuch] Working with Maildir storage? +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 14:00:54 -0500 + +[ multipart/mixed ] +[ multipart/signed ] +[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] +[ text/plain ] +I saw the LWN article and decided to take a look at notmuch. I'm +currently using mutt and mairix to index and read a collection of +Maildir mail folders (around 40,000 messages total). + +notmuch indexed the messages without complaint, but my attempt at +searching bombed out. Running, for example: + + notmuch search storage + +Resulted in 4604 lines of errors along the lines of: + + Error opening + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: + Too many open files + +I'm curious if this is expected behavior (i.e., notmuch does not work +with Maildir) or if something else is going on. + +Cheers, + +[ 4-line signature. Click/Enter to show. ] +-- +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Senior Technologist, Computing and Information Technology +Harvard University School of Engineering and Applied Sciences +[ application/pgp-signature ] +[ text/plain ] +[ 4-line signature. Click/Enter to show. ] +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch diff --git a/test/emacs-tree.expected-output/notmuch-tree-single-thread b/test/emacs-tree.expected-output/notmuch-tree-single-thread new file mode 100644 index 00000000..2285d10e --- /dev/null +++ b/test/emacs-tree.expected-output/notmuch-tree-single-thread @@ -0,0 +1,6 @@ + 2009-11-17 Mikhail Gusarov ┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox) + 2009-11-17 Mikhail Gusarov ├─►[notmuch] [PATCH 2/2] Include <stdint.h> to get uint32_t in C++ file with gcc 4.4 (inbox unread) + 2009-11-17 Carl Worth ╰┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) +End of search results. diff --git a/test/emacs-tree.expected-output/notmuch-tree-tag-inbox b/test/emacs-tree.expected-output/notmuch-tree-tag-inbox new file mode 100644 index 00000000..f28d4856 --- /dev/null +++ b/test/emacs-tree.expected-output/notmuch-tree-tag-inbox @@ -0,0 +1,53 @@ + 2010-12-29 François Boulogne ─►[aur-general] Guidelines: cp, mkdir vs install (inbox unread) + 2010-12-16 Olivier Berger ─►Essai accentué (inbox unread) + 2009-11-18 Chris Wilson ─►[notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once (inbox unread) + 2009-11-18 Alex Botero-Lowry ┬►[notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) + 2009-11-18 Carl Worth ╰─►[notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (inbox unread) + 2009-11-17 Ingmar Vanhassel ┬►[notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Adrian Perez de Cast ┬►[notmuch] Introducing myself (inbox signed unread) + 2009-11-18 Keith Packard ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Israel Herraiz ┬►[notmuch] New to the list (inbox unread) + 2009-11-18 Keith Packard ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Jan Janak ┬►[notmuch] What a great idea! (inbox unread) + 2009-11-17 Jan Janak ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Jan Janak ┬►[notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Aron Griffis ┬►[notmuch] archive (inbox unread) + 2009-11-18 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Keith Packard ┬►[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-18 Carl Worth ╰─►[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-17 Lars Kellogg-Stedman ┬►[notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 Mikhail Gusarov ├┬► ... (inbox signed unread) + 2009-11-17 Lars Kellogg-Stedman │╰┬► ... (inbox signed unread) + 2009-11-17 Mikhail Gusarov │ ├─► ... (inbox unread) + 2009-11-17 Keith Packard │ ╰┬► ... (inbox unread) + 2009-11-18 Lars Kellogg-Stedman │ ╰─► ... (inbox signed unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Mikhail Gusarov ┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Mikhail Gusarov ├─►[notmuch] [PATCH 2/2] Include <stdint.h> to get uint32_t in C++ file with gcc 4.4 (inbox unread) + 2009-11-17 Carl Worth ╰┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-18 Keith Packard ┬►[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Alexander Botero-Low ╰─►[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Alexander Botero-Low ─►[notmuch] request for pull (inbox unread) + 2009-11-18 Jjgod Jiang ┬►[notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Alexander Botero-Low ╰┬► ... (inbox unread) + 2009-11-18 Jjgod Jiang ╰┬► ... (inbox unread) + 2009-11-18 Alexander Botero-Low ╰─► ... (inbox unread) + 2009-11-18 Rolland Santimano ─►[notmuch] Link to mailing list archives ? (inbox unread) + 2009-11-18 Jan Janak ─►[notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH] count_files: sort directory in inode order before statting (inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH 2/2] Read mail directory in inode number order (inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (inbox unread) + 2009-11-18 Lars Kellogg-Stedman ┬►[notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 Lars Kellogg-Stedman ╰─► ... (attachment inbox signed unread) + 2009-11-17 Mikhail Gusarov ─►[notmuch] [PATCH] Handle rename of message file (inbox unread) + 2009-11-17 Alex Botero-Lowry ┬►[notmuch] preliminary FreeBSD support (attachment inbox unread) + 2009-11-17 Carl Worth ╰─► ... (inbox unread) +End of search results. diff --git a/test/emacs-tree.expected-output/notmuch-tree-tag-inbox-tagged b/test/emacs-tree.expected-output/notmuch-tree-tag-inbox-tagged new file mode 100644 index 00000000..428c0ae8 --- /dev/null +++ b/test/emacs-tree.expected-output/notmuch-tree-tag-inbox-tagged @@ -0,0 +1,53 @@ + 2010-12-29 François Boulogne ─►[aur-general] Guidelines: cp, mkdir vs install (inbox unread) + 2010-12-16 Olivier Berger ─►Essai accentué (inbox test_tag unread) + 2009-11-18 Chris Wilson ─►[notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once (inbox unread) + 2009-11-18 Alex Botero-Lowry ┬►[notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) + 2009-11-18 Carl Worth ╰─►[notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (inbox unread) + 2009-11-17 Ingmar Vanhassel ┬►[notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Adrian Perez de Cast ┬►[notmuch] Introducing myself (inbox signed unread) + 2009-11-18 Keith Packard ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Israel Herraiz ┬►[notmuch] New to the list (inbox unread) + 2009-11-18 Keith Packard ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Jan Janak ┬►[notmuch] What a great idea! (inbox unread) + 2009-11-17 Jan Janak ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Jan Janak ┬►[notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Aron Griffis ┬►[notmuch] archive (inbox unread) + 2009-11-18 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Keith Packard ┬►[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-18 Carl Worth ╰─►[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-17 Lars Kellogg-Stedman ┬►[notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 Mikhail Gusarov ├┬► ... (inbox signed unread) + 2009-11-17 Lars Kellogg-Stedman │╰┬► ... (inbox signed unread) + 2009-11-17 Mikhail Gusarov │ ├─► ... (inbox unread) + 2009-11-17 Keith Packard │ ╰┬► ... (inbox unread) + 2009-11-18 Lars Kellogg-Stedman │ ╰─► ... (inbox signed unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Mikhail Gusarov ┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Mikhail Gusarov ├─►[notmuch] [PATCH 2/2] Include <stdint.h> to get uint32_t in C++ file with gcc 4.4 (inbox unread) + 2009-11-17 Carl Worth ╰┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-18 Keith Packard ┬►[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Alexander Botero-Low ╰─►[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Alexander Botero-Low ─►[notmuch] request for pull (inbox unread) + 2009-11-18 Jjgod Jiang ┬►[notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Alexander Botero-Low ╰┬► ... (inbox unread) + 2009-11-18 Jjgod Jiang ╰┬► ... (inbox unread) + 2009-11-18 Alexander Botero-Low ╰─► ... (inbox unread) + 2009-11-18 Rolland Santimano ─►[notmuch] Link to mailing list archives ? (inbox unread) + 2009-11-18 Jan Janak ─►[notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH] count_files: sort directory in inode order before statting (inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH 2/2] Read mail directory in inode number order (inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (inbox unread) + 2009-11-18 Lars Kellogg-Stedman ┬►[notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 Lars Kellogg-Stedman ╰─► ... (attachment inbox signed unread) + 2009-11-17 Mikhail Gusarov ─►[notmuch] [PATCH] Handle rename of message file (inbox unread) + 2009-11-17 Alex Botero-Lowry ┬►[notmuch] preliminary FreeBSD support (attachment inbox unread) + 2009-11-17 Carl Worth ╰─► ... (inbox unread) +End of search results. diff --git a/test/emacs-tree.expected-output/notmuch-tree-tag-inbox-thread-tagged b/test/emacs-tree.expected-output/notmuch-tree-tag-inbox-thread-tagged new file mode 100644 index 00000000..828c5251 --- /dev/null +++ b/test/emacs-tree.expected-output/notmuch-tree-tag-inbox-thread-tagged @@ -0,0 +1,53 @@ + 2010-12-29 François Boulogne ─►[aur-general] Guidelines: cp, mkdir vs install (inbox unread) + 2010-12-16 Olivier Berger ─►Essai accentué (inbox unread) + 2009-11-18 Chris Wilson ─►[notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once (inbox unread) + 2009-11-18 Alex Botero-Lowry ┬►[notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) + 2009-11-18 Carl Worth ╰─►[notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (inbox unread) + 2009-11-17 Ingmar Vanhassel ┬►[notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Adrian Perez de Cast ┬►[notmuch] Introducing myself (inbox signed unread) + 2009-11-18 Keith Packard ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Israel Herraiz ┬►[notmuch] New to the list (inbox unread) + 2009-11-18 Keith Packard ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Jan Janak ┬►[notmuch] What a great idea! (inbox unread) + 2009-11-17 Jan Janak ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Jan Janak ┬►[notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Aron Griffis ┬►[notmuch] archive (inbox unread) + 2009-11-18 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Keith Packard ┬►[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-18 Carl Worth ╰─►[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-17 Lars Kellogg-Stedman ┬►[notmuch] Working with Maildir storage? (inbox signed test_thread_tag unread) + 2009-11-17 Mikhail Gusarov ├┬► ... (inbox signed test_thread_tag unread) + 2009-11-17 Lars Kellogg-Stedman │╰┬► ... (inbox signed test_thread_tag unread) + 2009-11-17 Mikhail Gusarov │ ├─► ... (inbox test_thread_tag unread) + 2009-11-17 Keith Packard │ ╰┬► ... (inbox test_thread_tag unread) + 2009-11-18 Lars Kellogg-Stedman │ ╰─► ... (inbox signed test_thread_tag unread) + 2009-11-18 Carl Worth ╰─► ... (inbox test_thread_tag unread) + 2009-11-17 Mikhail Gusarov ┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Mikhail Gusarov ├─►[notmuch] [PATCH 2/2] Include <stdint.h> to get uint32_t in C++ file with gcc 4.4 (inbox unread) + 2009-11-17 Carl Worth ╰┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-18 Keith Packard ┬►[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Alexander Botero-Low ╰─►[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Alexander Botero-Low ─►[notmuch] request for pull (inbox unread) + 2009-11-18 Jjgod Jiang ┬►[notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Alexander Botero-Low ╰┬► ... (inbox unread) + 2009-11-18 Jjgod Jiang ╰┬► ... (inbox unread) + 2009-11-18 Alexander Botero-Low ╰─► ... (inbox unread) + 2009-11-18 Rolland Santimano ─►[notmuch] Link to mailing list archives ? (inbox unread) + 2009-11-18 Jan Janak ─►[notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH] count_files: sort directory in inode order before statting (inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH 2/2] Read mail directory in inode number order (inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (inbox unread) + 2009-11-18 Lars Kellogg-Stedman ┬►[notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 Lars Kellogg-Stedman ╰─► ... (attachment inbox signed unread) + 2009-11-17 Mikhail Gusarov ─►[notmuch] [PATCH] Handle rename of message file (inbox unread) + 2009-11-17 Alex Botero-Lowry ┬►[notmuch] preliminary FreeBSD support (attachment inbox unread) + 2009-11-17 Carl Worth ╰─► ... (inbox unread) +End of search results. diff --git a/test/emacs.expected-output/attachment b/test/emacs.expected-output/attachment new file mode 100644 index 00000000..1e22d3a9 --- /dev/null +++ b/test/emacs.expected-output/attachment @@ -0,0 +1,32 @@ +From e3bc4bbd7b9d0d086816ab5f8f2d6ffea1dd3ea4 Mon Sep 17 00:00:00 2001 +From: Alexander Botero-Lowry <alex.boterolowry@gmail.com> +Date: Tue, 17 Nov 2009 11:30:39 -0800 +Subject: [PATCH] Deal with situation where sysconf(_SC_GETPW_R_SIZE_MAX) returns -1 + +--- + notmuch-config.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/notmuch-config.c b/notmuch-config.c +index 248149c..e7220d8 100644 +--- a/notmuch-config.c ++++ b/notmuch-config.c +@@ -77,6 +77,7 @@ static char * + get_name_from_passwd_file (void *ctx) + { + long pw_buf_size = sysconf(_SC_GETPW_R_SIZE_MAX); ++ if (pw_buf_size == -1) pw_buf_size = 64; + char *pw_buf = talloc_zero_size (ctx, pw_buf_size); + struct passwd passwd, *ignored; + char *name; +@@ -101,6 +102,7 @@ static char * + get_username_from_passwd_file (void *ctx) + { + long pw_buf_size = sysconf(_SC_GETPW_R_SIZE_MAX); ++ if (pw_buf_size == -1) pw_buf_size = 64; + char *pw_buf = talloc_zero_size (ctx, pw_buf_size); + struct passwd passwd, *ignored; + char *name; +-- +1.6.5.2 + diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello new file mode 100644 index 00000000..89186082 --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello @@ -0,0 +1,12 @@ + Welcome to notmuch. You have 52 messages. + +Saved searches: [edit] + + 52 inbox 52 unread 52 all mail + +Search: . + +All tags: [show] + + Hit `?' for context-sensitive help in any Notmuch screen. + Customize Notmuch or this page. diff --git a/test/emacs.expected-output/notmuch-hello-empty-custom-queries-section b/test/emacs.expected-output/notmuch-hello-empty-custom-queries-section new file mode 100644 index 00000000..cd0fdf08 --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-empty-custom-queries-section @@ -0,0 +1,3 @@ +: [hide] + + diff --git a/test/emacs.expected-output/notmuch-hello-empty-custom-tags-section b/test/emacs.expected-output/notmuch-hello-empty-custom-tags-section new file mode 100644 index 00000000..b56fd671 --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-empty-custom-tags-section @@ -0,0 +1,5 @@ +: [hide] + + 4 attachment 7 signed + 52 inbox 52 unread + diff --git a/test/emacs.expected-output/notmuch-hello-long-names b/test/emacs.expected-output/notmuch-hello-long-names new file mode 100644 index 00000000..da0f3525 --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-long-names @@ -0,0 +1,15 @@ + Welcome to notmuch. You have 52 messages. + +Saved searches: [edit] + + 52 inbox 52 unread 52 all mail + +Search: . + +All tags: [hide] + + 52 a-very-long-tag 52 inbox 52 unread + 4 attachment 7 signed + + Hit `?' for context-sensitive help in any Notmuch screen. + Customize Notmuch or this page. diff --git a/test/emacs.expected-output/notmuch-hello-new-section b/test/emacs.expected-output/notmuch-hello-new-section new file mode 100644 index 00000000..67fdef24 --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-new-section @@ -0,0 +1,4 @@ +Test: [hide] + + 52 inbox + diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches new file mode 100644 index 00000000..939965fe --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches @@ -0,0 +1,8 @@ + Welcome to notmuch. You have 52 messages. + +Search: . + +All tags: [show] + + Hit `?' for context-sensitive help in any Notmuch screen. + Customize Notmuch or this page. diff --git a/test/emacs.expected-output/notmuch-hello-section-counts b/test/emacs.expected-output/notmuch-hello-section-counts new file mode 100644 index 00000000..7a9827cf --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-section-counts @@ -0,0 +1,5 @@ +Test-with-counts: [hide] + + 2 attachment 7 signed + 7 inbox 7 unread + diff --git a/test/emacs.expected-output/notmuch-hello-section-hidden-tag b/test/emacs.expected-output/notmuch-hello-section-hidden-tag new file mode 100644 index 00000000..809a1142 --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-section-hidden-tag @@ -0,0 +1,4 @@ +Test-with-filtered: [hide] + + 4 attachment 52 inbox 7 signed + diff --git a/test/emacs.expected-output/notmuch-hello-section-with-empty b/test/emacs.expected-output/notmuch-hello-section-with-empty new file mode 100644 index 00000000..5c673179 --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-section-with-empty @@ -0,0 +1,4 @@ +Test-with-empty: [hide] + + 52 inbox + diff --git a/test/emacs.expected-output/notmuch-hello-view-inbox b/test/emacs.expected-output/notmuch-hello-view-inbox new file mode 100644 index 00000000..1688d674 --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-view-inbox @@ -0,0 +1,25 @@ + 2009-11-17 [5/5] Mikhail Gusarov, Carl Worth, Keith Packard [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 [7/7] Lars Kellogg-Stedman, Mikhail Gusarov, Keith Packard, Carl Worth [notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 [2/2] Alex Botero-Lowry, Carl Worth [notmuch] preliminary FreeBSD support (attachment inbox unread) + 2009-11-17 [1/1] Mikhail Gusarov [notmuch] [PATCH] Handle rename of message file (inbox unread) + 2009-11-17 [2/2] Keith Packard, Carl Worth [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-17 [2/2] Jan Janak, Carl Worth [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-17 [3/3] Jan Janak, Carl Worth [notmuch] What a great idea! (inbox unread) + 2009-11-17 [3/3] Israel Herraiz, Keith Packard, Carl Worth [notmuch] New to the list (inbox unread) + 2009-11-17 [3/3] Adrian Perez de Castro, Keith Packard, Carl Worth [notmuch] Introducing myself (inbox signed unread) + 2009-11-17 [3/3] Aron Griffis, Keith Packard, Carl Worth [notmuch] archive (inbox unread) + 2009-11-17 [2/2] Ingmar Vanhassel, Carl Worth [notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 [2/2] Alex Botero-Lowry, Carl Worth [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) + 2009-11-18 [2/2] Lars Kellogg-Stedman [notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 [1/1] Stewart Smith [notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (inbox unread) + 2009-11-18 [1/1] Stewart Smith [notmuch] [PATCH 2/2] Read mail directory in inode number order (inbox unread) + 2009-11-18 [1/1] Stewart Smith [notmuch] [PATCH] count_files: sort directory in inode order before statting (inbox unread) + 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 [1/1] Jan Janak [notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) + 2009-11-18 [1/1] Rolland Santimano [notmuch] Link to mailing list archives ? (inbox unread) + 2009-11-18 [1/1] Alexander Botero-Lowry [notmuch] request for pull (inbox unread) + 2009-11-18 [2/2] Keith Packard, Alexander Botero-Lowry [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 [1/1] Chris Wilson [notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once (inbox unread) + 2010-12-16 [1/1] Olivier Berger Essai accentué (inbox unread) + 2010-12-29 [1/1] François Boulogne [aur-general] Guidelines: cp, mkdir vs install (inbox unread) +End of search results. diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty new file mode 100644 index 00000000..97d7db26 --- /dev/null +++ b/test/emacs.expected-output/notmuch-hello-with-empty @@ -0,0 +1,12 @@ + Welcome to notmuch. You have 52 messages. + +Saved searches: [edit] + + 52 inbox 52 unread 0 empty + +Search: . + +All tags: [show] + + Hit `?' for context-sensitive help in any Notmuch screen. + Customize Notmuch or this page. diff --git a/test/emacs.expected-output/notmuch-search-tag-inbox b/test/emacs.expected-output/notmuch-search-tag-inbox new file mode 100644 index 00000000..8a53555a --- /dev/null +++ b/test/emacs.expected-output/notmuch-search-tag-inbox @@ -0,0 +1,25 @@ + 2010-12-29 [1/1] François Boulogne [aur-general] Guidelines: cp, mkdir vs install (inbox unread) + 2010-12-16 [1/1] Olivier Berger Essai accentué (inbox unread) + 2009-11-18 [1/1] Chris Wilson [notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once (inbox unread) + 2009-11-18 [2/2] Alex Botero-Lowry, Carl Worth [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) + 2009-11-18 [2/2] Ingmar Vanhassel, Carl Worth [notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 [3/3] Adrian Perez de Castro, Keith Packard, Carl Worth [notmuch] Introducing myself (inbox signed unread) + 2009-11-18 [3/3] Israel Herraiz, Keith Packard, Carl Worth [notmuch] New to the list (inbox unread) + 2009-11-18 [3/3] Jan Janak, Carl Worth [notmuch] What a great idea! (inbox unread) + 2009-11-18 [2/2] Jan Janak, Carl Worth [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-18 [3/3] Aron Griffis, Keith Packard, Carl Worth [notmuch] archive (inbox unread) + 2009-11-18 [2/2] Keith Packard, Carl Worth [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-18 [7/7] Lars Kellogg-Stedman, Mikhail Gusarov, Keith Packard, Carl Worth [notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-18 [5/5] Mikhail Gusarov, Carl Worth, Keith Packard [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-18 [2/2] Keith Packard, Alexander Botero-Lowry [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 [1/1] Alexander Botero-Lowry [notmuch] request for pull (inbox unread) + 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 [1/1] Rolland Santimano [notmuch] Link to mailing list archives ? (inbox unread) + 2009-11-18 [1/1] Jan Janak [notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) + 2009-11-18 [1/1] Stewart Smith [notmuch] [PATCH] count_files: sort directory in inode order before statting (inbox unread) + 2009-11-18 [1/1] Stewart Smith [notmuch] [PATCH 2/2] Read mail directory in inode number order (inbox unread) + 2009-11-18 [1/1] Stewart Smith [notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (inbox unread) + 2009-11-18 [2/2] Lars Kellogg-Stedman [notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-17 [1/1] Mikhail Gusarov [notmuch] [PATCH] Handle rename of message file (inbox unread) + 2009-11-17 [2/2] Alex Botero-Lowry, Carl Worth [notmuch] preliminary FreeBSD support (attachment inbox unread) +End of search results. diff --git a/test/emacs.expected-output/notmuch-show-message-with-headers-hidden b/test/emacs.expected-output/notmuch-show-message-with-headers-hidden new file mode 100644 index 00000000..9d7f91b6 --- /dev/null +++ b/test/emacs.expected-output/notmuch-show-message-with-headers-hidden @@ -0,0 +1,22 @@ +Jan Janak <jan@ryngle.com> (2009-11-17) (inbox unread) +Subject: [notmuch] What a great idea! + Jan Janak <jan@ryngle.com> (2009-11-17) (inbox) + + On Tue, Nov 17, 2009 at 11:35 PM, Jan Janak <jan at ryngle.com> wrote: + > Hello, + > + > First of all, notmuch is a wonderful idea, both the cmdline tool and + [ 2 more citation lines. Click/Enter to show. ] + > + > Have you considered sending an announcement to the org-mode mailing list? + > http://org-mode.org + + Sorry, wrong URL, the correct one is: http://orgmode.org + + > Various ways of searching/referencing emails from emacs were discussed + > there several times and none of them were as elegant as notmuch (not + > even close). Maybe notmuch would attract some of the developers + > there.. + + -- Jan + Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread) diff --git a/test/emacs.expected-output/notmuch-show-message-with-headers-visible b/test/emacs.expected-output/notmuch-show-message-with-headers-visible new file mode 100644 index 00000000..8efbd60d --- /dev/null +++ b/test/emacs.expected-output/notmuch-show-message-with-headers-visible @@ -0,0 +1,25 @@ +Jan Janak <jan@ryngle.com> (2009-11-17) (inbox unread) +Subject: [notmuch] What a great idea! + Jan Janak <jan@ryngle.com> (2009-11-17) (inbox) + Subject: [notmuch] What a great idea! + To: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 23:38:47 +0100 + + On Tue, Nov 17, 2009 at 11:35 PM, Jan Janak <jan at ryngle.com> wrote: + > Hello, + > + > First of all, notmuch is a wonderful idea, both the cmdline tool and + [ 2 more citation lines. Click/Enter to show. ] + > + > Have you considered sending an announcement to the org-mode mailing list? + > http://org-mode.org + + Sorry, wrong URL, the correct one is: http://orgmode.org + + > Various ways of searching/referencing emails from emacs were discussed + > there several times and none of them were as elegant as notmuch (not + > even close). Maybe notmuch would attract some of the developers + > there.. + + -- Jan + Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread) diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage b/test/emacs.expected-output/notmuch-show-thread-maildir-storage new file mode 100644 index 00000000..1f89dbef --- /dev/null +++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage @@ -0,0 +1,218 @@ +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed) +Subject: [notmuch] Working with Maildir storage? +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 14:00:54 -0500 + +[ multipart/mixed ] +[ multipart/signed ] +[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] +[ text/plain ] +I saw the LWN article and decided to take a look at notmuch. I'm +currently using mutt and mairix to index and read a collection of +Maildir mail folders (around 40,000 messages total). + +notmuch indexed the messages without complaint, but my attempt at +searching bombed out. Running, for example: + + notmuch search storage + +Resulted in 4604 lines of errors along the lines of: + + Error opening + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: + Too many open files + +I'm curious if this is expected behavior (i.e., notmuch does not work +with Maildir) or if something else is going on. + +Cheers, + +[ 4-line signature. Click/Enter to show. ] +-- +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Senior Technologist, Computing and Information Technology +Harvard University School of Engineering and Applied Sciences +[ application/pgp-signature ] +[ text/plain ] +[ 4-line signature. Click/Enter to show. ] +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch + Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox signed unread) + Subject: Re: [notmuch] Working with Maildir storage? + To: notmuch@notmuchmail.org + Date: Wed, 18 Nov 2009 01:02:38 +0600 + + [ multipart/mixed ] + [ multipart/signed ] + [ Unknown key ID 0x9D20F6503E338888 or unsupported algorithm ] + [ text/plain ] + + Twas brillig at 14:00:54 17.11.2009 UTC-05 when lars@seas.harvard.edu did + gyre and gimble: + + LK> Resulted in 4604 lines of errors along the lines of: + + LK> Error opening + LK> + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: + LK> Too many open files + + See the patch just posted here. + + [ 2-line signature. Click/Enter to show. ] + -- + http://fossarchy.blogspot.com/ + [ application/pgp-signature ] + [ text/plain ] + [ 4-line signature. Click/Enter to show. ] + _______________________________________________ + notmuch mailing list + notmuch@notmuchmail.org + http://notmuchmail.org/mailman/listinfo/notmuch + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed unread) + Subject: Re: [notmuch] Working with Maildir storage? + To: Mikhail Gusarov <dottedmag@dottedmag.net> + Cc: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 15:33:01 -0500 + + [ multipart/mixed ] + [ multipart/signed ] + [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] + [ text/plain ] + > See the patch just posted here. + + Is the list archived anywhere? The obvious archives + (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I + think I subscribed too late to get the patch (I only just saw the + discussion about it). + + It doesn't look like the patch is in git yet. + + -- Lars + + [ 4-line signature. Click/Enter to show. ] + -- + Lars Kellogg-Stedman <lars@seas.harvard.edu> + Senior Technologist, Computing and Information Technology + Harvard University School of Engineering and Applied Sciences + [ application/pgp-signature ] + [ text/plain ] + [ 4-line signature. Click/Enter to show. ] + _______________________________________________ + notmuch mailing list + notmuch@notmuchmail.org + http://notmuchmail.org/mailman/listinfo/notmuch + Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox unread) + Subject: [notmuch] Working with Maildir storage? + To: notmuch@notmuchmail.org + Date: Wed, 18 Nov 2009 02:50:48 +0600 + + Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at seas.harvard.edu + did gyre and gimble: + + LK> Is the list archived anywhere? The obvious archives + LK> (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I + LK> think I subscribed too late to get the patch (I only just saw the + LK> discussion about it). + + LK> It doesn't look like the patch is in git yet. + + Just has been pushed + + [ 10-line signature. Click/Enter to show. ] + -- + http://fossarchy.blogspot.com/ + -------------- next part -------------- + A non-text attachment was scrubbed... + Name: not available + Type: application/pgp-signature + Size: 834 bytes + Desc: not available + URL: + <http://notmuchmail.org/pipermail/notmuch/attachments/20091118/0e33d964/attachment.pgp> + Keith Packard <keithp@keithp.com> (2009-11-17) (inbox unread) + Subject: [notmuch] Working with Maildir storage? + To: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 13:24:13 -0800 + + On Tue, 17 Nov 2009 15:33:01 -0500, Lars Kellogg-Stedman <lars at + seas.harvard.edu> wrote: + > > See the patch just posted here. + + I've also pushed a slightly more complicated (and complete) fix to my + private notmuch repository + + git://keithp.com/git/notmuch + + > Is the list archived anywhere? + + Oops. Looks like Carl's mail server is broken. He's traveling to + Barcelona today and so it won't get fixed for a while. + + Thanks to everyone for trying out notmuch! + + -keith + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-18) (inbox signed unread) + Subject: Re: [notmuch] Working with Maildir storage? + To: Keith Packard <keithp@keithp.com> + Cc: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 19:50:40 -0500 + + [ multipart/mixed ] + [ multipart/signed ] + [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] + [ text/plain ] + > I've also pushed a slightly more complicated (and complete) fix to my + > private notmuch repository + + The version of lib/messages.cc in your repo doesn't build because it's + missing "#include <stdint.h>" (for the uint32_t on line 466). + + [ 4-line signature. Click/Enter to show. ] + -- + Lars Kellogg-Stedman <lars@seas.harvard.edu> + Senior Technologist, Computing and Information Technology + Harvard University School of Engineering and Applied Sciences + [ application/pgp-signature ] + [ text/plain ] + [ 4-line signature. Click/Enter to show. ] + _______________________________________________ + notmuch mailing list + notmuch@notmuchmail.org + http://notmuchmail.org/mailman/listinfo/notmuch + Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread) + Subject: [notmuch] Working with Maildir storage? + To: notmuch@notmuchmail.org + Date: Wed, 18 Nov 2009 02:08:10 -0800 + + On Tue, 17 Nov 2009 14:00:54 -0500, Lars Kellogg-Stedman <lars at + seas.harvard.edu> wrote: + > I saw the LWN article and decided to take a look at notmuch. I'm + > currently using mutt and mairix to index and read a collection of + > Maildir mail folders (around 40,000 messages total). + + Welcome, Lars! + + I hadn't even seen that Keith's blog post had been picked up by lwn.net. + That's very interesting. So, thanks for coming and trying out notmuch. + + > Error opening + > /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: + > Too many open files + + Sadly, the lwn article coincided with me having just introduced this + bug, and then getting on a Trans-Atlantic flight. So I fixed the bug + fairly quickly, but there was quite a bit of latency before I could push + the fix out. It should be fixed now. + + > I'm curious if this is expected behavior (i.e., notmuch does not work + > with Maildir) or if something else is going on. + + Notmuch works just fine with maildir---it's one of the things that it + likes the best. + + Happy hacking, + + -Carl diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation new file mode 100644 index 00000000..5c4ec979 --- /dev/null +++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation @@ -0,0 +1,223 @@ +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed) +Subject: [notmuch] Working with Maildir storage? +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 14:00:54 -0500 + +[ multipart/mixed ] +[ multipart/signed ] +[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] +[ text/plain ] +I saw the LWN article and decided to take a look at notmuch. I'm +currently using mutt and mairix to index and read a collection of +Maildir mail folders (around 40,000 messages total). + +notmuch indexed the messages without complaint, but my attempt at +searching bombed out. Running, for example: + + notmuch search storage + +Resulted in 4604 lines of errors along the lines of: + + Error opening + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: + Too many open files + +I'm curious if this is expected behavior (i.e., notmuch does not work +with Maildir) or if something else is going on. + +Cheers, + +[ 4-line signature. Click/Enter to show. ] +-- +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Senior Technologist, Computing and Information Technology +Harvard University School of Engineering and Applied Sciences +[ application/pgp-signature ] +[ text/plain ] +[ 4-line signature. Click/Enter to show. ] +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch + Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox signed unread) + Subject: Re: [notmuch] Working with Maildir storage? + To: notmuch@notmuchmail.org + Date: Wed, 18 Nov 2009 01:02:38 +0600 + + [ multipart/mixed ] + [ multipart/signed ] + [ Unknown key ID 0x9D20F6503E338888 or unsupported algorithm ] + [ text/plain ] + + Twas brillig at 14:00:54 17.11.2009 UTC-05 when lars@seas.harvard.edu did + gyre and gimble: + + LK> Resulted in 4604 lines of errors along the lines of: + + LK> Error opening + LK> + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: + LK> Too many open files + + See the patch just posted here. + + [ 2-line signature. Click/Enter to show. ] + -- + http://fossarchy.blogspot.com/ + [ application/pgp-signature ] + [ text/plain ] + [ 4-line signature. Click/Enter to show. ] + _______________________________________________ + notmuch mailing list + notmuch@notmuchmail.org + http://notmuchmail.org/mailman/listinfo/notmuch + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed unread) + Subject: Re: [notmuch] Working with Maildir storage? + To: Mikhail Gusarov <dottedmag@dottedmag.net> + Cc: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 15:33:01 -0500 + + [ multipart/mixed ] + [ multipart/signed ] + [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] + [ text/plain ] + > See the patch just posted here. + + Is the list archived anywhere? The obvious archives + (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I + think I subscribed too late to get the patch (I only just saw the + discussion about it). + + It doesn't look like the patch is in git yet. + + -- Lars + + [ 4-line signature. Click/Enter to show. ] + -- + Lars Kellogg-Stedman <lars@seas.harvard.edu> + Senior Technologist, Computing and Information Technology + Harvard University School of Engineering and Applied Sciences + [ application/pgp-signature ] + [ text/plain ] + [ 4-line signature. Click/Enter to show. ] + _______________________________________________ + notmuch mailing list + notmuch@notmuchmail.org + http://notmuchmail.org/mailman/listinfo/notmuch + Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox unread) + Subject: [notmuch] Working with Maildir storage? + To: notmuch@notmuchmail.org + Date: Wed, 18 Nov 2009 02:50:48 +0600 + + Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at + seas.harvard.edu did gyre and gimble: + + LK> Is the list archived anywhere? The obvious archives + LK> (http://notmuchmail.org/pipermail/notmuch/) aren't available, + and I + LK> think I subscribed too late to get the patch (I only just saw + the + LK> discussion about it). + + LK> It doesn't look like the patch is in git yet. + + Just has been pushed + + [ 10-line signature. Click/Enter to show. ] + -- + http://fossarchy.blogspot.com/ + -------------- next part -------------- + A non-text attachment was scrubbed... + Name: not available + Type: application/pgp-signature + Size: 834 bytes + Desc: not available + URL: + <http://notmuchmail.org/pipermail/notmuch/attachments/20091118/0e33d964/attachment.pgp> + Keith Packard <keithp@keithp.com> (2009-11-17) (inbox unread) + Subject: [notmuch] Working with Maildir storage? + To: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 13:24:13 -0800 + + On Tue, 17 Nov 2009 15:33:01 -0500, Lars Kellogg-Stedman <lars at + seas.harvard.edu> wrote: + > > See the patch just posted here. + + I've also pushed a slightly more complicated (and complete) fix to + my + private notmuch repository + + git://keithp.com/git/notmuch + + > Is the list archived anywhere? + + Oops. Looks like Carl's mail server is broken. He's traveling to + Barcelona today and so it won't get fixed for a while. + + Thanks to everyone for trying out notmuch! + + -keith + Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-18) (inbox signed unread) + Subject: Re: [notmuch] Working with Maildir storage? + To: Keith Packard <keithp@keithp.com> + Cc: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 19:50:40 -0500 + + [ multipart/mixed ] + [ multipart/signed ] + [ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] + [ text/plain ] + > I've also pushed a slightly more complicated (and complete) + > fix to my + > private notmuch repository + + The version of lib/messages.cc in your repo doesn't build + because it's + missing "#include <stdint.h>" (for the uint32_t on line 466). + + [ 4-line signature. Click/Enter to show. ] + -- + Lars Kellogg-Stedman <lars@seas.harvard.edu> + Senior Technologist, Computing and Information Technology + Harvard University School of Engineering and Applied Sciences + [ application/pgp-signature ] + [ text/plain ] + [ 4-line signature. Click/Enter to show. ] + _______________________________________________ + notmuch mailing list + notmuch@notmuchmail.org + http://notmuchmail.org/mailman/listinfo/notmuch + Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread) + Subject: [notmuch] Working with Maildir storage? + To: notmuch@notmuchmail.org + Date: Wed, 18 Nov 2009 02:08:10 -0800 + + On Tue, 17 Nov 2009 14:00:54 -0500, Lars Kellogg-Stedman <lars at + seas.harvard.edu> wrote: + > I saw the LWN article and decided to take a look at notmuch. I'm + > currently using mutt and mairix to index and read a collection of + > Maildir mail folders (around 40,000 messages total). + + Welcome, Lars! + + I hadn't even seen that Keith's blog post had been picked up by lwn.net. + That's very interesting. So, thanks for coming and trying out notmuch. + + > Error opening + > /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: + > Too many open files + + Sadly, the lwn article coincided with me having just introduced this + bug, and then getting on a Trans-Atlantic flight. So I fixed the bug + fairly quickly, but there was quite a bit of latency before I could push + the fix out. It should be fixed now. + + > I'm curious if this is expected behavior (i.e., notmuch does not work + > with Maildir) or if something else is going on. + + Notmuch works just fine with maildir---it's one of the things that it + likes the best. + + Happy hacking, + + -Carl diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation new file mode 100644 index 00000000..24cdd56e --- /dev/null +++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation @@ -0,0 +1,218 @@ +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed) +Subject: [notmuch] Working with Maildir storage? +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 14:00:54 -0500 + +[ multipart/mixed ] +[ multipart/signed ] +[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] +[ text/plain ] +I saw the LWN article and decided to take a look at notmuch. I'm +currently using mutt and mairix to index and read a collection of +Maildir mail folders (around 40,000 messages total). + +notmuch indexed the messages without complaint, but my attempt at +searching bombed out. Running, for example: + + notmuch search storage + +Resulted in 4604 lines of errors along the lines of: + + Error opening + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: + Too many open files + +I'm curious if this is expected behavior (i.e., notmuch does not work +with Maildir) or if something else is going on. + +Cheers, + +[ 4-line signature. Click/Enter to show. ] +-- +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Senior Technologist, Computing and Information Technology +Harvard University School of Engineering and Applied Sciences +[ application/pgp-signature ] +[ text/plain ] +[ 4-line signature. Click/Enter to show. ] +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch +Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox signed unread) +Subject: Re: [notmuch] Working with Maildir storage? +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 01:02:38 +0600 + +[ multipart/mixed ] +[ multipart/signed ] +[ Unknown key ID 0x9D20F6503E338888 or unsupported algorithm ] +[ text/plain ] + +Twas brillig at 14:00:54 17.11.2009 UTC-05 when lars@seas.harvard.edu did gyre +and gimble: + + LK> Resulted in 4604 lines of errors along the lines of: + + LK> Error opening + LK> +/home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: + LK> Too many open files + +See the patch just posted here. + +[ 2-line signature. Click/Enter to show. ] +-- +http://fossarchy.blogspot.com/ +[ application/pgp-signature ] +[ text/plain ] +[ 4-line signature. Click/Enter to show. ] +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed unread) +Subject: Re: [notmuch] Working with Maildir storage? +To: Mikhail Gusarov <dottedmag@dottedmag.net> +Cc: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 15:33:01 -0500 + +[ multipart/mixed ] +[ multipart/signed ] +[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] +[ text/plain ] +> See the patch just posted here. + +Is the list archived anywhere? The obvious archives +(http://notmuchmail.org/pipermail/notmuch/) aren't available, and I +think I subscribed too late to get the patch (I only just saw the +discussion about it). + +It doesn't look like the patch is in git yet. + +-- Lars + +[ 4-line signature. Click/Enter to show. ] +-- +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Senior Technologist, Computing and Information Technology +Harvard University School of Engineering and Applied Sciences +[ application/pgp-signature ] +[ text/plain ] +[ 4-line signature. Click/Enter to show. ] +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch +Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox unread) +Subject: [notmuch] Working with Maildir storage? +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 02:50:48 +0600 + +Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at seas.harvard.edu did +gyre and gimble: + + LK> Is the list archived anywhere? The obvious archives + LK> (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I + LK> think I subscribed too late to get the patch (I only just saw the + LK> discussion about it). + + LK> It doesn't look like the patch is in git yet. + +Just has been pushed + +[ 10-line signature. Click/Enter to show. ] +-- +http://fossarchy.blogspot.com/ +-------------- next part -------------- +A non-text attachment was scrubbed... +Name: not available +Type: application/pgp-signature +Size: 834 bytes +Desc: not available +URL: +<http://notmuchmail.org/pipermail/notmuch/attachments/20091118/0e33d964/attachment.pgp> +Keith Packard <keithp@keithp.com> (2009-11-17) (inbox unread) +Subject: [notmuch] Working with Maildir storage? +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 13:24:13 -0800 + +On Tue, 17 Nov 2009 15:33:01 -0500, Lars Kellogg-Stedman <lars at +seas.harvard.edu> wrote: +> > See the patch just posted here. + +I've also pushed a slightly more complicated (and complete) fix to my +private notmuch repository + +git://keithp.com/git/notmuch + +> Is the list archived anywhere? + +Oops. Looks like Carl's mail server is broken. He's traveling to +Barcelona today and so it won't get fixed for a while. + +Thanks to everyone for trying out notmuch! + +-keith +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-18) (inbox signed unread) +Subject: Re: [notmuch] Working with Maildir storage? +To: Keith Packard <keithp@keithp.com> +Cc: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 19:50:40 -0500 + +[ multipart/mixed ] +[ multipart/signed ] +[ Unknown key ID 0xD74695063141ACD8 or unsupported algorithm ] +[ text/plain ] +> I've also pushed a slightly more complicated (and complete) fix to my +> private notmuch repository + +The version of lib/messages.cc in your repo doesn't build because it's +missing "#include <stdint.h>" (for the uint32_t on line 466). + +[ 4-line signature. Click/Enter to show. ] +-- +Lars Kellogg-Stedman <lars@seas.harvard.edu> +Senior Technologist, Computing and Information Technology +Harvard University School of Engineering and Applied Sciences +[ application/pgp-signature ] +[ text/plain ] +[ 4-line signature. Click/Enter to show. ] +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch +Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread) +Subject: [notmuch] Working with Maildir storage? +To: notmuch@notmuchmail.org +Date: Wed, 18 Nov 2009 02:08:10 -0800 + +On Tue, 17 Nov 2009 14:00:54 -0500, Lars Kellogg-Stedman <lars at +seas.harvard.edu> wrote: +> I saw the LWN article and decided to take a look at notmuch. I'm +> currently using mutt and mairix to index and read a collection of +> Maildir mail folders (around 40,000 messages total). + +Welcome, Lars! + +I hadn't even seen that Keith's blog post had been picked up by lwn.net. +That's very interesting. So, thanks for coming and trying out notmuch. + +> Error opening +> /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: +> Too many open files + +Sadly, the lwn article coincided with me having just introduced this +bug, and then getting on a Trans-Atlantic flight. So I fixed the bug +fairly quickly, but there was quite a bit of latency before I could push +the fix out. It should be fixed now. + +> I'm curious if this is expected behavior (i.e., notmuch does not work +> with Maildir) or if something else is going on. + +Notmuch works just fine with maildir---it's one of the things that it +likes the best. + +Happy hacking, + +-Carl diff --git a/test/emacs.expected-output/notmuch-show-thread-with-all-messages-collapsed b/test/emacs.expected-output/notmuch-show-thread-with-all-messages-collapsed new file mode 100644 index 00000000..73b0e605 --- /dev/null +++ b/test/emacs.expected-output/notmuch-show-thread-with-all-messages-collapsed @@ -0,0 +1,4 @@ +Jan Janak <jan@ryngle.com> (2009-11-17) (inbox) +Subject: [notmuch] What a great idea! + Jan Janak <jan@ryngle.com> (2009-11-17) (inbox) + Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread) diff --git a/test/emacs.expected-output/notmuch-show-thread-with-all-messages-uncollapsed b/test/emacs.expected-output/notmuch-show-thread-with-all-messages-uncollapsed new file mode 100644 index 00000000..bd5598e0 --- /dev/null +++ b/test/emacs.expected-output/notmuch-show-thread-with-all-messages-uncollapsed @@ -0,0 +1,79 @@ +Jan Janak <jan@ryngle.com> (2009-11-17) (inbox) +Subject: [notmuch] What a great idea! +To: notmuch@notmuchmail.org +Date: Tue, 17 Nov 2009 23:35:30 +0100 + +Hello, + +First of all, notmuch is a wonderful idea, both the cmdline tool and +the emacs interface! Thanks a lot for writing it, I was really excited +when I read the announcement today. + +Have you considered sending an announcement to the org-mode mailing list? +http://org-mode.org + +Various ways of searching/referencing emails from emacs were discussed +there several times and none of them were as elegant as notmuch (not +even close). Maybe notmuch would attract some of the developers +there.. + + -- Jan + Jan Janak <jan@ryngle.com> (2009-11-17) (inbox) + Subject: [notmuch] What a great idea! + To: notmuch@notmuchmail.org + Date: Tue, 17 Nov 2009 23:38:47 +0100 + + On Tue, Nov 17, 2009 at 11:35 PM, Jan Janak <jan at ryngle.com> wrote: + > Hello, + > + > First of all, notmuch is a wonderful idea, both the cmdline tool and + [ 2 more citation lines. Click/Enter to show. ] + > + > Have you considered sending an announcement to the org-mode mailing list? + > http://org-mode.org + + Sorry, wrong URL, the correct one is: http://orgmode.org + + > Various ways of searching/referencing emails from emacs were discussed + > there several times and none of them were as elegant as notmuch (not + > even close). Maybe notmuch would attract some of the developers + > there.. + + -- Jan + Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread) + Subject: [notmuch] What a great idea! + To: notmuch@notmuchmail.org + Date: Wed, 18 Nov 2009 02:49:52 -0800 + + On Tue, 17 Nov 2009 23:35:30 +0100, Jan Janak <jan at ryngle.com> wrote: + > First of all, notmuch is a wonderful idea, both the cmdline tool and + > the emacs interface! Thanks a lot for writing it, I was really excited + > when I read the announcement today. + + Ah, here's where I planned a nice welcome. So welcome (again), Jan! :-) + + I've been having a lot of fun with notmuch already, (though there have + been some days of pain before it was functional enough and my + email-reply latency went way up). But regardless---I got through that, + and I'm able to work more efficiently with notmuch now than I could with + sup before. So I'm happy. + + And I'm delighted when other people find this interesting as well. + + > Have you considered sending an announcement to the org-mode mailing list? + > http://orgmode.org + + Thanks for the idea. I think I may have looked into org-mode years ago, + (when I was investigating planner-mode and various emacs "personal wiki" + systems for keeping random notes and what-not). + + > Various ways of searching/referencing emails from emacs were discussed + > there several times and none of them were as elegant as notmuch (not + > even close). Maybe notmuch would attract some of the developers + > there.. + + Yeah. I'll drop them a mail. Having a real emacs wizard on board would + be nice. (I'm afraid the elisp I've written so far for this project is + fairly grim.) + + -Carl diff --git a/test/emacs.expected-output/notmuch-show-thread-with-hidden-messages b/test/emacs.expected-output/notmuch-show-thread-with-hidden-messages new file mode 100644 index 00000000..8a0660fa --- /dev/null +++ b/test/emacs.expected-output/notmuch-show-thread-with-hidden-messages @@ -0,0 +1,4 @@ +Jan Janak <jan@ryngle.com> (2009-11-17) (inbox unread) +Subject: [notmuch] What a great idea! + Jan Janak <jan@ryngle.com> (2009-11-17) (inbox) + Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread) diff --git a/test/emacs.expected-output/raw-message-cf0c4d-52ad0a b/test/emacs.expected-output/raw-message-cf0c4d-52ad0a new file mode 100644 index 00000000..75b05fa4 --- /dev/null +++ b/test/emacs.expected-output/raw-message-cf0c4d-52ad0a @@ -0,0 +1,104 @@ +MIME-Version: 1.0 +Date: Tue, 17 Nov 2009 11:36:14 -0800 +Message-ID: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com> +From: Alex Botero-Lowry <alex.boterolowry@gmail.com> +To: notmuch@notmuchmail.org +Content-Type: multipart/mixed; boundary=0016e687869333b1570478963d35 +Subject: [notmuch] preliminary FreeBSD support +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + <notmuch.notmuchmail.org> +List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe> +List-Archive: <http://notmuchmail.org/pipermail/notmuch> +List-Post: <mailto:notmuch@notmuchmail.org> +List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help> +List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>, + <mailto:notmuch-request@notmuchmail.org?subject=subscribe> +Sender: notmuch-bounces@notmuchmail.org +Errors-To: notmuch-bounces@notmuchmail.org + +--0016e687869333b1570478963d35 +Content-Type: multipart/alternative; boundary=0016e687869333b14e0478963d33 + +--0016e687869333b14e0478963d33 +Content-Type: text/plain; charset=ISO-8859-1 + +I saw the announcement this morning, and was very excited, as I had been +hoping sup would be turned into a library, +since I like the concept more than the UI (I'd rather an emacs interface). + +I did a preliminary compile which worked out fine, but +sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns -1 on +FreeBSD, so notmuch_config_open segfaulted. + +Attached is a patch that supplies a default buffer size of 64 in cases where +-1 is returned. + +http://www.opengroup.org/austin/docs/austin_328.txt - seems to indicate this +is acceptable behavior, +and http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.htmlspecifically +uses 64 as the +buffer size. + +--0016e687869333b14e0478963d33 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: quoted-printable + +I saw the announcement this morning, and was very excited, as I had been ho= +ping sup would be turned into a library,<br>since I like the concept more t= +han the UI (I'd rather an emacs interface).<br><br>I did a preliminary = +compile which worked out fine, but sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns= + -1 on<br> +FreeBSD, so notmuch_config_open segfaulted.<br><br>Attached is a patch that= + supplies a default buffer size of 64 in cases where -1 is returned.<br><br= +><a href=3D"http://www.opengroup.org/austin/docs/austin_328.txt">http://www= +.opengroup.org/austin/docs/austin_328.txt</a> - seems to indicate this is a= +cceptable behavior,<br> +and <a href=3D"http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg01680= +8.html">http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.html<= +/a> specifically uses 64 as the<br>buffer size.<br><br><br> + +--0016e687869333b14e0478963d33-- +--0016e687869333b1570478963d35 +Content-Type: application/octet-stream; + name="0001-Deal-with-situation-where-sysconf-_SC_GETPW_R_SIZE_M.patch" +Content-Disposition: attachment; + filename="0001-Deal-with-situation-where-sysconf-_SC_GETPW_R_SIZE_M.patch" +Content-Transfer-Encoding: base64 +X-Attachment-Id: f_g252e6gs0 + +RnJvbSBlM2JjNGJiZDdiOWQwZDA4NjgxNmFiNWY4ZjJkNmZmZWExZGQzZWE0IE1vbiBTZXAgMTcg +MDA6MDA6MDAgMjAwMQpGcm9tOiBBbGV4YW5kZXIgQm90ZXJvLUxvd3J5IDxhbGV4LmJvdGVyb2xv +d3J5QGdtYWlsLmNvbT4KRGF0ZTogVHVlLCAxNyBOb3YgMjAwOSAxMTozMDozOSAtMDgwMApTdWJq +ZWN0OiBbUEFUQ0hdIERlYWwgd2l0aCBzaXR1YXRpb24gd2hlcmUgc3lzY29uZihfU0NfR0VUUFdf +Ul9TSVpFX01BWCkgcmV0dXJucyAtMQoKLS0tCiBub3RtdWNoLWNvbmZpZy5jIHwgICAgMiArKwog +MSBmaWxlcyBjaGFuZ2VkLCAyIGluc2VydGlvbnMoKyksIDAgZGVsZXRpb25zKC0pCgpkaWZmIC0t +Z2l0IGEvbm90bXVjaC1jb25maWcuYyBiL25vdG11Y2gtY29uZmlnLmMKaW5kZXggMjQ4MTQ5Yy4u +ZTcyMjBkOCAxMDA2NDQKLS0tIGEvbm90bXVjaC1jb25maWcuYworKysgYi9ub3RtdWNoLWNvbmZp +Zy5jCkBAIC03Nyw2ICs3Nyw3IEBAIHN0YXRpYyBjaGFyICoKIGdldF9uYW1lX2Zyb21fcGFzc3dk +X2ZpbGUgKHZvaWQgKmN0eCkKIHsKICAgICBsb25nIHB3X2J1Zl9zaXplID0gc3lzY29uZihfU0Nf +R0VUUFdfUl9TSVpFX01BWCk7CisgICAgaWYgKHB3X2J1Zl9zaXplID09IC0xKSBwd19idWZfc2l6 +ZSA9IDY0OwogICAgIGNoYXIgKnB3X2J1ZiA9IHRhbGxvY196ZXJvX3NpemUgKGN0eCwgcHdfYnVm +X3NpemUpOwogICAgIHN0cnVjdCBwYXNzd2QgcGFzc3dkLCAqaWdub3JlZDsKICAgICBjaGFyICpu +YW1lOwpAQCAtMTAxLDYgKzEwMiw3IEBAIHN0YXRpYyBjaGFyICoKIGdldF91c2VybmFtZV9mcm9t +X3Bhc3N3ZF9maWxlICh2b2lkICpjdHgpCiB7CiAgICAgbG9uZyBwd19idWZfc2l6ZSA9IHN5c2Nv +bmYoX1NDX0dFVFBXX1JfU0laRV9NQVgpOworICAgIGlmIChwd19idWZfc2l6ZSA9PSAtMSkgcHdf +YnVmX3NpemUgPSA2NDsKICAgICBjaGFyICpwd19idWYgPSB0YWxsb2NfemVyb19zaXplIChjdHgs +IHB3X2J1Zl9zaXplKTsKICAgICBzdHJ1Y3QgcGFzc3dkIHBhc3N3ZCwgKmlnbm9yZWQ7CiAgICAg +Y2hhciAqbmFtZTsKLS0gCjEuNi41LjIKCg== +--0016e687869333b1570478963d35 +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +_______________________________________________ +notmuch mailing list +notmuch@notmuchmail.org +http://notmuchmail.org/mailman/listinfo/notmuch + +--0016e687869333b1570478963d35-- + diff --git a/test/export-dirs.sh b/test/export-dirs.sh new file mode 100644 index 00000000..0578b1e5 --- /dev/null +++ b/test/export-dirs.sh @@ -0,0 +1,32 @@ +# Source this script to set and export NOTMUCH_SRCDIR and +# NOTMUCH_BUILDDIR. +# +# For this to work, always have current directory somewhere within the +# build directory hierarchy, and run the script sourcing this script +# using a path (relative or absolute) to the source directory. + +if [[ -z "${NOTMUCH_SRCDIR}" ]]; then + export NOTMUCH_SRCDIR="$(cd "$(dirname "$0")"/.. && pwd)" +fi + +find_builddir() +{ + local dir="$1" + + while [[ -n "$dir" ]] && [[ "$dir" != "/" ]]; do + if [[ -x "$dir/notmuch" ]] && [[ ! -d "$dir/notmuch" ]]; then + echo "$dir" + break + fi + dir="$(dirname "$dir")" + done +} + +if [[ -z "${NOTMUCH_BUILDDIR}" ]]; then + export NOTMUCH_BUILDDIR="$(find_builddir "$(pwd)")" + + if [[ -z "${NOTMUCH_BUILDDIR}" ]]; then + echo "Run tests in a subdir of built notmuch tree." >&2 + exit 1 + fi +fi diff --git a/test/gen-threads.py b/test/gen-threads.py new file mode 100644 index 00000000..70fb1f68 --- /dev/null +++ b/test/gen-threads.py @@ -0,0 +1,33 @@ +# Generate all possible single-root message thread structures of size +# argv[1]. Each output line is a thread structure, where the n'th +# field is either a number giving the parent of message n or "None" +# for the root. +import sys +from itertools import chain, combinations + +def subsets(s): + return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) + +nodes = set(range(int(sys.argv[1]))) + +# Queue of (tree, free, to_expand) where tree is a {node: parent} +# dictionary, free is a set of unattached nodes, and to_expand is +# itself a queue of nodes in the tree that need to be expanded. +# The queue starts with all single-node trees. +queue = [({root: None}, nodes - {root}, (root,)) for root in nodes] + +# Process queue +while queue: + tree, free, to_expand = queue.pop() + + if len(to_expand) == 0: + # Only print full-sized trees + if len(free) == 0: + print(" ".join(map(str, [msg[1] for msg in sorted(tree.items())]))) + else: + # Expand node to_expand[0] with each possible set of children + for children in subsets(free): + ntree = {child: to_expand[0] for child in children} + ntree.update(tree) + nfree = free.difference(children) + queue.append((ntree, nfree, to_expand[1:] + tuple(children))) diff --git a/test/ghost-report.cc b/test/ghost-report.cc new file mode 100644 index 00000000..3e1b07c6 --- /dev/null +++ b/test/ghost-report.cc @@ -0,0 +1,14 @@ +#include <iostream> +#include <cstdlib> +#include <xapian.h> + +int main(int argc, char **argv) { + + if (argc < 2) { + std::cerr << "usage: ghost-report xapian-dir" << std::endl; + exit(1); + } + + Xapian::Database db(argv[1]); + std::cout << db.get_termfreq("Tghost") << std::endl; +} diff --git a/test/gnupg-secret-key.NOTE b/test/gnupg-secret-key.NOTE new file mode 100644 index 00000000..604496c5 --- /dev/null +++ b/test/gnupg-secret-key.NOTE @@ -0,0 +1,9 @@ +How the crypto test gnupg secret was generated: + +GNUPGHOME=gnupghome gpg --quick-random --gen-key +kind: 1 (RSA/RSA) +size: 1024 +expire: 0 +name: Notmuch Test Suite +email: test_suite@notmuchmail.org +(no passphrase) diff --git a/test/gnupg-secret-key.asc b/test/gnupg-secret-key.asc new file mode 100644 index 00000000..6431b56c --- /dev/null +++ b/test/gnupg-secret-key.asc @@ -0,0 +1,34 @@ +-----BEGIN PGP PRIVATE KEY BLOCK----- +Version: GnuPG v1.4.10 (GNU/Linux) + +lQHYBE1Mm18BBADlMsMlUeO6usp/XuulgimqlCSphHcYZvH6+Sy7u7W4TpJzid7e +jEOCrk3UZi2XMPW9+snDMhV9e28HeRz61zAO9G/gedn4N+mKOyTaELEmj9SP2IG2 +ZTvdUvn30vWIHyfRIww3qEiSzNULKn6zTDfcg6BIY6ZDQ6GFSfH5EioxuQARAQAB +AAP8CM2/sS9JZWLHZHJrmsU6fygxlaarlxmyhxwLG9WZ+qUJ+xDQqWZkhssrMigP +7ZQehwLwZ7mvbvfOy/qwTPJMZjQMMuTGEzclwBTOTttSxEDS+kgYmZ05CBjIgXbo +8+k+L347l+kVRBFsi1cqOkCr+VZQwhOnbeNb8uJsUx27aAECAPD7jsBP73LRgoXQ +x650D2fzjjuomGVsIxSAPjkDRYmtorsRftaEy7DkvX3Ihu5WN6YRRjJavoL+f8ar +4escR40CAPN7NOFOGmiFZYzQcfJYQI2m7YDk4B51JxORFvLrvGT+LJnVwhtFsdGS +QnMyO4eNpKH0qeEkT5Zqha2oyAc0Yd0B/3f962YCmYlbDAvWjcbMvhV7G4DbazVp +2TNR0BhhEMiOlHuwmTO59s2iukuE5ifaVbwrj+NgpipTsaffKnhALlGjV7Q7Tm90 +bXVjaCBUZXN0IFN1aXRlIDx0ZXN0X3N1aXRlQG5vdG11Y2htYWlsLm9yZz4gKElO +U0VDVVJFISmIuAQTAQIAIgUCTUybXwIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgEC +F4AACgkQbZJhLZTkY4GJFAP9E0mOw+RUGdmqbxSbd2rm0/inUSYOC0Pvt/D05pUY +xzXDAMZwsy1DWhfS7bSgdD3YTM/22b/LJ2FmbLUF1cU6cNslmdPdfHDZ5+C4qpa1 +uW11y7djlBFAwxc3NBypT6Bmh/iIixrx413cw8CEU0lSZbSXUvbxZ7Rg4JYm2K6f +Y7SdAdgETUybXwEEAM74QJJWzPavquSF0IkKDFjEvI44WC1HGNsJF3JVuKv9G00P +RaHavNNcHEG8MorbfaWk7pipaEJ3+zbPKgp2vRCSJnLL6z813JIQqXJTZzu1ip63 +s4icfOfXkxFJ5AaFd/pVdi+wjmEwvv+YMtJT9DyXANo6b2eQu+0bMtP4Xuv/ABEB +AAEAA/wJArUJw450070K6eoXeg22wT0iq/O0aCExSzoI5Kmywytj6KnnAmp9TftL +WVgrkQntVjrhzPsYoB40JEMrGKd7QL/6LPTNWq3eFW38PSpCiG83T0rtmKCKqHB1 +Uo0B78AHfYYX7MUOEuCq2AhKTAdZukesoCpmVxcEFtjDEbOB8QIA3cvXrPJN/J2S +W61mdMT7KlaXZZD8Phs/TY2ZLAiMKUAP1dVYNDvRSDjZLvQrqKQjEAN5jM81cWAV +pvOIavLhOwIA7uMVIiaQ3vIy10C7ltiLT6YuJL/O6XDnXY/PDuXOatQahd/gmI0q +dGQLSaHIxYILPZPaW6t0orx+dduQ0ES0DQIA21nEKX0MZpYOY1eIt6OlKemsjL2a +UTdFhq/OgwVv+QRVHNdYQXmKpKDeW30lN/+BI3zyDTZjtehwKMMxNTu4AJu/iJ8E +GAECAAkFAk1Mm18CGwwACgkQbZJhLZTkY4H8kgQA4vHsTt8dlJdWJAu2SKZGOPRs +bIPu5XtRXe3RYbW5H7PqbAnrKIzlIKpkPNTwLL4wVXaF+R/aHa8ZKX3paohrPL74 +qpbffwtHXyVEwyWlw3m9mgti0de1dy1YvVasCe/UQ8Frc6uNmOwtlQE20k4R4cLI +SWXT1JrwPoKh9xe++90= +=rvTR +-----END PGP PRIVATE KEY BLOCK----- diff --git a/test/hex-xcode.c b/test/hex-xcode.c new file mode 100644 index 00000000..33046e9a --- /dev/null +++ b/test/hex-xcode.c @@ -0,0 +1,109 @@ +/* No, nothing to to with IDE from Apple Inc. + * testbed for ../util/hex-escape.c. + * + * usage: + * hex-xcode [--direction=(encode|decode)] [--omit-newline] < file + * hex-xcode [--direction=(encode|decode)] [--omit-newline] [--in-place] arg1 arg2 arg3 ... + * + */ + +#include "notmuch-client.h" +#include "hex-escape.h" +#include <assert.h> + +enum direction { + ENCODE, + DECODE +}; + +static bool inplace = false; + +static int +xcode (void *ctx, enum direction dir, char *in, char **buf_p, size_t *size_p) +{ + hex_status_t status; + + if (dir == ENCODE) + status = hex_encode (ctx, in, buf_p, size_p); + else + if (inplace) { + status = hex_decode_inplace (in); + *buf_p = in; + *size_p = strlen(in); + } else { + status = hex_decode (ctx, in, buf_p, size_p); + } + + if (status == HEX_SUCCESS) + fputs (*buf_p, stdout); + + return status; +} + +int +main (int argc, char **argv) +{ + + int dir = DECODE; + bool omit_newline = false; + + notmuch_opt_desc_t options[] = { + { .opt_keyword = &dir, .name = "direction", .keywords = + (notmuch_keyword_t []){ { "encode", ENCODE }, + { "decode", DECODE }, + { 0, 0 } } }, + { .opt_bool = &omit_newline, .name = "omit-newline" }, + { .opt_bool = &inplace, .name = "in-place" }, + { } + }; + + int opt_index = parse_arguments (argc, argv, options, 1); + + if (opt_index < 0) + exit (1); + + void *ctx = talloc_new (NULL); + + char *line = NULL; + size_t line_size; + ssize_t line_len; + + char *buffer = NULL; + size_t buf_size = 0; + + bool read_stdin = true; + + for (; opt_index < argc; opt_index++) { + + if (xcode (ctx, dir, argv[opt_index], + &buffer, &buf_size) != HEX_SUCCESS) + return 1; + + if (! omit_newline) + putchar ('\n'); + + read_stdin = false; + } + + if (! read_stdin) + return 0; + + while ((line_len = getline (&line, &line_size, stdin)) != -1) { + + chomp_newline (line); + + if (xcode (ctx, dir, line, &buffer, &buf_size) != HEX_SUCCESS) + return 1; + + if (! omit_newline) + putchar ('\n'); + + } + + if (line) + free (line); + + talloc_free (ctx); + + return 0; +} diff --git a/test/make-db-version.cc b/test/make-db-version.cc new file mode 100644 index 00000000..fa80cac9 --- /dev/null +++ b/test/make-db-version.cc @@ -0,0 +1,35 @@ +/* Create an empty notmuch database with a specific version and + * features. */ + +#include <stdio.h> +#include <stdlib.h> +#include <sys/stat.h> +#include <sys/types.h> + +#include <xapian.h> + +int main(int argc, char **argv) +{ + if (argc != 4) { + fprintf (stderr, "Usage: %s mailpath version features\n", argv[0]); + exit (2); + } + + std::string nmpath (argv[1]); + nmpath += "/.notmuch"; + if (mkdir (nmpath.c_str (), 0777) < 0) { + perror (("failed to create " + nmpath).c_str ()); + exit (1); + } + + try { + Xapian::WritableDatabase db ( + nmpath + "/xapian", Xapian::DB_CREATE_OR_OPEN); + db.set_metadata ("version", argv[2]); + db.set_metadata ("features", argv[3]); + db.commit (); + } catch (const Xapian::Error &e) { + fprintf (stderr, "%s\n", e.get_description ().c_str ()); + exit (1); + } +} diff --git a/test/message-id-parse.c b/test/message-id-parse.c new file mode 100644 index 00000000..752eb1fd --- /dev/null +++ b/test/message-id-parse.c @@ -0,0 +1,26 @@ +#include <stdio.h> +#include <talloc.h> +#include "notmuch-private.h" + +int +main (unused (int argc), unused (char **argv)) +{ + char *line = NULL; + size_t len = 0; + ssize_t nread; + void *local = talloc_new (NULL); + + while ((nread = getline (&line, &len, stdin)) != -1) { + int last = strlen (line) - 1; + if (line[last] == '\n') + line[last] = '\0'; + + char *mid = _notmuch_message_id_parse_strict (local, line); + if (mid) + printf ("GOOD: %s\n", mid); + else + printf ("BAD: %s\n", line); + } + + talloc_free (local); +} diff --git a/test/notmuch-test b/test/notmuch-test new file mode 100755 index 00000000..ca68dd41 --- /dev/null +++ b/test/notmuch-test @@ -0,0 +1,64 @@ +#!/usr/bin/env bash + +# Run tests +# +# Copyright (c) 2005 Junio C Hamano +# Copyright (c) 2010 Notmuch Developers +# +# Adapted from a Makefile to a shell script by Carl Worth (2010) + +if [ ${BASH_VERSINFO[0]} -lt 4 ]; then + echo "Error: The notmuch test suite requires a bash version >= 4.0" + echo "due to use of associative arrays within the test suite." + echo "Please try again with a newer bash (or help us fix the" + echo "test suite to be more portable). Thanks." + exit 1 +fi + +# Ensure NOTMUCH_SRCDIR and NOTMUCH_BUILDDIR are set. +. $(dirname "$0")/export-dirs.sh || exit 1 + +TESTS= +for test in $NOTMUCH_TESTS; do + TESTS="$TESTS $NOTMUCH_SRCDIR/test/$test" +done + +if [[ -z "$TESTS" ]]; then + TESTS="$NOTMUCH_SRCDIR/test/T[0-9][0-9][0-9]-*.sh" +fi + +# Clean up any results from a previous run +rm -rf $NOTMUCH_BUILDDIR/test/test-results + +# Test for timeout utility +if command -v timeout >/dev/null; then + TEST_TIMEOUT_CMD="timeout 2m" + echo "INFO: using 2 minute timeout for tests" +else + TEST_TIMEOUT_CMD="" +fi + +trap 'e=$?; kill $!; exit $e' HUP INT TERM +# Run the tests +for test in $TESTS; do + $TEST_TIMEOUT_CMD $test "$@" & + wait $! + # If the test failed without producing results, then it aborted, + # so we should abort, too. + RES=$? + testname=$(basename $test .sh) + if [[ $RES != 0 && ! -e "$NOTMUCH_BUILDDIR/test/test-results/$testname" ]]; then + exit $RES + fi +done +trap - HUP INT TERM + +# Report results +echo +$NOTMUCH_SRCDIR/test/aggregate-results.sh $NOTMUCH_BUILDDIR/test/test-results/* +ev=$? + +# Clean up +rm -rf $NOTMUCH_BUILDDIR/test/test-results $NOTMUCH_BUILDDIR/test/corpora.mail + +exit $ev diff --git a/test/notmuch-test.h b/test/notmuch-test.h new file mode 100644 index 00000000..45d03d67 --- /dev/null +++ b/test/notmuch-test.h @@ -0,0 +1,16 @@ +#ifndef _NOTMUCH_TEST_H +#define _NOTMUCH_TEST_H +#include <stdio.h> +#include <notmuch.h> + +inline static void +expect0(int line, notmuch_status_t ret) +{ + if (ret) { + fprintf (stderr, "line %d: %d\n", line, ret); + exit (1); + } +} + +#define EXPECT0(v) expect0(__LINE__, v); +#endif diff --git a/test/parse-time.c b/test/parse-time.c new file mode 100644 index 00000000..694761cf --- /dev/null +++ b/test/parse-time.c @@ -0,0 +1,314 @@ +/* + * parse time string - user friendly date and time parser + * Copyright © 2012 Jani Nikula + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + * Author: Jani Nikula <jani@nikula.org> + */ + +#include <assert.h> +#include <ctype.h> +#include <getopt.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "parse-time-string.h" + +#define ARRAY_SIZE(a) (sizeof (a) / sizeof (a[0])) + +static const char *parse_time_error_strings[] = { + [PARSE_TIME_OK] = "OK", + [PARSE_TIME_ERR] = "ERR", + [PARSE_TIME_ERR_LIB] = "LIB", + [PARSE_TIME_ERR_ALREADYSET] = "ALREADYSET", + [PARSE_TIME_ERR_FORMAT] = "FORMAT", + [PARSE_TIME_ERR_DATEFORMAT] = "DATEFORMAT", + [PARSE_TIME_ERR_TIMEFORMAT] = "TIMEFORMAT", + [PARSE_TIME_ERR_INVALIDDATE] = "INVALIDDATE", + [PARSE_TIME_ERR_INVALIDTIME] = "INVALIDTIME", + [PARSE_TIME_ERR_KEYWORD] = "KEYWORD", +}; + +static const char * +parse_time_strerror (unsigned int errnum) +{ + if (errnum < ARRAY_SIZE (parse_time_error_strings)) + return parse_time_error_strings[errnum]; + else + return NULL; +} + +/* + * concat argv[start]...argv[end - 1], separating them by a single + * space, to a malloced string + */ +static char * +concat_args (int start, int end, char *argv[]) +{ + int i; + size_t len = 1; + char *p; + + for (i = start; i < end; i++) + len += strlen (argv[i]) + 1; + + p = malloc (len); + if (!p) + return NULL; + + *p = 0; + + for (i = start; i < end; i++) { + if (i != start) + strcat (p, " "); + strcat (p, argv[i]); + } + + return p; +} + +#define DEFAULT_FORMAT "%a %b %d %T %z %Y" + +static void +usage (const char *name) +{ + printf ("Usage: %s [options ...] [<date/time>]\n\n", name); + printf ( + "Parse <date/time> and display it in given format. If <date/time> is\n" + "not given, parse each line in stdin according to:\n\n" + " <date/time> [(==>|==_>|==^>|==^^>)<ignored>] [#<comment>]\n\n" + "and produce output:\n\n" + " <date/time> (==>|==_>|==^>|==^^>) <time in --format=FMT> [#<comment>]\n\n" + "preserving whitespace and comment in input. The operators ==>, ==_>,\n" + "==^>, and ==^^> define rounding as no rounding, round down, round up\n" + "inclusive, and round up, respectively.\n\n" + + " -f, --format=FMT output format, FMT according to strftime(3)\n" + " (default: \"%s\")\n" + " -r, --ref=N use N seconds since epoch as reference time\n" + " (default: now)\n" + " -u, --^ round result up inclusive (default: no rounding)\n" + " -U, --^^ round result up (default: no rounding)\n" + " -d, --_ round result down (default: no rounding)\n" + " -h, --help print this help\n", + DEFAULT_FORMAT); +} + +struct { + const char *operator; + int round; +} operators[] = { + { "==>", PARSE_TIME_NO_ROUND }, + { "==_>", PARSE_TIME_ROUND_DOWN }, + { "==^>", PARSE_TIME_ROUND_UP_INCLUSIVE }, + { "==^^>", PARSE_TIME_ROUND_UP }, +}; + +static const char * +find_operator_in_string (char *str, char **ptr, int *round) +{ + const char *oper = NULL; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE (operators); i++) { + char *p = strstr (str, operators[i].operator); + if (p) { + if (round) + *round = operators[i].round; + if (ptr) + *ptr = p; + + oper = operators[i].operator; + break; + } + } + + return oper; +} + +static const char * +get_operator (int round) +{ + const char *oper = NULL; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(operators); i++) { + if (round == operators[i].round) { + oper = operators[i].operator; + break; + } + } + + return oper; +} + +static int +parse_stdin (FILE *infile, time_t *ref, int round, const char *format) +{ + char *input = NULL; + char result[1024]; + size_t inputsize; + ssize_t len; + struct tm tm; + time_t t; + int r; + + while ((len = getline (&input, &inputsize, infile)) != -1) { + const char *oper; + char *trail, *tmp; + + /* trail is trailing whitespace and (optional) comment */ + trail = strchr (input, '#'); + if (!trail) + trail = input + len; + + while (trail > input && isspace ((unsigned char) *(trail-1))) + trail--; + + if (trail == input) { + printf ("%s", input); + continue; + } + + tmp = strdup (trail); + if (!tmp) { + fprintf (stderr, "strdup() failed\n"); + continue; + } + *trail = '\0'; + trail = tmp; + + /* operator */ + oper = find_operator_in_string (input, &tmp, &round); + if (oper) { + *tmp = '\0'; + } else { + oper = get_operator (round); + assert (oper); + } + + r = parse_time_string (input, &t, ref, round); + if (!r) { + if (!localtime_r (&t, &tm)) { + fprintf (stderr, "localtime_r() failed\n"); + free (trail); + continue; + } + + strftime (result, sizeof (result), format, &tm); + } else { + const char *errstr = parse_time_strerror (r); + if (errstr) + snprintf (result, sizeof (result), "ERROR: %s", errstr); + else + snprintf (result, sizeof (result), "ERROR: %d", r); + } + + printf ("%s%s %s%s", input, oper, result, trail); + free (trail); + } + + free (input); + + return 0; +} + +int +main (int argc, char *argv[]) +{ + int r; + struct tm tm; + time_t result; + time_t now; + time_t *nowp = NULL; + char *argstr; + int round = PARSE_TIME_NO_ROUND; + char buf[1024]; + const char *format = DEFAULT_FORMAT; + struct option options[] = { + { "help", no_argument, NULL, 'h' }, + { "^", no_argument, NULL, 'u' }, + { "^^", no_argument, NULL, 'U' }, + { "_", no_argument, NULL, 'd' }, + { "format", required_argument, NULL, 'f' }, + { "ref", required_argument, NULL, 'r' }, + { NULL, 0, NULL, 0 }, + }; + + for (;;) { + int c; + + c = getopt_long (argc, argv, "huUdf:r:", options, NULL); + if (c == -1) + break; + + switch (c) { + case 'f': + /* output format */ + format = optarg; + break; + case 'u': + round = PARSE_TIME_ROUND_UP_INCLUSIVE; + break; + case 'U': + round = PARSE_TIME_ROUND_UP; + break; + case 'd': + round = PARSE_TIME_ROUND_DOWN; + break; + case 'r': + /* specify now in seconds since epoch */ + now = (time_t) strtol (optarg, NULL, 10); + if (now >= (time_t) 0) + nowp = &now; + break; + case 'h': + case '?': + default: + usage (argv[0]); + return 1; + } + } + + if (optind == argc) + return parse_stdin (stdin, nowp, round, format); + + argstr = concat_args (optind, argc, argv); + if (!argstr) + return 1; + + r = parse_time_string (argstr, &result, nowp, round); + + free (argstr); + + if (r) { + const char *errstr = parse_time_strerror (r); + if (errstr) + fprintf (stderr, "ERROR: %s\n", errstr); + else + fprintf (stderr, "ERROR: %d\n", r); + + return r; + } + + if (!localtime_r (&result, &tm)) + return 1; + + strftime (buf, sizeof (buf), format, &tm); + printf ("%s\n", buf); + + return 0; +} diff --git a/test/random-corpus.c b/test/random-corpus.c new file mode 100644 index 00000000..9272afda --- /dev/null +++ b/test/random-corpus.c @@ -0,0 +1,230 @@ +/* + * Generate a random corpus of stub messages. + * + * Initial use case is testing dump and restore, so we only have + * message-ids and tags. + * + * Generated message-id's and tags are intentionally nasty. + * + * Copyright (c) 2012 David Bremner + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see https://www.gnu.org/licenses/ . + * + * Author: David Bremner <david@tethera.net> + */ + +#include <stdlib.h> +#include <assert.h> +#include <talloc.h> +#include <string.h> +#include <glib.h> +#include <math.h> + +#include "notmuch-client.h" +#include "command-line-arguments.h" +#include "database-test.h" + +/* Current largest Unicode value defined. Note that most of these will + * be printed as boxes in most fonts. + */ + +#define GLYPH_MAX 0x10FFFE + + +typedef struct { + int weight; + int start; + int stop; +} char_class_t; + +/* + * Choose about half ascii as test characters, as ascii + * punctation and whitespace is the main cause of problems for + * the (old) restore parser. + * + * We then favour code points with 2 byte encodings. Note that + * code points 0xD800-0xDFFF are forbidden in UTF-8. + */ + +static const +char_class_t char_class[] = { { 0.50 * GLYPH_MAX, 0x0001, 0x007f }, + { 0.75 * GLYPH_MAX, 0x0080, 0x07ff }, + { 0.88 * GLYPH_MAX, 0x0800, 0xd7ff }, + { 0.90 * GLYPH_MAX, 0xE000, 0xffff }, + { GLYPH_MAX, 0x10000, GLYPH_MAX } }; + +static gunichar +random_unichar () +{ + int i; + int class = random () % GLYPH_MAX; + int size; + + for (i = 0; char_class[i].weight < class; i++) /* nothing */; + + size = char_class[i].stop - char_class[i].start + 1; + + return char_class[i].start + (random () % size); +} + +static char * +random_utf8_string (void *ctx, size_t char_count) +{ + size_t offset = 0; + size_t i; + gchar *buf = NULL; + size_t buf_size = 0; + + for (i = 0; i < char_count; i++) { + gunichar randomchar; + size_t written; + + /* 6 for one glyph, one for null, one for luck */ + while (buf_size <= offset + 8) { + buf_size = 2 * buf_size + 8; + buf = talloc_realloc (ctx, buf, gchar, buf_size); + } + + do { + randomchar = random_unichar (); + } while (randomchar == '\n'); + + written = g_unichar_to_utf8 (randomchar, buf + offset); + + if (written <= 0) { + fprintf (stderr, "error converting to utf8\n"); + exit (1); + } + + offset += written; + + } + buf[offset] = 0; + return buf; +} + +/* stubs since we cannot link with notmuch.o */ +const notmuch_opt_desc_t notmuch_shared_options[] = { + { } +}; + +const char *notmuch_requested_db_uuid = NULL; + +void +notmuch_process_shared_options (unused (const char *dummy)) +{ +} + +int +notmuch_minimal_options (unused (const char *subcommand), + unused (int argc), + unused (char **argv)) +{ + return 0; +} + +int +main (int argc, char **argv) +{ + + void *ctx = talloc_new (NULL); + + const char *config_path = NULL; + notmuch_config_t *config; + notmuch_database_t *notmuch; + + int num_messages = 500; + int max_tags = 10; + // leave room for UTF-8 encoding. + int tag_len = NOTMUCH_TAG_MAX / 6; + // NOTMUCH_MESSAGE_ID_MAX is not exported, so we make a + // conservative guess. + int message_id_len = (NOTMUCH_TAG_MAX - 20) / 6; + + int seed = 734569; + + notmuch_opt_desc_t options[] = { + { .opt_string = &config_path, .name = "config-path" }, + { .opt_int = &num_messages, .name = "num-messages" }, + { .opt_int = &max_tags, .name = "max-tags" }, + { .opt_int = &message_id_len, .name = "message-id-len" }, + { .opt_int = &tag_len, .name = "tag-len" }, + { .opt_int = &seed, .name = "seed" }, + { } + }; + + int opt_index = parse_arguments (argc, argv, options, 1); + + if (opt_index < 0) + exit (1); + + if (message_id_len < 1) { + fprintf (stderr, "message id's must be least length 1\n"); + exit (1); + } + + if (config_path == NULL) { + fprintf (stderr, "configuration path must be specified"); + exit (1); + } + + config = notmuch_config_open (ctx, config_path, false); + if (config == NULL) + return 1; + + if (notmuch_database_open (notmuch_config_get_database_path (config), + NOTMUCH_DATABASE_MODE_READ_WRITE, ¬much)) + return 1; + + srandom (seed); + + int count; + for (count = 0; count < num_messages; count++) { + int j; + /* explicitly allow zero tags */ + int num_tags = random () % (max_tags + 1); + /* message ids should be non-empty */ + int this_mid_len = (random () % message_id_len) + 1; + const char **tag_list; + char *mid; + notmuch_status_t status; + + do { + mid = random_utf8_string (ctx, this_mid_len); + + tag_list = talloc_realloc (ctx, NULL, const char *, num_tags + 1); + + for (j = 0; j < num_tags; j++) { + int this_tag_len = random () % tag_len + 1; + + tag_list[j] = random_utf8_string (ctx, this_tag_len); + } + + tag_list[j] = NULL; + + status = notmuch_database_add_stub_message (notmuch, mid, tag_list); + } while (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID); + + if (status != NOTMUCH_STATUS_SUCCESS) { + fprintf (stderr, "error %d adding message", status); + exit (status); + } + } + + notmuch_database_destroy (notmuch); + + talloc_free (ctx); + + return 0; +} diff --git a/test/smime/README b/test/smime/README new file mode 100644 index 00000000..92803c77 --- /dev/null +++ b/test/smime/README @@ -0,0 +1,7 @@ +test.crt: self signed certificated + % gpgsm --gen-key # needs gpgsm 2.1 + +key+cert.pem: cert + unencryped private + % gpsm --import test.crt + % gpgsm --export-private-key-p12 -out foo.p12 (no passphrase) + % openssl pkcs12 -in ns.p12 -clcerts -nodes > key+cert.pem diff --git a/test/smime/key+cert.pem b/test/smime/key+cert.pem new file mode 100644 index 00000000..6ee30cf8 --- /dev/null +++ b/test/smime/key+cert.pem @@ -0,0 +1,56 @@ +Bag Attributes + friendlyName: GnuPG exported certificate e0972a47 + localKeyID: 61 6F 46 CD 73 83 4C 63 84 77 56 AF 0D FB 64 A6 E0 97 2A 47 +subject=/CN=Notmuch Test Suite +issuer=/CN=Notmuch Test Suite +-----BEGIN CERTIFICATE----- +MIIDCzCCAfOgAwIBAgIIb3SMlL0MZ6kwDQYJKoZIhvcNAQELBQAwHTEbMBkGA1UE +AxMSTm90bXVjaCBUZXN0IFN1aXRlMCAXDTE1MTIxNDAyMDgxMFoYDzIwNjMwNDA1 +MTcwMDAwWjAdMRswGQYDVQQDExJOb3RtdWNoIFRlc3QgU3VpdGUwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQC7vH1/lkENTAJRbyq2036K7Pw+imSIhB5T +U0WnAgVGWOemY1Eppi9Dk6rjDxuuUKOCQ5el2wmFZN57Fi/4leBH7x217BnnqWNU +QV88DxEfV+sk8dSb4a5FOOyfhFJmZso/0lK8x0fBcCNjmRFIjB1afSSXWnCvRpAR +v+O9trLJuIjbbmXg1gltjuB5yDw8/OLEI7G7YSIop9FxopWJL5rW/o2WEfRPGpYe +HNRLObCRIvbyDd6XjaCrKBuIrhN7R7mmIa9PUyl8TiY+pCMWs9dHmOsiC73/+P6E +AhsTOY1bfbGQXBAGZ/FL+SgC5wEcPr2u3+y8y5gw2bpaVhQnu6YLAgMBAAGjTTBL +MCUGA1UdEQQeMByBGnRlc3Rfc3VpdGVAbm90bXVjaG1haWwub3JnMBEGCisGAQQB +2kcCAgEEAwEB/zAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBb +XP5OnRVplrEdlnivx3CbCLWO13fcMWXfvKxLGsKFwKuxtpvINFUKM+jDr0kVdQ3d +u3DJe2hNFQMILK/KrGyN5qEz2YBdHNvdkkvWA+3WHr/tiNr6Rly6QuxBzouxzmRu +MmnUhsOzZaHT3GmLSVJlwie8KqSfKVGwyBmCyHbUQkMrSEV6QDESN6KyWt85gokB +56Bc/wVq073xS1nFbfF1M3Z5q5BlLZK4IOerKTQx/oSfR4EX6B7rW2pttWsUCyEj +LljaA8ehxR9B29m08IGGl43pHEpC1WnOHvsEGs99mPpjWbUgVv5KY7OuS/8iVw6v +/Yy5Z+JBwlMzTBaUXXl3 +-----END CERTIFICATE----- +Bag Attributes + friendlyName: GnuPG exported certificate e0972a47 + localKeyID: 61 6F 46 CD 73 83 4C 63 84 77 56 AF 0D FB 64 A6 E0 97 2A 47 +Key Attributes: <No Attributes> +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC7vH1/lkENTAJR +byq2036K7Pw+imSIhB5TU0WnAgVGWOemY1Eppi9Dk6rjDxuuUKOCQ5el2wmFZN57 +Fi/4leBH7x217BnnqWNUQV88DxEfV+sk8dSb4a5FOOyfhFJmZso/0lK8x0fBcCNj +mRFIjB1afSSXWnCvRpARv+O9trLJuIjbbmXg1gltjuB5yDw8/OLEI7G7YSIop9Fx +opWJL5rW/o2WEfRPGpYeHNRLObCRIvbyDd6XjaCrKBuIrhN7R7mmIa9PUyl8TiY+ +pCMWs9dHmOsiC73/+P6EAhsTOY1bfbGQXBAGZ/FL+SgC5wEcPr2u3+y8y5gw2bpa +VhQnu6YLAgMBAAECggEAVhtHCHz3C01Ahu9RDRgGI1w8+cZqA/9tFVTNTqNrne9r +GHLXKB4z8W/KYmhsjtAnnri31neXb1prfNMZX5AGlZfD7cwDubCEgYGWV6qldNXT +YVeV54VkdBV+2k9Lp/Ifc5RZJILWk4+Ge8kaF0dEs1tQrCbsJkhcDfgQUdR5PnGe +6cKv/8HJo0ep6u5cJloIluit8yF3z4+aHixMQBvQKm/8tug+EsrQZ3IVXbh1hONO +AZ68z9CrU2pJ/0w/jwwcM5feRfTMC7bZ3vkQb1mQKYFJrvN77TGroUtAZFWqJw7M +r0f2MShdVjfEdJ1ySnCyKF24cSSPSQsLZUe4UlFyQQKBgQDlqr9ajaUzc6Lyma2e +Q1IJapbX2OZQtf5tlKVCVtZOlu5r97YMOK96XsQFKtdxhAhrGvvTJwPmwhj+fqfR +XltNrmUBpHCMsm9nloADvBS83KTP5tw9TMT0VZpt+m5XmvutdyQbSKwy+KMy+GZz +/XBQCfTEoiDS4grGFftvZuRB4QKBgQDRQvsVFMh2NOnVGqczHJNGjvbDueUJmPUN +3VxZc/FpBGLRSoN7uxQ4dGNnwyvXHs+pLAAC6xZpFCos9c3R8EPvoMyUehoDSAKW +CMD4C+K8z7n4ducE5a0NrGIgQvnXtteKr3ZwK8V7cscyTCyjXdrQmQ5XHeue8asR +758g+dG9awKBgEWuZJho2XKe5xWMIu0dp8pLmLCsklRyo1tD+lACYMs/Z99CLO3Q +VQ1fq0GWGf/K+3LjoPwTnk9pHIQ6kVgotLMA8oxpA+zsRni7ZOO9MN2MZETf2nqO +zEMFpfEwRkI2N54Nw9qzVeuxHHLegtc2Udk27BisyCCzjGlFSiAmq6KBAoGAFGfE +RXjcvT65HX8Gaya+wtugFB8BRx0JX7dI6OLk5ZKLmq0ykH2bQepgnWermmU4we77 +0Dvtfa3u0YjZ/24XXg2YbSpWiWps0Y2/C7AyAAzq12/1OGcX5qk4Tbd0f+QkIset +qxzmt4XcAKw50J+Vf3DmbYQ1M/BftCZcTm0ShHcCgYEAxp8mjE8iIHxFrm7nHMS0 +2/iWxO8DYaAZ0OLfjaZELHchVvTwa+DynbkwvOc3l4cbNTVaf9O6nmHTkLyBLBNr +2htPKm1vi9TzNdvGqobFO3ijfvdGvq1rjQl86ns0cf395REmEaVX3zcw2v+GyC5n +qE6Aa5bvdZ9Yykg6aoFo1mY= +-----END PRIVATE KEY----- diff --git a/test/smime/test.crt b/test/smime/test.crt new file mode 100644 index 00000000..e5d1e822 --- /dev/null +++ b/test/smime/test.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDCzCCAfOgAwIBAgIIb3SMlL0MZ6kwDQYJKoZIhvcNAQELBQAwHTEbMBkGA1UE +AxMSTm90bXVjaCBUZXN0IFN1aXRlMCAXDTE1MTIxNDAyMDgxMFoYDzIwNjMwNDA1 +MTcwMDAwWjAdMRswGQYDVQQDExJOb3RtdWNoIFRlc3QgU3VpdGUwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQC7vH1/lkENTAJRbyq2036K7Pw+imSIhB5T +U0WnAgVGWOemY1Eppi9Dk6rjDxuuUKOCQ5el2wmFZN57Fi/4leBH7x217BnnqWNU +QV88DxEfV+sk8dSb4a5FOOyfhFJmZso/0lK8x0fBcCNjmRFIjB1afSSXWnCvRpAR +v+O9trLJuIjbbmXg1gltjuB5yDw8/OLEI7G7YSIop9FxopWJL5rW/o2WEfRPGpYe +HNRLObCRIvbyDd6XjaCrKBuIrhN7R7mmIa9PUyl8TiY+pCMWs9dHmOsiC73/+P6E +AhsTOY1bfbGQXBAGZ/FL+SgC5wEcPr2u3+y8y5gw2bpaVhQnu6YLAgMBAAGjTTBL +MCUGA1UdEQQeMByBGnRlc3Rfc3VpdGVAbm90bXVjaG1haWwub3JnMBEGCisGAQQB +2kcCAgEEAwEB/zAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBb +XP5OnRVplrEdlnivx3CbCLWO13fcMWXfvKxLGsKFwKuxtpvINFUKM+jDr0kVdQ3d +u3DJe2hNFQMILK/KrGyN5qEz2YBdHNvdkkvWA+3WHr/tiNr6Rly6QuxBzouxzmRu +MmnUhsOzZaHT3GmLSVJlwie8KqSfKVGwyBmCyHbUQkMrSEV6QDESN6KyWt85gokB +56Bc/wVq073xS1nFbfF1M3Z5q5BlLZK4IOerKTQx/oSfR4EX6B7rW2pttWsUCyEj +LljaA8ehxR9B29m08IGGl43pHEpC1WnOHvsEGs99mPpjWbUgVv5KY7OuS/8iVw6v +/Yy5Z+JBwlMzTBaUXXl3 +-----END CERTIFICATE----- diff --git a/test/smtp-dummy.c b/test/smtp-dummy.c new file mode 100644 index 00000000..71992edd --- /dev/null +++ b/test/smtp-dummy.c @@ -0,0 +1,274 @@ +/* smtp-dummy - Dummy SMTP server that delivers mail to the given file + * + * Copyright © 2010 Carl Worth + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see https://www.gnu.org/licenses/ . + * + * Authors: Carl Worth <cworth@cworth.org> + */ + +/* This (non-compliant) SMTP server listens on localhost, port 25025 + * and delivers a mail received to the given filename, (specified as a + * command-line argument). It exists after the first client connection + * completes. + * + * It implements very little of the SMTP protocol, even less than + * specified as the minimum implementation in the SMTP RFC, (not + * implementing RSET, NOOP, nor VRFY). And it doesn't do any + * error-checking on the input. + * + * That is to say, if you use this program, you will very likely find + * cases where it doesn't do everything your SMTP client expects. You + * have been warned. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <netdb.h> +#include <unistd.h> + +#define STRNCMP_LITERAL(var, literal) \ + strncmp ((var), (literal), sizeof (literal) - 1) + +static void +receive_data_to_file (FILE *peer, FILE *output) +{ + char *line = NULL; + size_t line_size; + ssize_t line_len; + + while ((line_len = getline (&line, &line_size, peer)) != -1) { + if (STRNCMP_LITERAL (line, ".\r\n") == 0) + break; + if (line_len < 2) + continue; + if (line[line_len - 1] == '\n' && line[line_len - 2] == '\r') { + line[line_len - 2] = '\n'; + line[line_len - 1] = '\0'; + } + fprintf (output, "%s", + line[0] == '.' ? line + 1 : line); + } + + free (line); +} + +static int +process_command (FILE *peer, FILE *output, const char *command) +{ + if (STRNCMP_LITERAL (command, "EHLO ") == 0) { + fprintf (peer, "502 not implemented\r\n"); + fflush (peer); + } else if (STRNCMP_LITERAL (command, "HELO ") == 0) { + fprintf (peer, "250 localhost\r\n"); + fflush (peer); + } else if (STRNCMP_LITERAL (command, "MAIL FROM:") == 0 || + STRNCMP_LITERAL (command, "RCPT TO:") == 0) { + fprintf (peer, "250 OK\r\n"); + fflush (peer); + } else if (STRNCMP_LITERAL (command, "DATA") == 0) { + fprintf (peer, "354 End data with <CR><LF>.<CR><LF>\r\n"); + fflush (peer); + receive_data_to_file (peer, output); + fprintf (peer, "250 OK\r\n"); + fflush (peer); + } else if (STRNCMP_LITERAL (command, "QUIT") == 0) { + fprintf (peer, "221 BYE\r\n"); + fflush (peer); + return 1; + } else { + fprintf (stderr, "Unknown command: %s\n", command); + } + return 0; +} + +static void +do_smtp_to_file (FILE *peer, FILE *output) +{ + char *line = NULL; + size_t line_size; + ssize_t line_len; + + fprintf (peer, "220 localhost smtp-dummy\r\n"); + fflush (peer); + + while ((line_len = getline (&line, &line_size, peer)) != -1) { + if (process_command (peer, output, line)) + break; + } + + free (line); +} + +int +main (int argc, char *argv[]) +{ + const char *progname; + char *output_filename; + FILE *peer_file = NULL, *output = NULL; + int sock = -1, peer, err; + struct sockaddr_in addr, peer_addr; + struct hostent *hostinfo; + socklen_t peer_addr_len; + int reuse; + int background; + int ret = 0; + + progname = argv[0]; + + background = 0; + for (; argc >= 2; argc--, argv++) { + if (argv[1][0] != '-') + break; + if (strcmp (argv[1], "--") == 0) { + argc--; + argv++; + break; + } + if (strcmp (argv[1], "--background") == 0) { + background = 1; + continue; + } + fprintf (stderr, "%s: unregognized option '%s'\n", + progname, argv[1]); + return 1; + } + + if (argc != 2) { + fprintf (stderr, + "Usage: %s [--background] <output-file>\n", progname); + return 1; + } + + output_filename = argv[1]; + output = fopen (output_filename, "w"); + if (output == NULL) { + fprintf (stderr, "Failed to open %s for writing: %s\n", + output_filename, strerror (errno)); + ret = 1; + goto DONE; + } + + sock = socket (AF_INET, SOCK_STREAM, 0); + if (sock == -1) { + fprintf (stderr, "Error: socket() failed: %s\n", + strerror (errno)); + ret = 1; + goto DONE; + } + + reuse = 1; + err = setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof (reuse)); + if (err) { + fprintf (stderr, "Error: setsockopt() failed: %s\n", + strerror (errno)); + ret = 1; + goto DONE; + } + + hostinfo = gethostbyname ("localhost"); + if (hostinfo == NULL) { + fprintf (stderr, "Unknown host: localhost\n"); + ret = 1; + goto DONE; + } + + memset (&addr, 0, sizeof (addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons (25025); + addr.sin_addr = *(struct in_addr *) hostinfo->h_addr; + err = bind (sock, (struct sockaddr *) &addr, sizeof (addr)); + if (err) { + fprintf (stderr, "Error: bind() failed: %s\n", + strerror (errno)); + close (sock); + ret = 1; + goto DONE; + } + + err = listen (sock, 1); + if (err) { + fprintf (stderr, "Error: listen() failed: %s\n", + strerror (errno)); + close (sock); + ret = 1; + goto DONE; + } + + if (background) { + int pid = fork (); + if (pid > 0) { + printf ("smtp_dummy_pid='%d'\n", pid); + fflush (stdout); + close (sock); + ret = 0; + goto DONE; + } + if (pid < 0) { + fprintf (stderr, "Error: fork() failed: %s\n", + strerror (errno)); + close (sock); + ret = 1; + goto DONE; + } + /* Reached if pid == 0 (the child process). */ + /* Close stdout so that the one interested in pid value will + * also get EOF. */ + close (STDOUT_FILENO); + /* dup2() will re-reserve fd of stdout (1) (opportunistically), + * in case fd of stderr (2) is open. If that was not open we + * don't care fd of stdout (1) either. */ + dup2 (STDERR_FILENO, STDOUT_FILENO); + + /* This process is now out of reach of shell's job control. + * To resolve the rare but possible condition where this + * "daemon" is started but never connected this process will + * (only) have 30 seconds to exist. */ + alarm (30); + } + + peer_addr_len = sizeof (peer_addr); + peer = accept (sock, (struct sockaddr *) &peer_addr, &peer_addr_len); + if (peer == -1) { + fprintf (stderr, "Error: accept() failed: %s\n", + strerror (errno)); + ret = 1; + goto DONE; + } + + peer_file = fdopen (peer, "w+"); + if (peer_file == NULL) { + fprintf (stderr, "Error: fdopen() failed: %s\n", + strerror (errno)); + ret = 1; + goto DONE; + } + + do_smtp_to_file (peer_file, output); + + DONE: + if (output) + fclose (output); + if (peer_file) + fclose (peer_file); + if (sock >= 0) + close (sock); + + return ret; +} diff --git a/test/symbol-test.cc b/test/symbol-test.cc new file mode 100644 index 00000000..7454838b --- /dev/null +++ b/test/symbol-test.cc @@ -0,0 +1,30 @@ +#include <stdio.h> +#include <stdlib.h> +#include <xapian.h> +#include <notmuch.h> + +int main (int argc, char** argv) +{ + notmuch_database_t *notmuch; + char *message = NULL; + + if (argc != 3) + return 1; + + if (notmuch_database_open_verbose (argv[1], NOTMUCH_DATABASE_MODE_READ_ONLY, + ¬much, &message)) { + if (message) { + fputs (message, stderr); + free (message); + } + } + + try { + (void) new Xapian::WritableDatabase (argv[2], Xapian::DB_OPEN); + } catch (const Xapian::Error &error) { + printf("caught %s\n", error.get_msg().c_str()); + return 0; + } + + return 1; +} diff --git a/test/test-databases/.gitignore b/test/test-databases/.gitignore new file mode 100644 index 00000000..9452199f --- /dev/null +++ b/test/test-databases/.gitignore @@ -0,0 +1 @@ +/*.tar.xz diff --git a/test/test-databases/Makefile b/test/test-databases/Makefile new file mode 100644 index 00000000..b250a8be --- /dev/null +++ b/test/test-databases/Makefile @@ -0,0 +1,7 @@ +# See Makefile.local for the list of files to be compiled in this +# directory. +all: + $(MAKE) -C ../.. all + +.DEFAULT: + $(MAKE) -C ../.. $@ diff --git a/test/test-databases/Makefile.local b/test/test-databases/Makefile.local new file mode 100644 index 00000000..7aedff70 --- /dev/null +++ b/test/test-databases/Makefile.local @@ -0,0 +1,20 @@ +# -*- makefile -*- + +TEST_DATABASE_MIRROR=https://notmuchmail.org/releases/test-databases + +dir := test/test-databases + +test_databases := $(dir)/database-v1.tar.xz + +%.tar.xz: + @exec 1>&2 ;\ + if command -v wget >/dev/null ;\ + then set -x; wget -nv -O $@ ${TEST_DATABASE_MIRROR}/$(notdir $@) ;\ + elif command -v curl >/dev/null ;\ + then set -x; curl -L -s -o $@ ${TEST_DATABASE_MIRROR}/$(notdir $@) ;\ + else echo Cannot fetch databases, no wget nor curl available; exit 1 ;\ + fi + +download-test-databases: ${test_databases} + +DATACLEAN := $(DATACLEAN) ${test_databases} diff --git a/test/test-databases/database-v1.tar.xz.sha256 b/test/test-databases/database-v1.tar.xz.sha256 new file mode 100644 index 00000000..2cc4f965 --- /dev/null +++ b/test/test-databases/database-v1.tar.xz.sha256 @@ -0,0 +1 @@ +4299e051b10e1fa7b33ea2862790a09ebfe96859681804e5251e130f800e69d2 database-v1.tar.xz diff --git a/test/test-lib-FREEBSD.sh b/test/test-lib-FREEBSD.sh new file mode 100644 index 00000000..d1840b56 --- /dev/null +++ b/test/test-lib-FREEBSD.sh @@ -0,0 +1,9 @@ +# If present, use GNU Coreutils instead of a native BSD utils +if command -v gdate >/dev/null + then + date () { gdate "$@"; } + base64 () { gbase64 "$@"; } + wc () { gwc "$@"; } + sed () { gsed "$@"; } + sha256sum () { gsha256sum "$@"; } + fi diff --git a/test/test-lib-common.sh b/test/test-lib-common.sh new file mode 100644 index 00000000..2f7950ac --- /dev/null +++ b/test/test-lib-common.sh @@ -0,0 +1,334 @@ +# +# Copyright (c) 2005 Junio C Hamano +# Copyright (c) 2010 Notmuch Developers +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see https://www.gnu.org/licenses/ . + +# This file contains common code to be used by both the regular +# (correctness) tests and the performance tests. + +# test-lib.sh defines die() which echoes to nonstandard fd where +# output was redirected earlier in that file. If test-lib.sh is not +# loaded, neither this redirection nor die() function were defined. +# +type die >/dev/null 2>&1 || die () { echo "$@" >&2; exit 1; } + +if [[ -z "$NOTMUCH_SRCDIR" ]] || [[ -z "$NOTMUCH_BUILDDIR" ]]; then + echo "internal: srcdir or builddir not set" >&2 + exit 1 +fi + +backup_database () { + test_name=$(basename $0 .sh) + rm -rf $TMP_DIRECTORY/notmuch-dir-backup."$test_name" + cp -pR ${MAIL_DIR}/.notmuch $TMP_DIRECTORY/notmuch-dir-backup."${test_name}" +} + +restore_database () { + test_name=$(basename $0 .sh) + rm -rf ${MAIL_DIR}/.notmuch + cp -pR $TMP_DIRECTORY/notmuch-dir-backup."${test_name}" ${MAIL_DIR}/.notmuch +} + +# Prepend $TEST_DIRECTORY/../lib to LD_LIBRARY_PATH, to make tests work +# on systems where ../notmuch depends on LD_LIBRARY_PATH. +LD_LIBRARY_PATH=${TEST_DIRECTORY%/*}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} +export LD_LIBRARY_PATH + +# configure output +. "$NOTMUCH_BUILDDIR/sh.config" || exit 1 + +# load OS specifics +if [[ -e "$NOTMUCH_SRCDIR/test/test-lib-$PLATFORM.sh" ]]; then + . "$NOTMUCH_SRCDIR/test/test-lib-$PLATFORM.sh" || exit 1 +fi + +# Generate a new message in the mail directory, with a unique message +# ID and subject. The message is not added to the index. +# +# After this function returns, the filename of the generated message +# is available as $gen_msg_filename and the message ID is available as +# $gen_msg_id . +# +# This function supports named parameters with the bash syntax for +# assigning a value to an associative array ([name]=value). The +# supported parameters are: +# +# [dir]=directory/of/choice +# +# Generate the message in directory 'directory/of/choice' within +# the mail store. The directory will be created if necessary. +# +# [filename]=name +# +# Store the message in file 'name'. The default is to store it +# in 'msg-<count>', where <count> is three-digit number of the +# message. +# +# [body]=text +# +# Text to use as the body of the email message +# +# '[from]="Some User <user@example.com>"' +# '[to]="Some User <user@example.com>"' +# '[subject]="Subject of email message"' +# '[date]="RFC 822 Date"' +# +# Values for email headers. If not provided, default values will +# be generated instead. +# +# '[cc]="Some User <user@example.com>"' +# [reply-to]=some-address +# [in-reply-to]=<message-id> +# [references]=<message-id> +# [content-type]=content-type-specification +# '[header]=full header line, including keyword' +# +# Additional values for email headers. If these are not provided +# then the relevant headers will simply not appear in the +# message. +# +# '[id]=message-id' +# +# Controls the message-id of the created message. +gen_msg_cnt=0 +gen_msg_filename="" +gen_msg_id="" +generate_message () +{ + # This is our (bash-specific) magic for doing named parameters + local -A template="($@)" + local additional_headers + + gen_msg_cnt=$((gen_msg_cnt + 1)) + if [ -z "${template[filename]}" ]; then + gen_msg_name="msg-$(printf "%03d" $gen_msg_cnt)" + else + gen_msg_name=${template[filename]} + fi + + if [ -z "${template[id]}" ]; then + gen_msg_id="${gen_msg_name%:2,*}@notmuch-test-suite" + else + gen_msg_id="${template[id]}" + fi + + if [ -z "${template[dir]}" ]; then + gen_msg_filename="${MAIL_DIR}/$gen_msg_name" + else + gen_msg_filename="${MAIL_DIR}/${template[dir]}/$gen_msg_name" + mkdir -p "$(dirname "$gen_msg_filename")" + fi + + if [ -z "${template[body]}" ]; then + template[body]="This is just a test message (#${gen_msg_cnt})" + fi + + if [ -z "${template[from]}" ]; then + template[from]="Notmuch Test Suite <test_suite@notmuchmail.org>" + fi + + if [ -z "${template[to]}" ]; then + template[to]="Notmuch Test Suite <test_suite@notmuchmail.org>" + fi + + if [ -z "${template[subject]}" ]; then + if [ -n "$test_subtest_name" ]; then + template[subject]="$test_subtest_name" + else + template[subject]="Test message #${gen_msg_cnt}" + fi + elif [ "${template[subject]}" = "@FORCE_EMPTY" ]; then + template[subject]="" + fi + + if [ -z "${template[date]}" ]; then + # we use decreasing timestamps here for historical reasons; + # the existing test suite when we converted to unique timestamps just + # happened to have signicantly fewer failures with that choice. + local date_secs=$((978709437 - gen_msg_cnt)) + # printf %(..)T is bash 4.2+ feature. use perl fallback if needed... + TZ=UTC printf -v template[date] "%(%a, %d %b %Y %T %z)T" $date_secs 2>/dev/null || + template[date]=`perl -le 'use POSIX "strftime"; + @time = gmtime '"$date_secs"'; + print strftime "%a, %d %b %Y %T +0000", @time'` + fi + + additional_headers="" + if [ ! -z "${template[header]}" ]; then + additional_headers="${template[header]} +${additional_headers}" + fi + + if [ ! -z "${template[reply-to]}" ]; then + additional_headers="Reply-To: ${template[reply-to]} +${additional_headers}" + fi + + if [ ! -z "${template[in-reply-to]}" ]; then + additional_headers="In-Reply-To: ${template[in-reply-to]} +${additional_headers}" + fi + + if [ ! -z "${template[cc]}" ]; then + additional_headers="Cc: ${template[cc]} +${additional_headers}" + fi + + if [ ! -z "${template[bcc]}" ]; then + additional_headers="Bcc: ${template[bcc]} +${additional_headers}" + fi + + if [ ! -z "${template[references]}" ]; then + additional_headers="References: ${template[references]} +${additional_headers}" + fi + + if [ ! -z "${template[content-type]}" ]; then + additional_headers="Content-Type: ${template[content-type]} +${additional_headers}" + fi + + if [ ! -z "${template[content-transfer-encoding]}" ]; then + additional_headers="Content-Transfer-Encoding: ${template[content-transfer-encoding]} +${additional_headers}" + fi + + # Note that in the way we're setting it above and using it below, + # `additional_headers' will also serve as the header / body separator + # (empty line in between). + + cat <<EOF >"$gen_msg_filename" +From: ${template[from]} +To: ${template[to]} +Message-Id: <${gen_msg_id}> +Subject: ${template[subject]} +Date: ${template[date]} +${additional_headers} +${template[body]} +EOF +} + +# Generate a new message and add it to the database. +# +# All of the arguments and return values supported by generate_message +# are also supported here, so see that function for details. +add_message () +{ + generate_message "$@" && + notmuch new > /dev/null +} + +if test -n "$valgrind" +then + make_symlink () { + test -h "$2" && + test "$1" = "$(readlink "$2")" || { + # be super paranoid + if mkdir "$2".lock + then + rm -f "$2" && + ln -s "$1" "$2" && + rm -r "$2".lock + else + while test -d "$2".lock + do + say "Waiting for lock on $2." + sleep 1 + done + fi + } + } + + make_valgrind_symlink () { + # handle only executables + test -x "$1" || return + + base=$(basename "$1") + symlink_target=$TEST_DIRECTORY/../$base + # do not override scripts + if test -x "$symlink_target" && + test ! -d "$symlink_target" && + test "#!" != "$(head -c 2 < "$symlink_target")" + then + symlink_target=$TEST_DIRECTORY/valgrind.sh + fi + case "$base" in + *.sh|*.perl) + symlink_target=$TEST_DIRECTORY/unprocessed-script + esac + # create the link, or replace it if it is out of date + make_symlink "$symlink_target" "$GIT_VALGRIND/bin/$base" || exit + } + + # override notmuch executable in TEST_DIRECTORY/.. + GIT_VALGRIND=$TEST_DIRECTORY/valgrind + mkdir -p "$GIT_VALGRIND"/bin + make_valgrind_symlink $TEST_DIRECTORY/../notmuch + OLDIFS=$IFS + IFS=: + for path in $PATH + do + ls "$path"/notmuch 2> /dev/null | + while read file + do + make_valgrind_symlink "$file" + done + done + IFS=$OLDIFS + PATH=$GIT_VALGRIND/bin:$PATH + GIT_EXEC_PATH=$GIT_VALGRIND/bin + export GIT_VALGRIND + test -n "$NOTMUCH_BUILDDIR" && MANPATH="$NOTMUCH_BUILDDIR/doc/_build/man" +else # normal case + if test -n "$NOTMUCH_BUILDDIR" + then + PATH="$NOTMUCH_BUILDDIR:$PATH" + MANPATH="$NOTMUCH_BUILDDIR/doc/_build/man" + fi +fi +export PATH MANPATH + +# Test repository +test="tmp.$(basename "$0" .sh)" +TMP_DIRECTORY="$TEST_DIRECTORY/$test" +test ! -z "$debug" || remove_tmp=$TMP_DIRECTORY +rm -rf "$TMP_DIRECTORY" || { + GIT_EXIT_OK=t + echo >&6 "FATAL: Cannot prepare test area" + exit 1 +} + +# A temporary home directory is needed by at least: +# - emacs/"Sending a message via (fake) SMTP" +# - emacs/"Reply within emacs" +# - crypto/emacs_deliver_message +export HOME="${TMP_DIRECTORY}/home" +mkdir -p "${HOME}" + +MAIL_DIR="${TMP_DIRECTORY}/mail" +export NOTMUCH_CONFIG="${TMP_DIRECTORY}/notmuch-config" + +mkdir -p "${MAIL_DIR}" + +cat <<EOF >"${NOTMUCH_CONFIG}" +[database] +path=${MAIL_DIR} + +[user] +name=Notmuch Test Suite +primary_email=test_suite@notmuchmail.org +other_email=test_suite_other@notmuchmail.org;test_suite@otherdomain.org +EOF diff --git a/test/test-lib.el b/test/test-lib.el new file mode 100644 index 00000000..9946010b --- /dev/null +++ b/test/test-lib.el @@ -0,0 +1,205 @@ +;; test-lib.el --- auxiliary stuff for Notmuch Emacs tests. +;; +;; Copyright © Carl Worth +;; Copyright © David Edmondson +;; +;; This file is part of Notmuch test suit. +;; +;; Notmuch is free software: you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. +;; +;; Notmuch is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>. +;; +;; Authors: Dmitry Kurochkin <dmitry.kurochkin@gmail.com> + +(require 'cl) ;; This code is generally used uncompiled. + +;; `read-file-name' by default uses `completing-read' function to read +;; user input. It does not respect `standard-input' variable which we +;; use in tests to provide user input. So replace it with a plain +;; `read' call. +(setq read-file-name-function (lambda (&rest _) (read))) + +;; Work around a bug in emacs 23.1 and emacs 23.2 which prevents +;; noninteractive (kill-emacs) from emacsclient. +(if (and (= emacs-major-version 23) (< emacs-minor-version 3)) + (defadvice kill-emacs (before disable-yes-or-no-p activate) + "Disable yes-or-no-p before executing kill-emacs" + (defun yes-or-no-p (prompt) t))) + +;; Emacs bug #2930: +;; 23.0.92; `accept-process-output' and `sleep-for' do not run sentinels +;; seems to be present in Emacs 23.1. +;; Running `list-processes' after `accept-process-output' seems to work +;; around this problem. +(if (and (= emacs-major-version 23) (= emacs-minor-version 1)) + (defadvice accept-process-output (after run-list-processes activate) + "run list-processes after executing accept-process-output" + (list-processes))) + +(defun notmuch-test-wait () + "Wait for process completion." + (while (get-buffer-process (current-buffer)) + (accept-process-output nil 0.1))) + +(defun test-output (&optional filename) + "Save current buffer to file FILENAME. Default FILENAME is OUTPUT." + (notmuch-post-command) + (write-region (point-min) (point-max) (or filename "OUTPUT"))) + +(defun test-visible-output (&optional filename) + "Save visible text in current buffer to file FILENAME. Default +FILENAME is OUTPUT." + (notmuch-post-command) + (let ((text (visible-buffer-string)) + ;; Tests expect output in UTF-8 encoding + (coding-system-for-write 'utf-8)) + (with-temp-file (or filename "OUTPUT") (insert text)))) + +(defun visible-buffer-string () + "Same as `buffer-string', but excludes invisible text and +removes any text properties." + (visible-buffer-substring (point-min) (point-max))) + +(defun visible-buffer-substring (start end) + "Same as `buffer-substring-no-properties', but excludes +invisible text." + (let (str) + (while (< start end) + (let ((next-pos (next-char-property-change start end))) + (when (not (invisible-p start)) + (setq str (concat str (buffer-substring-no-properties + start next-pos)))) + (setq start next-pos))) + str)) + +;; process-attributes is not defined everywhere, so define an +;; alternate way to test if a process still exists. + +(defun test-process-running (pid) + (= 0 + (signal-process pid 0))) + +(defun orphan-watchdog-check (pid) + "Periodically check that the process with id PID is still +running, quit if it terminated." + (if (not (test-process-running pid)) + (kill-emacs))) + +(defun orphan-watchdog (pid) + "Initiate orphan watchdog check." + (run-at-time 60 60 'orphan-watchdog-check pid)) + +(defun hook-counter (hook) + "Count how many times a hook is called. Increments +`hook'-counter variable value if it is bound, otherwise does +nothing." + (let ((counter (intern (concat (symbol-name hook) "-counter")))) + (if (boundp counter) + (set counter (1+ (symbol-value counter)))))) + +(defun add-hook-counter (hook) + "Add hook to count how many times `hook' is called." + (add-hook hook (apply-partially 'hook-counter hook))) + +(add-hook-counter 'notmuch-hello-mode-hook) +(add-hook-counter 'notmuch-hello-refresh-hook) + +(defadvice notmuch-search-process-filter (around pessimal activate disable) + "Feed notmuch-search-process-filter one character at a time." + (let ((string (ad-get-arg 1))) + (loop for char across string + do (progn + (ad-set-arg 1 (char-to-string char)) + ad-do-it)))) + +(defun notmuch-test-mark-links () + "Enclose links in the current buffer with << and >>." + ;; Links are often created by jit-lock functions + (jit-lock-fontify-now) + (save-excursion + (let ((inhibit-read-only t)) + (goto-char (point-min)) + (let ((button)) + (while (setq button (next-button (point))) + (goto-char (button-start button)) + (insert "<<") + (goto-char (button-end button)) + (insert ">>")))))) + +(defmacro notmuch-test-run (&rest body) + "Evaluate a BODY of test expressions and output the result." + `(with-temp-buffer + (let ((buffer (current-buffer)) + (result (progn ,@body))) + (switch-to-buffer buffer) + (insert (if (stringp result) + result + (prin1-to-string result))) + (test-output)))) + +(defun notmuch-test-report-unexpected (output expected) + "Report that the OUTPUT does not match the EXPECTED result." + (concat "Expect:\t" (prin1-to-string expected) "\n" + "Output:\t" (prin1-to-string output) "\n")) + +(defun notmuch-test-expect-equal (output expected) + "Compare OUTPUT with EXPECTED. Report any discrepencies." + (if (equal output expected) + t + (cond + ((and (listp output) + (listp expected)) + ;; Reporting the difference between two lists is done by + ;; reporting differing elements of OUTPUT and EXPECTED + ;; pairwise. This is expected to make analysis of failures + ;; simpler. + (apply #'concat (loop for o in output + for e in expected + if (not (equal o e)) + collect (notmuch-test-report-unexpected o e)))) + + (t + (notmuch-test-report-unexpected output expected))))) + +(defun notmuch-post-command () + (run-hooks 'post-command-hook)) + +(defmacro notmuch-test-progn (&rest body) + (cons 'progn + (mapcar + (lambda (x) `(prog1 ,x (notmuch-post-command))) + body))) + +;; For historical reasons, we hide deleted tags by default in the test +;; suite +(setq notmuch-tag-deleted-formats + '((".*" nil))) + +;; Also for historical reasons, we set the fcc handler to file not +;; insert. + +(setq notmuch-maildir-use-notmuch-insert nil) + +;; force a common html renderer, to avoid test variations between +;; environments + +(setq mm-text-html-renderer 'html2text) + +;; Set some variables for S/MIME tests. + +(setq smime-keys '(("" "test_suite.pem" nil))) + +(setq mml-smime-use 'openssl) + +;; all test keys are without passphrase +(eval-after-load 'smime + '(defun smime-ask-passphrase (cache) nil)) diff --git a/test/test-lib.sh b/test/test-lib.sh new file mode 100644 index 00000000..fca5277d --- /dev/null +++ b/test/test-lib.sh @@ -0,0 +1,1202 @@ +# +# Copyright (c) 2005 Junio C Hamano +# Copyright (c) 2010 Notmuch Developers +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see https://www.gnu.org/licenses/ . + +if [ ${BASH_VERSINFO[0]} -lt 4 ]; then + echo "Error: The notmuch test suite requires a bash version >= 4.0" + echo "due to use of associative arrays within the test suite." + echo "Please try again with a newer bash (or help us fix the" + echo "test suite to be more portable). Thanks." + exit 1 +fi + +# Make sure echo builtin does not expand backslash-escape sequences by default. +shopt -u xpg_echo + +# Ensure NOTMUCH_SRCDIR and NOTMUCH_BUILDDIR are set. +. $(dirname "$0")/export-dirs.sh || exit 1 + +# It appears that people try to run tests without building... +if [[ ! -x "$NOTMUCH_BUILDDIR/notmuch" ]]; then + echo >&2 'You do not seem to have built notmuch yet.' + exit 1 +fi + +this_test=${0##*/} +this_test=${this_test%.sh} +this_test_bare=${this_test#T[0-9][0-9][0-9]-} + +# if --tee was passed, write the output not only to the terminal, but +# additionally to the file test-results/$BASENAME.out, too. +case "$GIT_TEST_TEE_STARTED, $* " in +done,*) + # do not redirect again + ;; +*' --tee '*|*' --va'*) + mkdir -p test-results + BASE=test-results/$this_test + (GIT_TEST_TEE_STARTED=done "$BASH" "$0" "$@" 2>&1; + echo $? > $BASE.exit) | tee $BASE.out + test "$(cat $BASE.exit)" = 0 + exit + ;; +esac + +# Save STDOUT to fd 6 and STDERR to fd 7. +exec 6>&1 7>&2 +# Make xtrace debugging (when used) use redirected STDERR, with verbose lead: +BASH_XTRACEFD=7 +export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' + +# Keep the original TERM for say_color and test_emacs +ORIGINAL_TERM=$TERM + +# Set SMART_TERM to vt100 for known dumb/unknown terminal. +# Otherwise use whatever TERM is currently used so that +# users' actual TERM environments are being used in tests. +case ${TERM-} in + '' | dumb | unknown ) + SMART_TERM=vt100 ;; + *) + SMART_TERM=$TERM ;; +esac + +# For repeatability, reset the environment to known value. +LANG=C +LC_ALL=C +PAGER=cat +TZ=UTC +TERM=dumb +export LANG LC_ALL PAGER TERM TZ +GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u} +if [[ ( -n "$TEST_EMACS" && -z "$TEST_EMACSCLIENT" ) || \ + ( -z "$TEST_EMACS" && -n "$TEST_EMACSCLIENT" ) ]]; then + echo "error: must specify both or neither of TEST_EMACS and TEST_EMACSCLIENT" >&2 + exit 1 +fi +TEST_EMACS=${TEST_EMACS:-${EMACS:-emacs}} +TEST_EMACSCLIENT=${TEST_EMACSCLIENT:-emacsclient} +TEST_GDB=${TEST_GDB:-gdb} +TEST_CC=${TEST_CC:-cc} +TEST_CFLAGS=${TEST_CFLAGS:-"-g -O0"} + +# Protect ourselves from common misconfiguration to export +# CDPATH into the environment +unset CDPATH + +unset GREP_OPTIONS + +# For emacsclient +unset ALTERNATE_EDITOR + +add_gnupg_home () +{ + local output + [ -d ${GNUPGHOME} ] && return + _gnupg_exit () { gpgconf --kill all 2>/dev/null || true; } + at_exit_function _gnupg_exit + mkdir -m 0700 "$GNUPGHOME" + gpg --no-tty --import <$NOTMUCH_SRCDIR/test/gnupg-secret-key.asc >"$GNUPGHOME"/import.log 2>&1 + test_debug "cat $GNUPGHOME/import.log" + if (gpg --quick-random --version >/dev/null 2>&1) ; then + echo quick-random >> "$GNUPGHOME"/gpg.conf + elif (gpg --debug-quick-random --version >/dev/null 2>&1) ; then + echo debug-quick-random >> "$GNUPGHOME"/gpg.conf + fi + echo no-emit-version >> "$GNUPGHOME"/gpg.conf +} + +# Each test should start with something like this, after copyright notices: +# +# test_description='Description of this test... +# This test checks if command xyzzy does the right thing... +# ' +# . ./test-lib.sh || exit 1 + +[ "x$ORIGINAL_TERM" != "xdumb" ] && ( + TERM=$ORIGINAL_TERM && + export TERM && + [ -t 1 ] && + tput bold >/dev/null 2>&1 && + tput setaf 1 >/dev/null 2>&1 && + tput sgr0 >/dev/null 2>&1 + ) && + color=t + +while test "$#" -ne 0 +do + case "$1" in + -d|--debug) + debug=t; shift ;; + -i|--immediate) + immediate=t; shift ;; + -h|--help) + help=t; shift ;; + -v|--verbose) + verbose=t; shift ;; + -q|--quiet) + quiet=t; shift ;; + --with-dashes) + with_dashes=t; shift ;; + --no-color) + color=; shift ;; + --no-python) + # noop now... + shift ;; + --valgrind) + valgrind=t; verbose=t; shift ;; + --tee) + shift ;; # was handled already + *) + echo "error: unknown test option '$1'" >&2; exit 1 ;; + esac +done + +if test -n "$debug"; then + print_subtest () { + printf " %-4s" "[$((test_count - 1))]" + } +else + print_subtest () { + true + } +fi + +if test -n "$color"; then + say_color () { + ( + TERM=$ORIGINAL_TERM + export TERM + case "$1" in + error) tput bold; tput setaf 1;; # bold red + skip) tput bold; tput setaf 2;; # bold green + pass) tput setaf 2;; # green + info) tput setaf 3;; # brown + *) test -n "$quiet" && return;; + esac + shift + printf " " + printf "$@" + tput sgr0 + print_subtest + ) + } +else + say_color() { + test -z "$1" && test -n "$quiet" && return + shift + printf " " + printf "$@" + print_subtest + } +fi + +error () { + say_color error "error: $*\n" + GIT_EXIT_OK=t + exit 1 +} + +say () { + say_color info "$*" +} + +test "${test_description}" != "" || +error "Test script did not set test_description." + +if test "$help" = "t" +then + echo "Tests ${test_description}" + exit 0 +fi + +test_description_printed= +print_test_description () +{ + test -z "$test_description_printed" || return 0 + echo + echo $this_test: "Testing ${test_description}" + test_description_printed=1 +} +if [ -z "$NOTMUCH_TEST_QUIET" ] +then + print_test_description +fi + +test_failure=0 +test_count=0 +test_fixed=0 +test_broken=0 +test_success=0 + +declare -a _exit_functions=() + +at_exit_function () { + _exit_functions=($1 ${_exit_functions[@]/$1}) +} + +rm_exit_function () { + _exit_functions=(${_exit_functions[@]/$1}) +} + +_exit_common () { + code=$? + trap - EXIT + set +ex + for _fn in ${_exit_functions[@]}; do $_fn; done + rm -rf "$TEST_TMPDIR" +} + +trap_exit () { + _exit_common + if test -n "$GIT_EXIT_OK" + then + exit $code + else + exec >&6 + say_color error '%-6s' FATAL + echo " $test_subtest_name" + echo + echo "Unexpected exit while executing $0. Exit code $code." + exit 1 + fi +} + +trap_signal () { + _exit_common + echo >&6 "FATAL: $0: interrupted by signal" $((code - 128)) + exit $code +} + +die () { + _exit_common + exec >&6 + say_color error '%-6s' FATAL + echo " $*" + echo + echo "Unexpected exit while executing $0." + exit 1 +} + +GIT_EXIT_OK= +# Note: TEST_TMPDIR *NOT* exported! +TEST_TMPDIR=$(mktemp -d "${TMPDIR:-/tmp}/notmuch-test-$$.XXXXXX") +# Put GNUPGHOME in TMPDIR to avoid problems with long paths. +export GNUPGHOME="${TEST_TMPDIR}/gnupg" +trap 'trap_exit' EXIT +trap 'trap_signal' HUP INT TERM + +# Deliver a message with emacs and add it to the database +# +# Uses emacs to generate and deliver a message to the mail store. +# Accepts arbitrary extra emacs/elisp functions to modify the message +# before sending, which is useful to doing things like attaching files +# to the message and encrypting/signing. +emacs_deliver_message () +{ + local subject="$1" + local body="$2" + shift 2 + # before we can send a message, we have to prepare the FCC maildir + mkdir -p "$MAIL_DIR"/sent/{cur,new,tmp} + # eval'ing smtp-dummy --background will set smtp_dummy_pid + smtp_dummy_pid= + eval `$TEST_DIRECTORY/smtp-dummy --background sent_message` + test -n "$smtp_dummy_pid" || return 1 + + test_emacs \ + "(let ((message-send-mail-function 'message-smtpmail-send-it) + (mail-host-address \"example.com\") + (smtpmail-smtp-server \"localhost\") + (smtpmail-smtp-service \"25025\")) + (notmuch-mua-mail) + (message-goto-to) + (insert \"test_suite@notmuchmail.org\nDate: 01 Jan 2000 12:00:00 -0000\") + (message-goto-subject) + (insert \"${subject}\") + (message-goto-body) + (insert \"${body}\") + $@ + (notmuch-mua-send-and-exit))" + + # In case message was sent properly, client waits for confirmation + # before exiting and resuming control here; therefore making sure + # that server exits by sending (KILL) signal to it is safe. + kill -9 $smtp_dummy_pid + notmuch new >/dev/null +} + +# Pretend to deliver a message with emacs. Really save it to a file +# and add it to the database +# +# Uses emacs to generate and deliver a message to the mail store. +# Accepts arbitrary extra emacs/elisp functions to modify the message +# before sending, which is useful to doing things like attaching files +# to the message and encrypting/signing. +# +# If any GNU-style long-arguments (like --quiet or --decrypt=true) are +# at the head of the argument list, they are sent directly to "notmuch +# new" after message delivery +emacs_fcc_message () +{ + local nmn_args='' + while [[ "$1" =~ ^-- ]]; do + nmn_args="$nmn_args $1" + shift + done + local subject="$1" + local body="$2" + shift 2 + # before we can send a message, we have to prepare the FCC maildir + mkdir -p "$MAIL_DIR"/sent/{cur,new,tmp} + + test_emacs \ + "(let ((message-send-mail-function (lambda () t)) + (mail-host-address \"example.com\")) + (notmuch-mua-mail) + (message-goto-to) + (insert \"test_suite@notmuchmail.org\nDate: 01 Jan 2000 12:00:00 -0000\") + (message-goto-subject) + (insert \"${subject}\") + (message-goto-body) + (insert \"${body}\") + $@ + (notmuch-mua-send-and-exit))" || return 1 + notmuch new $nmn_args >/dev/null +} + +# Add an existing, fixed corpus of email to the database. +# +# $1 is the corpus dir under corpora to add, using "default" if unset. +# +# The default corpus is based on about 50 messages from early in the +# history of the notmuch mailing list, which allows for reliably +# testing commands that need to operate on a not-totally-trivial +# number of messages. +add_email_corpus () +{ + corpus=${1:-default} + + rm -rf ${MAIL_DIR} + if [ -d $TEST_DIRECTORY/corpora.mail/$corpus ]; then + cp -a $TEST_DIRECTORY/corpora.mail/$corpus ${MAIL_DIR} + else + cp -a $NOTMUCH_SRCDIR/test/corpora/$corpus ${MAIL_DIR} + notmuch new >/dev/null || die "'notmuch new' failed while adding email corpus" + mkdir -p $TEST_DIRECTORY/corpora.mail + cp -a ${MAIL_DIR} $TEST_DIRECTORY/corpora.mail/$corpus + fi +} + +test_begin_subtest () +{ + if [ -n "$inside_subtest" ]; then + exec 1>&6 2>&7 # Restore stdout and stderr + error "bug in test script: Missing test_expect_equal in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}" + fi + test_subtest_name="$1" + test_reset_state_ + # Redirect test output to the previously prepared file descriptors + # 3 and 4 (see below) + if test "$verbose" != "t"; then exec 4>test.output 3>&4; fi + exec >&3 2>&4 + inside_subtest=t +} + +# Pass test if two arguments match +# +# Note: Unlike all other test_expect_* functions, this function does +# not accept a test name. Instead, the caller should call +# test_begin_subtest before calling this function in order to set the +# name. +test_expect_equal () +{ + exec 1>&6 2>&7 # Restore stdout and stderr + if [ -z "$inside_subtest" ]; then + error "bug in the test script: test_expect_equal without test_begin_subtest" + fi + inside_subtest= + test "$#" = 2 || + error "bug in the test script: not 2 parameters to test_expect_equal" + + output="$1" + expected="$2" + if ! test_skip "$test_subtest_name" + then + if [ "$output" = "$expected" ]; then + test_ok_ + else + testname=$this_test.$test_count + echo "$expected" > $testname.expected + echo "$output" > $testname.output + test_failure_ "$(diff -u $testname.expected $testname.output)" + fi + fi +} + +# Like test_expect_equal, but takes two filenames. +test_expect_equal_file () +{ + exec 1>&6 2>&7 # Restore stdout and stderr + if [ -z "$inside_subtest" ]; then + error "bug in the test script: test_expect_equal_file without test_begin_subtest" + fi + inside_subtest= + test "$#" = 2 || + error "bug in the test script: not 2 parameters to test_expect_equal_file" + + file1="$1" + file2="$2" + if ! test_skip "$test_subtest_name" + then + if diff -q "$file1" "$file2" >/dev/null ; then + test_ok_ + else + testname=$this_test.$test_count + basename1=`basename "$file1"` + basename2=`basename "$file2"` + cp "$file1" "$testname.$basename1" + cp "$file2" "$testname.$basename2" + test_failure_ "$(diff -u "$testname.$basename1" "$testname.$basename2")" + fi + fi +} + +# Like test_expect_equal, but arguments are JSON expressions to be +# canonicalized before diff'ing. If an argument cannot be parsed, it +# is used unchanged so that there's something to diff against. +test_expect_equal_json () { + # The test suite forces LC_ALL=C, but this causes Python 3 to + # decode stdin as ASCII. We need to read JSON in UTF-8, so + # override Python's stdio encoding defaults. + local script='import json, sys; json.dump(json.load(sys.stdin), sys.stdout, sort_keys=True, indent=4)' + output=$(echo "$1" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c "$script" \ + || echo "$1") + expected=$(echo "$2" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c "$script" \ + || echo "$2") + shift 2 + test_expect_equal "$output" "$expected" "$@" +} + +# Sort the top-level list of JSON data from stdin. +test_sort_json () { + PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c \ + "import sys, json; json.dump(sorted(json.load(sys.stdin)),sys.stdout)" +} + +test_emacs_expect_t () { + test "$#" = 1 || + error "bug in the test script: not 1 parameter to test_emacs_expect_t" + if [ -z "$inside_subtest" ]; then + error "bug in the test script: test_emacs_expect_t without test_begin_subtest" + fi + + # Run the test. + if ! test_skip "$test_subtest_name" + then + test_emacs "(notmuch-test-run $1)" >/dev/null + + # Restore state after the test. + exec 1>&6 2>&7 # Restore stdout and stderr + inside_subtest= + + # Report success/failure. + result=$(cat OUTPUT) + if [ "$result" = t ] + then + test_ok_ + else + test_failure_ "${result}" + fi + else + # Restore state after the (non) test. + exec 1>&6 2>&7 # Restore stdout and stderr + inside_subtest= + fi +} + +NOTMUCH_NEW () +{ + notmuch new "${@}" | grep -v -E -e '^Processed [0-9]*( total)? file|Found [0-9]* total file' +} + +NOTMUCH_DUMP_TAGS () +{ + # this relies on the default format being batch-tag, otherwise some tests will break + notmuch dump --include=tags "${@}" | sed '/^#/d' | sort +} + +notmuch_drop_mail_headers () +{ + $NOTMUCH_PYTHON -c ' +import email, sys +msg = email.message_from_file(sys.stdin) +for hdr in sys.argv[1:]: del msg[hdr] +print(msg.as_string(False)) +' "$@" +} + +notmuch_search_sanitize () +{ + perl -pe 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/' +} + +notmuch_search_files_sanitize () +{ + notmuch_dir_sanitize +} + +notmuch_dir_sanitize () +{ + sed -e "s,$MAIL_DIR,MAIL_DIR," -e "s,${PWD},CWD,g" "$@" +} + +NOTMUCH_SHOW_FILENAME_SQUELCH='s,filename:.*/mail,filename:/XXX/mail,' +notmuch_show_sanitize () +{ + sed -e "$NOTMUCH_SHOW_FILENAME_SQUELCH" +} +notmuch_show_sanitize_all () +{ + sed \ + -e 's| filename:.*| filename:XXXXX|' \ + -e 's| id:[^ ]* | id:XXXXX |' | \ + notmuch_date_sanitize +} + +notmuch_json_show_sanitize () +{ + sed \ + -e 's|"id": "[^"]*",|"id": "XXXXX",|g' \ + -e 's|"Date": "Fri, 05 Jan 2001 [^"]*0000"|"Date": "GENERATED_DATE"|g' \ + -e 's|"filename": "signature.asc",||g' \ + -e 's|"filename": \["/[^"]*"\],|"filename": \["YYYYY"\],|g' \ + -e 's|"timestamp": 97.......|"timestamp": 42|g' \ + -e 's|"content-length": [1-9][0-9]*|"content-length": "NONZERO"|g' +} + +notmuch_emacs_error_sanitize () +{ + local command=$1 + shift + for file in "$@"; do + echo "=== $file ===" + cat "$file" + done | sed \ + -e 's/^\[.*\]$/[XXX]/' \ + -e "s|^\(command: \)\{0,1\}/.*/$command|\1YYY/$command|" +} + +notmuch_date_sanitize () +{ + sed \ + -e 's/^Date: Fri, 05 Jan 2001 .*0000/Date: GENERATED_DATE/' +} + +notmuch_uuid_sanitize () +{ + sed 's/[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/UUID/g' +} + +notmuch_built_with_sanitize () +{ + sed 's/^built_with[.]\(.*\)=.*$/built_with.\1=something/' +} + +notmuch_config_sanitize () +{ + notmuch_dir_sanitize | notmuch_built_with_sanitize +} + +notmuch_show_part () +{ + awk '/^\014part}/{ f=0 }; { if (f) { print $0 } } /^\014part{ ID: '"$1"'/{ f=1 }' +} + +# End of notmuch helper functions + +# Use test_set_prereq to tell that a particular prerequisite is available. +# +# The prerequisite can later be checked for by using test_have_prereq. +# +# The single parameter is the prerequisite tag (a simple word, in all +# capital letters by convention). + +test_set_prereq () { + satisfied="$satisfied$1 " +} +satisfied=" " + +test_have_prereq () { + case $satisfied in + *" $1 "*) + : yes, have it ;; + *) + ! : nope ;; + esac +} + +declare -A test_missing_external_prereq_ +declare -A test_subtest_missing_external_prereq_ + +# declare prerequisite for the given external binary +test_declare_external_prereq () { + binary="$1" + test "$#" = 2 && name=$2 || name="$binary(1)" + + if ! hash $binary 2>/dev/null; then + test_missing_external_prereq_["${binary}"]=t + eval " +$binary () { + test_subtest_missing_external_prereq_[\"${name}\"]=t + false +}" + fi +} + +# Explicitly require external prerequisite. Useful when binary is +# called indirectly (e.g. from emacs). +# Returns success if dependency is available, failure otherwise. +test_require_external_prereq () { + binary="$1" + if [[ ${test_missing_external_prereq_["${binary}"]} == t ]]; then + # dependency is missing, call the replacement function to note it + eval "$binary" + else + true + fi +} + +# You are not expected to call test_ok_ and test_failure_ directly, use +# the text_expect_* functions instead. + +test_ok_ () { + if test "$test_subtest_known_broken_" = "t"; then + test_known_broken_ok_ + return + fi + test_success=$(($test_success + 1)) + if test -n "$NOTMUCH_TEST_QUIET"; then + return 0 + fi + say_color pass "%-6s" "PASS" + echo " $test_subtest_name" +} + +test_failure_ () { + print_test_description + if test "$test_subtest_known_broken_" = "t"; then + test_known_broken_failure_ "$@" + return + fi + test_failure=$(($test_failure + 1)) + test_failure_message_ "FAIL" "$test_subtest_name" "$@" + test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; } + return 1 +} + +test_failure_message_ () { + say_color error "%-6s" "$1" + echo " $2" + shift 2 + if [ "$#" != "0" ]; then + echo "$@" | sed -e 's/^/ /' + fi + if test "$verbose" != "t"; then cat test.output; fi +} + +test_known_broken_ok_ () { + test_reset_state_ + test_fixed=$(($test_fixed+1)) + say_color pass "%-6s" "FIXED" + echo " $test_subtest_name" +} + +test_known_broken_failure_ () { + test_reset_state_ + test_broken=$(($test_broken+1)) + if [ -z "$NOTMUCH_TEST_QUIET" ]; then + test_failure_message_ "BROKEN" "$test_subtest_name" "$@" + else + test_failure_message_ "BROKEN" "$test_subtest_name" + fi + return 1 +} + +test_debug () { + test "$debug" = "" || eval "$1" +} + +test_run_ () { + test_cleanup=: + if test "$verbose" != "t"; then exec 4>test.output 3>&4; fi + eval >&3 2>&4 "$1" + eval_ret=$? + eval >&3 2>&4 "$test_cleanup" + return 0 +} + +test_skip () { + test_count=$(($test_count+1)) + to_skip= + for skp in $NOTMUCH_SKIP_TESTS + do + case $this_test.$test_count in + $skp) + to_skip=t + break + esac + case $this_test_bare.$test_count in + $skp) + to_skip=t + break + esac + done + case "$to_skip" in + t) + test_report_skip_ "$@" + ;; + *) + test_check_missing_external_prereqs_ "$@" + ;; + esac +} + +test_check_missing_external_prereqs_ () { + if [[ ${#test_subtest_missing_external_prereq_[@]} != 0 ]]; then + say_color skip >&1 "missing prerequisites: " + echo ${!test_subtest_missing_external_prereq_[@]} >&1 + test_report_skip_ "$@" + else + false + fi +} + +test_report_skip_ () { + test_reset_state_ + say_color skip >&3 "skipping test:" + echo " $@" >&3 + say_color skip "%-6s" "SKIP" + echo " $1" +} + +test_subtest_known_broken () { + test_subtest_known_broken_=t +} + +test_expect_success () { + exec 1>&6 2>&7 # Restore stdout and stderr + if [ -z "$inside_subtest" ]; then + error "bug in the test script: test_expect_success without test_begin_subtest" + fi + inside_subtest= + test "$#" = 1 || + error "bug in the test script: not 1 parameters to test_expect_success" + + if ! test_skip "$test_subtest_name" + then + test_run_ "$1" + run_ret="$?" + # test_run_ may update missing external prerequisites + test_check_missing_external_prereqs_ "$@" || + if [ "$run_ret" = 0 -a "$eval_ret" = 0 ] + then + test_ok_ + else + test_failure_ "$1" + fi + fi +} + +test_expect_code () { + exec 1>&6 2>&7 # Restore stdout and stderr + if [ -z "$inside_subtest" ]; then + error "bug in the test script: test_expect_code without test_begin_subtest" + fi + inside_subtest= + test "$#" = 2 || + error "bug in the test script: not 2 parameters to test_expect_code" + + if ! test_skip "$test_subtest_name" + then + test_run_ "$2" + run_ret="$?" + # test_run_ may update missing external prerequisites, + test_check_missing_external_prereqs_ "$@" || + if [ "$run_ret" = 0 -a "$eval_ret" = "$1" ] + then + test_ok_ + else + test_failure_ "exit code $eval_ret, expected $1" "$2" + fi + fi +} + +# This is not among top-level (test_expect_success) +# but is a prefix that can be used in the test script, like: +# +# test_expect_success 'complain and die' ' +# do something && +# do something else && +# test_must_fail git checkout ../outerspace +# ' +# +# Writing this as "! git checkout ../outerspace" is wrong, because +# the failure could be due to a segv. We want a controlled failure. + +test_must_fail () { + "$@" + test $? -gt 0 -a $? -le 129 -o $? -gt 192 +} + +# test_cmp is a helper function to compare actual and expected output. +# You can use it like: +# +# test_expect_success 'foo works' ' +# echo expected >expected && +# foo >actual && +# test_cmp expected actual +# ' +# +# This could be written as either "cmp" or "diff -u", but: +# - cmp's output is not nearly as easy to read as diff -u +# - not all diff versions understand "-u" + +test_cmp() { + $GIT_TEST_CMP "$@" +} + +# This function can be used to schedule some commands to be run +# unconditionally at the end of the test to restore sanity: +# +# test_expect_success 'test core.capslock' ' +# git config core.capslock true && +# test_when_finished "git config --unset core.capslock" && +# hello world +# ' +# +# That would be roughly equivalent to +# +# test_expect_success 'test core.capslock' ' +# git config core.capslock true && +# hello world +# git config --unset core.capslock +# ' +# +# except that the greeting and config --unset must both succeed for +# the test to pass. + +test_when_finished () { + test_cleanup="{ $* + } && (exit \"\$eval_ret\"); eval_ret=\$?; $test_cleanup" +} + +test_done () { + GIT_EXIT_OK=t + test_results_dir="$TEST_DIRECTORY/test-results" + mkdir -p "$test_results_dir" + test_results_path="$test_results_dir/$this_test" + + echo "total $test_count" >> $test_results_path + echo "success $test_success" >> $test_results_path + echo "fixed $test_fixed" >> $test_results_path + echo "broken $test_broken" >> $test_results_path + echo "failed $test_failure" >> $test_results_path + echo "" >> $test_results_path + + [ -n "$EMACS_SERVER" ] && test_emacs '(kill-emacs)' + + if [ "$test_failure" = "0" ]; then + if [ "$test_broken" = "0" ]; then + rm -rf "$remove_tmp" + fi + exit 0 + else + exit 1 + fi +} + +emacs_generate_script () { + # Construct a little test script here for the benefit of the user, + # (who can easily run "run_emacs" to get the same emacs environment + # for investigating any failures). + cat <<EOF >"$TMP_DIRECTORY/run_emacs" +#!/bin/sh +export PATH=$PATH +export NOTMUCH_CONFIG=$NOTMUCH_CONFIG + +# Here's what we are using here: +# +# --quick Use minimal customization. This implies --no-init-file, +# --no-site-file and (emacs 24) --no-site-lisp +# +# --directory Ensure that the local elisp sources are found +# +# --load Force loading of notmuch.el and test-lib.el + +exec ${TEST_EMACS} --quick \ + --directory "$NOTMUCH_SRCDIR/emacs" --load notmuch.el \ + --directory "$NOTMUCH_SRCDIR/test" --load test-lib.el \ + "\$@" +EOF + chmod a+x "$TMP_DIRECTORY/run_emacs" +} + +test_emacs () { + # test dependencies beforehand to avoid the waiting loop below + missing_dependencies= + test_require_external_prereq dtach || missing_dependencies=1 + test_require_external_prereq emacs || missing_dependencies=1 + test_require_external_prereq ${TEST_EMACSCLIENT} || missing_dependencies=1 + test -z "$missing_dependencies" || return + + if [ -z "$EMACS_SERVER" ]; then + emacs_tests="$NOTMUCH_SRCDIR/test/${this_test_bare}.el" + if [ -f "$emacs_tests" ]; then + load_emacs_tests="--eval '(load \"$emacs_tests\")'" + else + load_emacs_tests= + fi + server_name="notmuch-test-suite-$$" + # start a detached session with an emacs server + # user's TERM (or 'vt100' in case user's TERM is known dumb + # or unknown) is given to dtach which assumes a minimally + # VT100-compatible terminal -- and emacs inherits that + TERM=$SMART_TERM dtach -n "$TEST_TMPDIR/emacs-dtach-socket.$$" \ + sh -c "stty rows 24 cols 80; exec '$TMP_DIRECTORY/run_emacs' \ + --no-window-system \ + $load_emacs_tests \ + --eval '(setq server-name \"$server_name\")' \ + --eval '(server-start)' \ + --eval '(orphan-watchdog $$)'" || return + EMACS_SERVER="$server_name" + # wait until the emacs server is up + until test_emacs '()' >/dev/null 2>/dev/null; do + sleep 1 + done + fi + + # Clear test-output output file. Most Emacs tests end with a + # call to (test-output). If the test code fails with an + # exception before this call, the output file won't get + # updated. Since we don't want to compare against an output + # file from another test, so start out with an empty file. + rm -f OUTPUT + touch OUTPUT + + ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(notmuch-test-progn $@)" +} + +test_python() { + # Note: if there is need to print debug information from python program, + # use stdout = os.fdopen(6, 'w') or stderr = os.fdopen(7, 'w') + PYTHONPATH="$NOTMUCH_SRCDIR/bindings/python${PYTHONPATH:+:$PYTHONPATH}" \ + $NOTMUCH_PYTHON -B - > OUTPUT +} + +test_ruby() { + MAIL_DIR=$MAIL_DIR $NOTMUCH_RUBY -I $NOTMUCH_SRCDIR/bindings/ruby> OUTPUT +} + +test_C () { + exec_file="test${test_count}" + test_file="${exec_file}.c" + cat > ${test_file} + ${TEST_CC} ${TEST_CFLAGS} -I${NOTMUCH_SRCDIR}/test -I${NOTMUCH_SRCDIR}/lib -o ${exec_file} ${test_file} -L${NOTMUCH_BUILDDIR}/lib/ -lnotmuch -ltalloc + echo "== stdout ==" > OUTPUT.stdout + echo "== stderr ==" > OUTPUT.stderr + ./${exec_file} "$@" 1>>OUTPUT.stdout 2>>OUTPUT.stderr + notmuch_dir_sanitize OUTPUT.stdout OUTPUT.stderr > OUTPUT +} + + +# Creates a script that counts how much time it is executed and calls +# notmuch. $notmuch_counter_command is set to the path to the +# generated script. Use notmuch_counter_value() function to get the +# current counter value. +notmuch_counter_reset () { + notmuch_counter_command="$TMP_DIRECTORY/notmuch_counter" + if [ ! -x "$notmuch_counter_command" ]; then + notmuch_counter_state_path="$TMP_DIRECTORY/notmuch_counter.state" + cat >"$notmuch_counter_command" <<EOF || return +#!/bin/sh + +read count < "$notmuch_counter_state_path" +echo \$((count + 1)) > "$notmuch_counter_state_path" + +exec notmuch "\$@" +EOF + chmod +x "$notmuch_counter_command" || return + fi + + echo 0 > "$notmuch_counter_state_path" +} + +# Returns the current notmuch counter value. +notmuch_counter_value () { + if [ -r "$notmuch_counter_state_path" ]; then + read count < "$notmuch_counter_state_path" + else + count=0 + fi + echo $count +} + +test_reset_state_ () { + test -z "$test_init_done_" && test_init_ + + test_subtest_known_broken_= + test_subtest_missing_external_prereq_=() +} + +# called once before the first subtest +test_init_ () { + test_init_done_=t + + # skip all tests if there were external prerequisites missing during init + test_check_missing_external_prereqs_ "all tests in $this_test" && test_done +} + + +# Where to run the tests +TEST_DIRECTORY=$NOTMUCH_BUILDDIR/test + +. "$NOTMUCH_SRCDIR/test/test-lib-common.sh" || exit 1 + +if [ "${NOTMUCH_GMIME_MAJOR}" = 3 ]; then + test_subtest_broken_gmime_3 () { + test_subtest_known_broken + } + test_subtest_broken_gmime_2 () { + true + } +else + test_subtest_broken_gmime_3 () { + true + } + test_subtest_broken_gmime_2 () { + test_subtest_known_broken + } +fi + +emacs_generate_script + + +# Use -P to resolve symlinks in our working directory so that the cwd +# in subprocesses like git equals our $PWD (for pathname comparisons). +cd -P "$TMP_DIRECTORY" || error "Cannot set up test environment" + +if test "$verbose" = "t" +then + exec 4>&2 3>&1 +else + exec 4>test.output 3>&4 +fi + +for skp in $NOTMUCH_SKIP_TESTS +do + to_skip= + for skp in $NOTMUCH_SKIP_TESTS + do + case "$this_test" in + $skp) + to_skip=t + break + esac + case "$this_test_bare" in + $skp) + to_skip=t + break + esac + done + case "$to_skip" in + t) + say_color skip >&3 "skipping test $this_test altogether" + say_color skip "skip all tests in $this_test" + test_done + esac +done + +# Provide an implementation of the 'yes' utility +yes () { + if test $# = 0 + then + y=y + else + y="$*" + fi + + while echo "$y" + do + : + done +} + +# Fix some commands on Windows +case $(uname -s) in +*MINGW*) + # Windows has its own (incompatible) sort and find + sort () { + /usr/bin/sort "$@" + } + find () { + /usr/bin/find "$@" + } + sum () { + md5sum "$@" + } + # git sees Windows-style pwd + pwd () { + builtin pwd -W + } + # no POSIX permissions + # backslashes in pathspec are converted to '/' + # exec does not inherit the PID + ;; +*) + test_set_prereq POSIXPERM + test_set_prereq BSLASHPSPEC + test_set_prereq EXECKEEPSPID + ;; +esac + +test -z "$NO_PERL" && test_set_prereq PERL +test -z "$NO_PYTHON" && test_set_prereq PYTHON + +# test whether the filesystem supports symbolic links +ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS +rm -f y + +# convert variable from configure to more convenient form +case "$NOTMUCH_DEFAULT_XAPIAN_BACKEND" in + glass) + db_ending=glass + ;; + chert) + db_ending=DB + ;; + *) + error "Unknown Xapian backend $NOTMUCH_DEFAULT_XAPIAN_BACKEND" +esac +# declare prerequisites for external binaries used in tests +test_declare_external_prereq dtach +test_declare_external_prereq emacs +test_declare_external_prereq ${TEST_EMACSCLIENT} +test_declare_external_prereq ${TEST_GDB} +test_declare_external_prereq gpg +test_declare_external_prereq openssl +test_declare_external_prereq gpgsm +test_declare_external_prereq ${NOTMUCH_PYTHON} diff --git a/test/test-verbose b/test/test-verbose new file mode 100755 index 00000000..8af6d9a9 --- /dev/null +++ b/test/test-verbose @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +test_description='the verbosity options of the test framework itself.' + +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest 'print something in test_expect_success and pass' +test_expect_success ' + echo "hello stdout" && + echo "hello stderr" >&2 && + true +' +test_begin_subtest 'print something in test_expect_success and fail' +test_expect_success ' + echo "hello stdout" && + echo "hello stderr" >&2 && + false +' +test_begin_subtest 'print something between test_begin_subtest and test_expect_equal and pass' +echo "hello stdout" +echo "hello stderr" >&2 +test_expect_equal "a" "a" + +test_begin_subtest 'print something test_begin_subtest and test_expect_equal and fail' +echo "hello stdout" +echo "hello stderr" >&2 +test_expect_equal "a" "b" + +test_done diff --git a/test/test.expected-output/test-verbose-no b/test/test.expected-output/test-verbose-no new file mode 100644 index 00000000..1a2ff619 --- /dev/null +++ b/test/test.expected-output/test-verbose-no @@ -0,0 +1,21 @@ + +test-verbose: Testing the verbosity options of the test framework itself. + PASS print something in test_expect_success and pass + FAIL print something in test_expect_success and fail + + echo "hello stdout" && + echo "hello stderr" >&2 && + false + +hello stdout +hello stderr + PASS print something between test_begin_subtest and test_expect_equal and pass + FAIL print something test_begin_subtest and test_expect_equal and fail + --- test-verbose.4.expected 2010-11-14 21:41:12.738189710 +0000 + +++ test-verbose.4.output 2010-11-14 21:41:12.738189710 +0000 + @@ -1 +1 @@ + -b + +a +hello stdout +hello stderr + diff --git a/test/test.expected-output/test-verbose-yes b/test/test.expected-output/test-verbose-yes new file mode 100644 index 00000000..d25466e9 --- /dev/null +++ b/test/test.expected-output/test-verbose-yes @@ -0,0 +1,25 @@ + +test-verbose: Testing the verbosity options of the test framework itself. +hello stdout +hello stderr + PASS print something in test_expect_success and pass +hello stdout +hello stderr + FAIL print something in test_expect_success and fail + + echo "hello stdout" && + echo "hello stderr" >&2 && + false + +hello stdout +hello stderr + PASS print something between test_begin_subtest and test_expect_equal and pass +hello stdout +hello stderr + FAIL print something test_begin_subtest and test_expect_equal and fail + --- test-verbose.4.expected 2010-11-14 21:41:06.650023289 +0000 + +++ test-verbose.4.output 2010-11-14 21:41:06.650023289 +0000 + @@ -1 +1 @@ + -b + +a + diff --git a/test/valgrind/suppressions b/test/valgrind/suppressions new file mode 100644 index 00000000..6abf8b2f --- /dev/null +++ b/test/valgrind/suppressions @@ -0,0 +1,6 @@ +{ + zlib inflation uses uninitialize values + Memcheck:Cond + fun:inflateReset2 + fun:inflateInit2_ +}
\ No newline at end of file diff --git a/test/valgrind/valgrind.sh b/test/valgrind/valgrind.sh new file mode 100755 index 00000000..78700c07 --- /dev/null +++ b/test/valgrind/valgrind.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +base=$(basename "$0") + +TRACK_ORIGINS= + +VALGRIND_VERSION=$(valgrind --version) +VALGRIND_MAJOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*\([0-9]*\)') +VALGRIND_MINOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*[0-9]*\.\([0-9]*\)') +test 3 -gt "$VALGRIND_MAJOR" || +test 3 -eq "$VALGRIND_MAJOR" -a 4 -gt "$VALGRIND_MINOR" || +TRACK_ORIGINS=--track-origins=yes + +exec valgrind -q --error-exitcode=126 \ + --leak-check=no \ + --suppressions="$GIT_VALGRIND/suppressions" \ + --gen-suppressions=all \ + $TRACK_ORIGINS \ + --log-fd=4 \ + --input-fd=4 \ + $GIT_VALGRIND_OPTIONS \ + "$GIT_VALGRIND"/../../"$base" "$@" |
