Age | Commit message (Collapse) | Author |
|
|
|
|
|
Since it doesn't really make sense to take multiple refs, don't allow
more than one. We can only diff between two trees, and one is fixed as
the workdir.
Also learned that to get an exit code from a `system()` call in Perl,
you have to shift `$?` by 8
(https://perldoc.perl.org/functions/system.html).
|
|
Print usage information with `-h`.
|
|
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.
|
|
|
|
|
|
If a ref is given on the command line, use that as the diff base.
Otherwise default to master.
|
|
* Remove commented code
* Ignore unused `hunk` variable
|
|
* 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.
|
|
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.
|
|
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.
|
|
Instead of always printing to standard output, have the function take a
writer to write the output to.
|
|
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.
|
|
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.
|
|
The `new_lineno()` is `None` when the line was removed. Ignoring removed
lines allows us to leave out removed TODOs.
|
|
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.
|
|
With the following command:
$ cargo init --bin
|