Commit 725298d6 authored by Gordon Ball's avatar Gordon Ball

Imported Upstream version 0.9.0~git20160613.0.3e5db87

parents
The development of Timewarrior was made possible by the significant
contributions of the following people:
Paul Beckingham (Principal Author)
Federico Hernandez (Principal Author)
Dirk Deimeke (Technical Advisor)
Tomas Babej (Contributing Author)
The following submitted code, packages or analysis, and deserve special thanks:
Renato Alves
Wim Schuermann
Jelle van der Waa
Sergey Trofimov
Thanks to the following, who submitted detailed bug reports and excellent
suggestions:
Shawn Wilson
creatid
Frédéric Meynadier
Bruno Vernay
Ben Boeckel
Wade Duvall
Sebastian Uharek
cmake_minimum_required (VERSION 2.8)
set (CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
set (HAVE_CMAKE true)
project (timew)
include (CXXSniffer)
set (PROJECT_VERSION "0.9.0")
message ("-- Looking for SHA1 references")
if (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
set (HAVE_COMMIT true)
execute_process (COMMAND git log -1 --pretty=format:%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE COMMIT)
configure_file ( ${CMAKE_SOURCE_DIR}/commit.h.in
${CMAKE_SOURCE_DIR}/commit.h)
message ("-- Found SHA1 reference: ${COMMIT}")
endif (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
set (PACKAGE "${PROJECT_NAME}")
set (VERSION "${PROJECT_VERSION}")
set (PACKAGE_BUGREPORT "support@taskwarrior.org")
set (PACKAGE_NAME "${PACKAGE}")
set (PACKAGE_TARNAME "${PACKAGE}")
set (PACKAGE_VERSION "${VERSION}")
set (PACKAGE_STRING "${PACKAGE} ${VERSION}")
if (FREEBSD)
SET (TIMEW_MAN1DIR man/man1 CACHE STRING "Installation directory for man pages, section 1")
SET (TIMEW_MAN5DIR man/man5 CACHE STRING "Installation directory for man pages, section 5")
else (FREEBSD)
SET (TIMEW_MAN1DIR share/man/man1 CACHE STRING "Installation directory for man pages, section 1")
SET (TIMEW_MAN5DIR share/man/man5 CACHE STRING "Installation directory for man pages, section 5")
endif (FREEBSD)
SET (TIMEW_DOCDIR share/doc/timew CACHE STRING "Installation directory for doc files")
message ("-- Configuring cmake.h")
configure_file (
${CMAKE_SOURCE_DIR}/cmake.h.in
${CMAKE_SOURCE_DIR}/cmake.h)
add_subdirectory (src)
add_subdirectory (src/commands)
add_subdirectory (doc)
if (EXISTS ${CMAKE_SOURCE_DIR}/test)
add_subdirectory (test EXCLUDE_FROM_ALL)
endif (EXISTS ${CMAKE_SOURCE_DIR}/test)
set (doc_FILES NEWS ChangeLog README.md INSTALL AUTHORS COPYING LICENSE)
foreach (doc_FILE ${doc_FILES})
install (FILES ${doc_FILE} DESTINATION ${TIMEW_DOCDIR})
endforeach (doc_FILE)
# ---
set (CPACK_SOURCE_GENERATOR "TGZ")
set (CPACK_SOURCE_PACKAGE_FILE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION})
set (CPACK_SOURCE_IGNORE_FILES "CMakeCache" "CMakeFiles" "CPackConfig" "CPackSourceConfig"
"_CPack_Packages" "cmake_install" "install_manifest" "Makefile$"
"test" "package-config" "src/timew$" "src/libtimew.a"
"src/commands/libcommands.a" "src/lex"
"/\\\\.gitignore" "/\\\\.git/" "swp$")
include (CPack)
Contributing to Timewarrior
===========================
Contributing a patch
--------------------
The public stable branch for the latest release is `master`. We never commit to
the master branch.
The main branch for development is named something like `1.2.3`. This is the
branch where your changes must go. If you see two branches, `1.2.3` and
`1.2.4`, then choose the higher-numbered branch.
Any patch against `master`, or an older development branch, means additional
merge work for maintainers, and will not be accepted. If your change is on the
wrong branch, rebase it onto the right branch. Then retest.
By contributing a patch, you are declaring that you have the right to submit
the code under the project licensing terms.
Do I need to be a developer to contribute?
------------------------------------------
No, we need help from a variety of skilled or organized individuals.
Here are the different ways you might conѕider contributing. Anyone can
contribute, and everyone is encouraged to do so. Here are many ways to
contribute that may not be immediately obvious to you:
- Use the project, become familiar with it, and make suggestions. There are
always ongoing discussions about new features and changes to existing
features.
- Join us in the #taskwarrior IRC channel on freenode.net. Many great ideas,
suggestions, testing and discussions have taken place there. It is also
the quickest way to get help, or confirm a bug.
- Join https://answers.tasktools.org and help us by asking, answering and
voting on questions and answers, directly helping those who ask, and
helping future users who search for existing answers.
- Review documentation: there are man pages, online articles, tutorials and
so on, and these contain many errors, or they may not convey ideas in the
best way. Perhaps you can help improve it. Contact us - documentation is
a separate effort from the codebase, and includes all web sites, and all
are available using git.
- Take a look at the bug database, and help triage the bug list. This is a
review process that involves confirming bugs, providing additional data,
information or analysis. Bug triage is very useful and much needed. You
could check to see that an old bug is still relevant - sometimes they are
not. Need permissions to modify issues? Ask.
- Review the source code, and point out inefficiencies, problems, unreadable
functions, bugs and assumptions.
- Fix a bug. For this you'll need C++ and Git skills, but this is one of
the largest ways you can contribute. We welcome all bug fixes, provided
the work is done well and doesn't create other problems or introduce new
dependencies. We recommend talking to us before starting. Seriously.
- Add unit tests. Unit tests are possibly the most useful contributions of
all, because they not only improve the quality of the code, but prevent
future regressions, therefore maintaining quality of subsequent releases.
Plus, broken tests are a great motivator for us to fix the causal defect.
You'll need Python/C++ skills.
- Add a feature. Well, let's be very clear about this: adding a feature is
not usually well-received, and if you add a feature and send a patch, it
will most likely be rejected. The reason for this is that there are many
efforts under way, in various code branches. There is a very good chance
that the feature you add is either already in progress, or being done in a
way that is more fitting when considering other work in progress. So if
you want to add a feature, please don't. Start by talking to us, and find
out what is currently under way or planned. You might find that we've
already rejected such a feature for some very good reasons. So please
check first, so we don't duplicate effort or waste anyone's time.
- Spread the word. Help others become more effective at managing tasks.
- Encouragement. Tell us what works for you, and what doesn't.
- Request a feature. This not only tells us that you think something is
missing from the software, but gives us insights into how you use it.
Plus, you might get your feature implemented.
How to make a patch
-------------------
Clone the repository from the right place. Do not clone from our github mirror,
we don't use it. Do not patch the contents of one of our tarballs.
$ git clone https://git.tasktools.org/scm/tm/timew.git
Find the latest development branch, and checkout.
$ git branch -a
* master
remotes/origin/1.2.3
remotes/origin/1.2.4
remotes/origin/HEAD -> origin/master
remotes/origin/master
$ git checkout 1.2.4
Prepare your fix. Use a commit message that matches the prevailing format.
See 'git log' for examples.
$ git commit -m '<category>: <description>'
Make sure the test suite passes:
$ cd test
$ make
$ ./run_all
If your fix doesn't pass all tests, change it, and squash your commits into one
commit that works. We do continuous integration, and we want all commits, if
possible, to not fail.
If you add new functionality, add new tests.
Make a patch file:
$ git format-patch HEAD^
Take the resulting 0001-xxxxxxx.patch file and attach it to an email that is
addressed to support@taskwarrior.org. Do not paste the patch inline in the
message, attach it instead. This allows the maintainer to save the attachment
intact and unmodified by the mail client.
In your message, be sure to convince us that you ran the test suite. If you
want to go the extra mile, update the ChangeLog and add your name to the
AUTHORS file in the right place.
What happens next?
------------------
Your patch will be reviewed by the maintainers. You may receive feedback, which
may include requested changes. Your patch may be accepted and applied
immediately.
Your authorship will be preserved in the commit. We want you to be properly
credited for your work.
Near the end of the development cycle, when a release is close, your patch may
be held until the next development cycle begins, unless it is shown to be
minimal and not destabilizing. In mid-cycle your patch may be immediately
applied and pushed.
What are the causes for a patch to be rejected?
-----------------------------------------------
Most likely if your patch is rejected, there are some good reasons. This should
be made clear, with recommendations for improving the patch. Please rework the
patch and resubmit.
Here are some reasons that cause patch rejection:
- The code wasn't tested, or breaks the test suite. Every commit should improve
the project.
- New functionality was submitted without supporting tests. Without tests, how
would we know it works on all platforms?
- New functionality, or modified behavior was not first cleared by the
maintainers as being desirable. We don't want you to waste your time either.
But we do have a plan, and all changes must conform to the plan, otherwise
it morphs the project into something we don't want.
- The code does not follow the formatting of the surrounding code. Your code
should blend in perfectly, and not stand out for reasons of formatting,
naming convention, tabs etc.
- The changes need supporting documentation changes which were not made.
- Inefficient, non-portable, or broken code.
http://taskwarrior.org
Timewarrior - a command line time tracker
Copyright 2015 - 2016, Paul Beckingham, Federico Hernandez.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
http://www.opensource.org/licenses/mit-license.php
1.0.0 () -
- TD-49 Log when file management fails
(thanks to Ben Boeckel).
- TD-115 Throw error when config file is missing or not readable
(thanks to Jelle van der Waa).
- TI-2 Two line tags causes false entry in database
(thanks to Sebastian Uharek).
- TI-3 The month report shows multi-days current task truncated
(thanks to Tomas Babej).
- TI-4 The 'timew' command considers only the last interval
(thanks to Tomas Babej).
- TI-5 Unicode tags not working.
(thanks to Sergey Trofimov).
- TI-6 Exception after shortening task.
(thanks to Sergey Trofimov).
- TI-7 Stop command shouldn't interrupt unrelated tags.
(thanks to Sergey Trofimov).
- TI-8 Only the day's last interval is considered in the month report
(thanks to Tomas Babej).
- Added 'continue' command.
- Added 'diagnostics' command.
- Added 'export' command.
- Added 'extensions' command.
- Added 'help' command.
- Added 'start' command.
- Added 'stop' command.
- Added 'tags' command.
- Integrated libshared.git.
- Colored tags supported.
- Added Taskwarrior hook script to integrate Timewarrior.
- Added support for the ':debug' and :quiet hints.
- Added support for the :day, :week, :month, :quarter and :year hints.
- Added 'track' command.
- Added 'cancel' command.
- Added 'config' command.
- Added 'tag' command.
- Added 'untag' command.
- Added 'shorten' command.
Design completed 2016-03-13
Project started 2015-11-29
------ current release ---------------------------
------ start -----------------------------------
Installation Instructions
-------------------------
Please follow the instructions below to build and install Timewarrior from
source.
Dependencies
------------
In order to build Timewarrior, you will need:
- cmake (See http://cmake.org)
- make
You will need a C++ compiler that supports full C++11, which includes:
- gcc 4.7 (released 2012-03-23)
- clang 3.3 (released 2013-01-07)
Basic Installation
------------------
Briefly, these shell commands will unpack, build and install Timewarrior:
$ tar xzf timew-X.Y.Z.tar.gz [1]
$ cd timew-X.Y.Z [2]
$ cmake . [3]
$ make [4]
$ sudo make install [5]
$ cd .. ; rm -r timew-X.Y.Z [6]
These commands are explained below:
1. Unpacks the source tarball. This creates the directory timew-X.Y.Z,
containing all the code.
2. Change directory to the root of the distribution.
3. Invokes CMake to scan for dependencies and machine-specific details, then
generate the makefiles. This may take a minute.
4. Builds Timewarrior. This may take a minute.
5. Installs the program, documentation and other data files.
6. Removes the temporary directory.
Build and configurations options
--------------------------------
You can customize the configuration run with cmake variables. This will modify
the installation process:
To change the installation directory you use the following configuration
variable:
$ cmake -DCMAKE_INSTALL_PREFIX=<path-to-installation-dir> .
cmake configuration variables are applied with the -D option and consist of a
<name> and a <value>:
$ cmake -D<name>=<value> .
Four more variables can customize the installation process. The following table
lists them and their defaults plus the CMAKE_INSTALL_PREFIX:
CMAKE_INSTALL_PREFIX /usr/local
TIMEW_BINDIR bin
TIMEW_DOCDIR share/doc/timew
TIMEW_RCDIR share/doc/timew/rc
TIMEW_MAN1DIR share/man/man1
TIMEW_MAN5DIR share/man/man5
The corresponding TIMEW_* variables will be combined with CMAKE_INSTALL_PREFIX to
get absolute installation directories:
CMAKE_INSTALL_PREFIX/TIMEW_BINDIR /usr/local/bin
CMAKE_INSTALL_PREFIX/TIMEW_DOCDIR /usr/local/share/doc/timew
CMAKE_INSTALL_PREFIX/TIMEW_RCDIR /usr/local/share/doc/timew/rc
CMAKE_INSTALL_PREFIX/TIMEW_MAN1DIR /usr/local/share/man/man1
CMAKE_INSTALL_PREFIX/TIMEW_MAN5DIR /usr/local/share/man/man5
Updating Timewarrior build
--------------------------
This section concerns itself with the description of the procedure needed to
update the local Timewarrior build from the 'timew' git repository.
To update the local Timewarrior build, you need to update the git repository,
including the 'src/libshared' submodule. To do that, run:
$ git pull --recurse-submodules
$ git submodule update
At this point you have the fully updated sources at your disposal and you can
update your local build following the regular build instructions:
$ cmake .
$ make
$ sudo make install
Uninstallation
--------------
There is no uninstall option in CMake makefiles. This is a manual process.
To uninstall Timewarrior, remove the files listed in the install_manifest.txt
file that was generated when you built Timewarrior.
Timewarrior Build Notes
-----------------------
Timewarrior has dependencies that are detected by CMake in almost all cases, but
there are situations and operating systems that mean you will need to offer a
little help.
If Timewarrior will not build on your system, first take a look at the Operating
System notes below. If this doesn't help, then go to the Troubleshooting
section, which includes instructions on how to contact us for help.
Operating System Notes
----------------------
Cygwin
If 'make install' fails when writing to the /usr/local/share/ directory,
this may be because your current login doesn't have permission to write
to the Windows directory containing your Cygwin installation. Either
login to Windows as an Administrator and try the 'make install' process
again, or reinstall Cygwin under your normal Windows login.
Troubleshooting
---------------
If you've recently made changes to dependencies (by reinstalling them, for
example) be sure to rerun 'cmake .' before trying to execute 'make' again.
CMake will run and locate all the necessary pieces for the build, and create
a Makefile. There may be errors and warnings when running CMake, or there
may be compiler errors and warnings when running 'make'. Sometimes you will run
CMake with no reported problems, and the build will fail later. This is
almost always because CMake is mistaken about some assumption.
If a build does not succeed, please send the contents of the 'CMakeCache.txt'
and 'CMakeFiles/CMakeOutput.log' files to support@taskwarrior.org, or post a
message in the support forums at taskwarrior.org along with the information.
If CMake runs but Timewarrior does not build, please send the contents of the
above files as well as a transcript from the build, which is not written to a
file and must be captured from the terminal.
---
Timewarrior - a command line time tracker
Copyright 2015 - 2016, Paul Beckingham, Federico Hernandez.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
http://www.opensource.org/licenses/mit-license.php
New Features in 1.0.0
- The 'start' and 'stop' commands record the duration.
- The 'export' command emits all data in JSON format.
- The 'on-modify.timewarrior' script is a Taskwarrior hook script to integrate
Timewarrior into the 'start' and 'stop' commands.
- Enables debug mode with the ':debug' command line hint.
- Enables quiet mode with the ':quiet' command line hint.
Known Issues
- See https://bug.tasktools.org/
Timewarrior has been built and tested on the following configurations:
* Arch
* Cygwin
* Debian
* Fedora
* FreeBSD
* Ubuntu
* OS X
---
While Timewarrior has undergone testing, bugs are sure to remain. If you find
a bug, please enter a new issue at:
https://bug.tasktools.org
Or you can also report the issue in the forums at:
https://answers.tasktools.org
Or just send a message to:
support@taskwarrior.org
Thank you.
# Disclaimer during ongoing development
We want to discourage you from using the development version of Timewarrior. As
a new project, it has initially no functionality, and will only annoy you. At
time of first release, there will be online documentation that explaions what
the prodcut is, and how it can help you. Until then, everything is a work in
progress.
The development branch is being actively updated and may not pass all quality
tests, therefore it may harm your data. In fact, as a new project, it doesn't
have adequate tests to prove that anything works. We do not guarantee proper or
even adequate functionality, performance or timely fixes.
We welcome bug reports from beta- and release-level software, but generally not
development versions. If you are undaunted by this, please:
- Make proper backups.
- Expect broken and missing functionality.
- Be aware that using the development branch involves risks.
- Give us lots of feedback, to improve the software.
---
Thank you for taking a look at Timewarrior!
Timewarrior is a time tracking utility that offers simple stopwatch features as
well as sophisticated calendar-base backfill, along with flexible reporting. It
is a portable, well supported and very active, Open Source project.
Timewarrior is a new project, but is growing every day, and will soon have
online documentation and demonstrations. You'll find all the details at:
http://taskwarrior.org
At the site you'll find online documentation, downloads, news and more.
Your contributions are especially welcome. Whether it comes in the form of code
patches, ideas, discussion, bug reports, encouragement or criticism, your input
is needed.
For support options, take a look at:
http://taskwarrior.org/support
Please send your code patches to:
support@taskwarrior.org
Consider joining bug.tasktools.org, answers.tasktools.org and participating in
the future of Timewarrior.
---
Timewarrior is released under the MIT license. For details check the LICENSE
file.
/* cmake.h.in. Creates cmake.h during a cmake run */
/* Package information */
#define PACKAGE "${PACKAGE}"
#define VERSION "${VERSION}"
#define PACKAGE_BUGREPORT "${PACKAGE_BUGREPORT}"
#define PACKAGE_NAME "${PACKAGE_NAME}"
#define PACKAGE_TARNAME "${PACKAGE_TARNAME}"
#define PACKAGE_VERSION "${PACKAGE_VERSION}"
#define PACKAGE_STRING "${PACKAGE_STRING}"
#define CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
/* Installation details */
#define TIMEW_RCDIR "${CMAKE_INSTALL_PREFIX}/${TIMEW_RCDIR}"
/* git information */
#cmakedefine HAVE_COMMIT
/* cmake information */
#cmakedefine HAVE_CMAKE
#define CMAKE_VERSION "${CMAKE_VERSION}"
/* Compiling platform */
#cmakedefine LINUX
#cmakedefine DARWIN
#cmakedefine CYGWIN
#cmakedefine FREEBSD
#cmakedefine OPENBSD
#cmakedefine NETBSD
#cmakedefine HAIKU
#cmakedefine SOLARIS
#cmakedefine KFREEBSD
#cmakedefine GNUHURD
#cmakedefine UNKNOWN
message ("-- Configuring C++11")
message ("-- System: ${CMAKE_SYSTEM_NAME}")
include (CheckCXXCompilerFlag)
# NOTE: Phase out -std=gnu++0x and --std=c++0x as soon as realistically possible.
CHECK_CXX_COMPILER_FLAG("-std=c++11" _HAS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" _HAS_CXX0X)
CHECK_CXX_COMPILER_FLAG("-std=gnu++0x" _HAS_GNU0X)
if (_HAS_CXX11)
set (_CXX11_FLAGS "-std=c++11")
elseif (_HAS_CXX0X)
message (WARNING "Enabling -std=c++0x draft compile flag. Your compiler does not support the standard '-std=c++11' option. Consider upgrading.")
set (_CXX11_FLAGS "-std=c++0x")
elseif (_HAS_GNU0X)
message (WARNING "Enabling -std=gnu++0x draft compile flag. Your compiler does not support the standard '-std=c++11' option. Consider upgrading.")
set (_CXX11_FLAGS "-std=gnu++0x")
else (_HAS_CXX11)
message (FATAL_ERROR "C++11 support missing. Try upgrading your C++ compiler. If you have a good reason for using an outdated compiler, please let us know at support@taskwarrior.org.")
endif (_HAS_CXX11)