aboutsummaryrefslogtreecommitdiffstats
path: root/github-suggestion
AgeCommit message (Collapse)Author
2020-08-23Suggestion: Add doc comments for the recent blob changesTeddy Wing
2020-08-23Suggestion: Rename `diff_command()` to `blob()`Teddy Wing
This function is no longer calling the `git diff` command, so this name doesn't make sense.
2020-08-23Revert "Suggestion.diff_command: Diff an index instead of a file"Teddy Wing
This reverts commit 588cd526fd78b3a0e0ec1dfb9fc194ca385de902. Since each suggestion has its own associated commit, we can't compare a tree and a single commit. We'll probably have to invoke `git diff` once for each suggestion.
2020-08-23Suggestion.diff_command: Diff an index instead of a fileTeddy Wing
This will enable us to use the `git diff` command with more than one suggestion at the same time. We compare the commit of the suggestion with the new index's tree. And as I write this, I'm realising that we can't diff multiple suggestions using the same commit because each suggestion has its own commit. Need to work out a different way to do this.
2020-08-22Suggestion.diff_command: Return the right side version blobTeddy Wing
Don't run the `git diff` command in this function, instead return the new blob created for the right hand side of the comparison. This will facilitate showing the diffs of multiple suggestions at once. Maybe. I haven't tried the command yet. Actually, looking at the man page, it doesn't say we can include more than one blob pair, so I might need to put all of the suggestion changes into a single blob and compare the original commit with that.
2020-08-22Execute `git diff` to output diffsTeddy Wing
I want to enable colour diff output. At first, I thought about doing this by getting the diff colours from the Git config, then outputting the ANSI escape codes manually with the text. However, I then thought it would be nice to enable other diff features like `--word-diff`, and it would be too much trouble to re-implement that manually, and then I'd have to take word diff colouring into account. Decided that the optimal way to get both colours and extra diff features like word diffing would be to use `git diff` directly under the hood. We shell out to `git diff`, and give it the original file as a base, and a new blob object that we create in the repository on the right side. This allows us to compare the file using a command in the following format: $ git diff <BASE>:src/server.rs <TEMPORARY_HASH> Ostensibly, the temporary blob object I create for the right side version should be freed automatically by `git2`. Add a new `sugdiff` command to output diffs. This will replace `sugpatch`. Since we're working with diffs, I think a name with "diff" sounds more logical. The previous version, "patch" sounds too much like what "apply" does, because of the Unix `patch` command.
2020-08-06Increase version v0.0.1 -> v0.1.0v0.1.0Teddy Wing
2020-08-06Remove `github-suggestion/Cargo.lock`Teddy Wing
This is subsumed into `Cargo.lock` and doesn't do anything any more.
2020-08-06Rename the project `git-suggestion`Teddy Wing
Since this is a Git command, this makes more sense to me.
2020-08-05client::Error::Deserialize: Include source error messageTeddy Wing
Forgot to include this so we didn't get extra information about the cause of the error.
2020-08-04Add license (GNU GPLv3+)Teddy Wing
2020-08-02Add documentation commentsTeddy Wing
Light documentation for our various functions and types.
2020-08-01Move library to a separate crateTeddy Wing
Keep the binaries in the root crate, and add a new crate for the `github-suggestion` library. I want to add some library code to the CLI programs to extract common functionality between the different binaries.