Turns diffs into todo lists by parsing comments
Haskell Nix Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cmd Move commands to sub-directory Sep 10, 2016
src Use highlighter2 instead of highlighting-kate Aug 16, 2016
tests
.envrc
.gitignore
.travis.yml Need libgmp to install Stack on Ubuntu Sep 10, 2016
AUTHORS As requested by Google Open Source review team Aug 3, 2014
CHANGELOG.md
CONTRIBUTORS
LICENSE
Makefile Update Makefile to be less confusing Aug 29, 2016
README.md Update installation docs Oct 1, 2016
Setup.hs Add Setup.hs Sep 10, 2016
TODO.md Command-line args and help Feb 8, 2015
default.nix Use highlighter2 instead of highlighting-kate Aug 16, 2016
difftodo.cabal
package.yaml
shell.nix Add Haskell code Aug 11, 2016
stack.yaml

README.md

difftodo Build Status

Do you litter your code with XXX, TODO, and FIXME comments? Would you like to actually do those TODOs and fix those FIXMEs? If so, difftodo can help.

difftodo finds all the comments you've edited or added that are marked with XXX or TODO and then displays the output in a nice, human-readable way.

How to use it

For most things, you just need to run git todo.

If you've got uncommitted, unstaged changes, git todo will show all TODOs from those changes.

Otherwise, git todo will show all TODOs between your branch and master.

What do I need to do before merging this git branch?

$ git todo origin/master...
git-todo/Main.hs:62:
  -- TODO: Take git diff flags as options

git-todo/Main.hs:73:
  -- TODO: Read this as a bytestring from the start

git-todo/Main.hs:83:
  -- TODO: Use gitlib

What do I need to do before I can commit this?

$ git todo
git-todo/Main.hs:90:
  -- TODO: Factor out todo reporting

Have I staged any TODOs?

$ git todo --cached

What TODOs are left in my code base?

$ git todo --files
... too many to list here! ...

Advanced usage

git todo tries to do the right thing. If you want more control, then you can use the all-todos command, which shows all of the TODOs found in a particular file.

e.g.

$ all-todos ../src-todo/branch-review.py
../src-todo/branch-review.py:11:
  # XXX: Incorporate this into difftodo

You can also use diff-todo to extract TODOs from a diff. This is more or less how git todo works, so if you find yourself wanting a bit more control over what git todo does you can just use diff-todo, e.g.

$ git diff v1.0.1...v1.0.0 | diff-todo

Installing

macOS

$ brew tap jml/difftodo
$ brew install difftodo

From source

You need to have the following dependencies installed before you can build:

  • pcre
  • pkg-config

The preferred method is to build using Stack. In a checkout of the repository, run:

$ stack install

Note: the git todo command assumes that git is available on the PATH.

History

This was originally bzr-todo, and then became difftodo, and then got rewritten in Haskell.

Contributing

I'm very keen to make this better, but I'm also rather busy. Patches & issues are welcome, but there's no SLA on replies.

If you find difftodo useful, then please let me know.