Age | Commit message (Collapse) | Author |
|
This works now, thanks to 3c6f337e26964077d1ce629fa17d16e4484b877f.
|
|
|
|
This function is no longer calling the `git diff` command, so this name
doesn't make sense.
|
|
The diff command wasn't exiting after outputting the diff. Add the
`--no-pager` argument to ensure that the pager doesn't activate. This
also seems to cause the command to exit once all the output is printed.
We don't want the pager because we need to call `git diff` for each
suggestion. If an early diff took up more than a page and activated the
pager, that would block the next diffs from appearing. We want them all
to appear at once.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
|
|
This is subsumed into `Cargo.lock` and doesn't do anything any more.
|
|
Probably not going to do this one as it's not always possible to get the
commenter's name and email address, and even then it might not be the
same as what they use in the repo.
|
|
|
|
This was replaced by `RELEASE_PRODUCTS` so that I could make
`DIST_PRODUCTS` based on `PRODUCTS`.
|
|
|
|
|
|
Add recipes to build release targets and copy the binaries and man pages
into the `dist/` folder. We'll use this to package a release archive.
|
|
Got an error:
error: failed to open: /usr/local/.crates.toml
when I tried the command with the `--root /usr/local` argument, so
decided to remove it.
Need to use the root crate name in the `cargo uninstall` command.
|
|
Since this is a Git command, this makes more sense to me.
|
|
Found a suggestion on the `gh` GitHub CLI project page from 'mislav'
(https://github.com/mislav) and 'probablycorey'
(https://github.com/probablycorey) to use as an example.
Haven't tested the install/uninstall instructions yet (copied these from
another one of my projects).
|
|
I hadn't tested with HTTPS remote URLs, so assumed the code I copied
from `github_suggestion::url` would work. It worked for suggestion
comment URLs, but it doesn't work for remote URLs because the latter end
in ".git". Remove this suffix to fix the bug.
|
|
Forgot to include this so we didn't get extra information about the
cause of the error.
|
|
|
|
|
|
Copied from `git-sugpatch.1`, since the general elements are basically
the same. Modified to describe the specifics of the `git-sugapply`
command.
|
|
Make it clear that these options require argument values.
|
|
To make it clear which ID needs to be used when using the short form.
|
|
|
|
|
|
|
|
Allow getting the program version from the command line.
|
|
|
|
We have multiple binaries in `src/bin/`, so this file is no longer
needed.
|
|
Light documentation for our various functions and types.
|
|
|
|
|
|
Since this check for suggestion arguments is in both binaries, we can
move it to the common preflight function.
Clean up other areas now that we moved the function.
|
|
Use the new logic from `git-sugpatch` to build a `Config` and run
`apply()` on all suggestion input arguments.
|
|
|
|
|
|
Print usage on `-h` and `--help`.
Store the usage brief on `Config` in order to be able to print it from
multiple places.
|
|
Add `Options` to `Config` to allow us to get a usage string from a
`Config` instance, which is where we create `Options`.
Needed to remove the `Debug` derive on `Config` in order to add the
field as `Options` doesn't implement `Debug`.
|
|
This was a test, before I worked out the API for this function.
|
|
|
|
Replace my test exit code with a real one.
|
|
|
|
|
|
Print the error and exit.
|
|
Turns out this didn't need to be public at all.
|
|
Split this out into a separate function because I want to reuse it in
`git-sugapply`.
|