patman: Add spaces back into patman test

The patman test code was failing because some extra spaces got
stripped when it was applied.  These spaces are critical to the test
code working.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
patman: Allow tests to run even if patman is in the path

Several of the patman doctests assume that patman was run with:
  ./patman

Fix them so that they work even if patman is run with just "patman"
(because patman is in the path).

Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
patman: Look for checkpatch in the scripts directory

The Linux kernel stores checkpatch.pl in the scripts directory.  Add
that to the search path to make things more automatic for kernel
development.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
patman: Cache the CC list from MakeCcFile() for use in ShowActions()

Currently we go through and generate the CC list for patches twice.
This gets slow when (in a future CL) we add a call to
get_maintainer.pl on Linux.  Instead of doing things twice, just cache
the CC list when it is first generated.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
patman: Add all CC addresses to the cover letter

If we're sending a cover letter make sure to CC everyone that we're
CCing on each of the individual patches.

Signed-off-by: Doug Anderson <dianders@chromium.org>
patman: Add a call to get_maintainer.pl if it exists

For Linux the best way to figure out where to send a patch is with the
"get_maintainer.pl" script.  Add support for calling it from patman.
Support is added unconditionally for "scripts/get_maintainer.pl" in
case it is helpful for any other projects.

Signed-off-by: Doug Anderson <dianders@chromium.org>
patman: Add support for settings in .patman

This patch adds support for a [settings] section in the .patman file.
In this section you can add settings that will affect the default
values for command-line options.

Support is added in a generic way such that any setting can be updated
by just referring to the "dest" of the option that is passed to the
option parser.  At the moment options that would make sense to put in
settings are "ignore_errors", "process_tags", and "verbose".  You
could override them like:

 [settings]
 ignore_errors: True
 process_tags: False
 verbose: True

The settings functionality is also used in a future change which adds
support for per-project settings.

Signed-off-by: Doug Anderson <dianders@chromium.org>
patman: Add the concept of multiple projects

There are cases that we want to support different settings (or maybe
even different aliases) for different projects.  Add support for this
by:
* Adding detection for two big projects: U-Boot and Linux.
* Adding default settings for Linux (U-Boot is already good with the
  standard patman defaults).
* Extend the new "settings" feature in .patman to specify per-project
  settings.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
patman: Add settings to the list of modules to doctest

The settings modules now has doctests, so run them.

Signed-off-by: Doug Anderson <dianders@chromium.org>
patman: Allow use outside of u-boot tree

To make it usable in git trees not providing a patch checker
implementation, add a command line option, allowing to suppress patch
check. While we are at it, sort debug options alphabetically.

Also, do not raise an exception if checkpatch.pl is not found - just
print an error message suggesting to use the new option, and return
nonzero status.

   . unit test passes:
    $ ./patman  -t
    <unittest.result.TestResult run=7 errors=0 failures=0>
   . successfully used patman in the autotest tree to generate a patch
     email (with --no-check option)
   . successfully used patman in the u-boot tree to generate a patch
     email
   . `patman --help' now shows command line options ordered
     alphabetically

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Acked-by: Doug Anderson <dianders@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Merge branch 'master' of git://git.denx.de/u-boot-x86