aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-10-17Increase version v0.0.2 -> v0.0.3HEADv0.0.3masterTeddy Wing
2020-10-17write_since(): Output file paths relative to the current directoryTeddy Wing
Previously, the file paths of TODO lines in the output were relative to the repository root. When you're in a subdirectory, though, this makes them harder to work with, as they're relative paths, but aren't relative to the current working directory. Change the file path output so that paths are relative to the current directory instead of the repo root.
2020-10-17t/104-works-outside-the-repo-root.t: Remove subdir in teardownTeddy Wing
I wasn't clearning up the "subdir" directory created in this test. Tried adding a new test that used the same subdirectory name, which failed to create the directory because it was already created here.
2020-10-08Increase version v0.0.1 -> v0.0.2v0.0.2Teddy Wing
2020-10-08Add tests for modified files in the working directory and indexTeddy Wing
Add a couple tests to confirm that the program works for files that have been modified: * in the working directory but not staged * in the index but not committed
2020-10-08write_since(): Include TODO lines from untracked filesTeddy Wing
Previously, untracked files were not included in the diff, so TODO lines in those files would not be printed by the program. Add the untracked `DiffOptions` to include the content of these files when searching for TODOs.
2020-10-07main(): Open repository even if PWD is a subdirectoryTeddy Wing
Previously, running `git todo` outside the root of the repository would result in this error: error: unable to open repository: could not find repository from '.'; class=Repository (6); code=NotFound (-3) It turns out the `open()` method expects the given path to be the repository root. Use `open_from_env()` instead, which functions more like regular Git commands.
2020-10-04README: Add a section about the Vim pluginTeddy Wing
2020-10-03Build for release and configure static linkingv0.0.1Teddy Wing
Set up a release build and distribution packaging. Configure static linking for 'openssl' and 'libgit2'. Based on or copied from code from 'git-suggestion'.
2020-10-03Remove old filesTeddy Wing
These files were for ideas and explorations of solutions. We now have a working implementation independent of them.
2020-10-03Add READMETeddy Wing
2020-10-03Add license (GNU GPLv3+)Teddy Wing
2020-10-03Add man pageTeddy Wing
Copied some of the structure and the Makefile recipe from 'git-suggestion'.
2020-10-03Makefile: Add prerequisites to `target/debug/git-todo` targetTeddy Wing
In af63ef79f5f2bc770844169580902ff61f54ec98, I forgot to add prerequisites, so when the source changed, the debug binary wasn't rebuilt before running tests.
2020-10-01Makefile: Ensure binary is built before running testsTeddy Wing
2020-09-17main.rs: Add version command line optionTeddy Wing
2020-09-17lib.rs: Add doc commentsTeddy Wing
2020-09-17main.rs: Error when more than one ref argument is givenTeddy Wing
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).
2020-09-17main.rs: Add `-h` help flagTeddy Wing
Print usage information with `-h`.
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-16Cargo.toml: Set Rust 2018Teddy Wing
Must have removed this accidentally after I generated the Rust scaffold.
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-15Add t/101-removed-todo-lines-not-included.tTeddy Wing
Test that removed TODO lines don't appear in the command's output. This currently gives the following error: thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/main.rs:39:43 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread 'main' panicked at 'Box<Any>', $HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.13.11/src/panic.rs:27:9
2020-09-15t/100-shows-todo-comments-since-fork-point.t: Fix teardownTeddy Wing
Need to restore the repo state back to the master branch and remove the new branch created in this test.
2020-09-15t/Ideas.txt: Add new test ideaTeddy Wing
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
2020-09-14t/: Add test to get a TODO since the fork pointTeddy Wing
In order to include the 'bin.pm' file, we need to add its containing folder to the include path. Do this by adding a Makefile with the required command line argument. Add a new test that modifies the test file to add a new new TODO line. Test that it comes back in the `git todo` output.
2020-09-14Add TAP test harnessTeddy Wing
Copied with alterations from git-branch-list.
2019-11-03Ideas for getting recent TODOs from a range of Git refsTeddy Wing
The goal will be to list all TODOs since the branch point. Additionally, there should be an option to print the TODOs with file names and line numbers to enable loading the list into Vim's quickfix list.