aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)Author
2020-09-17main.rs: Fix ref parsingTeddy Wing
Turns out `refname_to_id()` wasn't the right function to get a reference/oid/object from a ref name. Use `revparse_single()` instead to get a usable reference object. Add a test for custom diff bases.
2020-09-17main.rs: Remove `unwrap()`s and handle errorsTeddy Wing
2020-09-17main.rs: Print errors with prefixTeddy Wing
2020-09-17main.rs: Accept a ref as a command line argumentTeddy Wing
If a ref is given on the command line, use that as the diff base. Otherwise default to master.
2020-09-16write_since(): Clean up `diff.foreach()` callbackTeddy Wing
* Remove commented code * Ignore unused `hunk` variable
2020-09-16write_since(): Handle errors in `diff.foreach()` callbackTeddy Wing
* Ignore lines that don't parse to UTF-8. Might want to figure out how to support other encodings. * Ignore lines that don't have a `path`. * Panic on write errors.
2020-09-16lib.rs: Replace top-level `unwrap()`s with `Result`sTeddy Wing
Add a new `Error` type that we can return in the failure case. Still need to work out how to handle errors inside the diff callback.
2020-09-16write_since(): Take an arbitrary branch as inputTeddy Wing
Allow the branch to be parameterised instead of forcing the base to be the local "master" branch. Added the `Todos` struct to store a `Repository` reference, since we need this for both the base ref and the diff. Decided to take a `Tree` instead of a `Branch` because we might want to compare against an arbitrary ref and allow users to specify that ref on the command line.
2020-09-16write_since(): Take an arbitrary `Write`rTeddy Wing
Instead of always printing to standard output, have the function take a writer to write the output to.
2020-09-16Move `main()` to `lib::write_since()`Teddy Wing
Move this to a library function for better organisation. This will facilitate splitting up and refining `write_since()`, and free up `main()` for command line argument parsing.
2020-09-16t/100-shows-todo-comments-since-fork-point.t: Update outputTeddy Wing
Update the expectation to include the file name and line number plus the exact line content as printed by the command. Remove the extra newline from the output so that now only a single newline is printed.
2020-09-15main.rs: Fix 101-removed-todo-lines-not-included testTeddy Wing
The `new_lineno()` is `None` when the line was removed. Ignoring removed lines allows us to leave out removed TODOs.
2020-09-15src/main.rs: Print TODO lines between master...workdirTeddy Wing
Look for TODO lines since the "master" branch. For each TODO line, print the file it's in, its line number, and the line, à la grep.
2020-09-14Initialise new Rust v1.46.0 projectTeddy Wing
With the following command: $ cargo init --bin