| Age | Commit message (Collapse) | Author |
|
Output can be generated directly via Painter::write, or Painter::output_buffer.
The latter must be emit()'ed before the former method can be used again,
otherwise the order is incorrect.
Tests added. Fixes #1504
|
|
|
|
|
|
|
|
Fix #128
Add support for `git diff -D` (aka irreversible delete)
The patch is adding a title for removed file, even when there is no file content in the diff output
Without the patch, there was no output related to the file at all
|
|
* Handle a mode change on a renamed file.
I changed the diff parsing to cache the mode info from the old/new mode
lines until the parsing bumps into the start of the actual related diff,
finds the diff line for an unrelated diff, or runs out of input. This
allows the mode info to be output in conjunction with a file event
instead of as a separate heading (that used to have an empty name when
the mode change was for a rename).
The mode info is passed down into the draw routines as a separate
"addendum" string that the draw code can use as it likes. Currently that
means that it appends the addendum string to the non-raw string in
parens. I imagine that future draw routines could decide to put it in a
separate box or some other per-routine method. There is currently a
single function in src/handlers/draw.rs that joins the strings in the
same way for everyone.
A couple examples of how the new code looks:
Δ foo.rs (mode +x)
───────────────────────────────────────────────────
renamed: old-longer-name → shorter-name (mode +x)
───────────────────────────────────────────────────
Would it look better on its own line?
Δ foo.rs
• mode +x
───────────────────────────────────────────────────
renamed: old-longer-name → shorter-name
• mode +x
───────────────────────────────────────────────────
Would it look better appended after a "•" character?
Δ foo.rs • mode +x
───────────────────────────────────────────────────
renamed: old-longer-name → shorter-name • mode +x
───────────────────────────────────────────────────
Should it be a user option? If so, we can do that later.
|
|
This allows keep-plus-minus-markers=false to be honored inside merge
conflicts but not honored for combined diff regions outside merge
conflicts.
|
|
|
|
With this commit combined diff
format (https://git-scm.com/docs/git-diff#_combined_diff_format) is
handled appropriately. However, there is no special handling of merge
conflict markers.
Fixes #189, #736
|
|
This handler function was returning `false`, thus signaling that it
had not handled the line, when it was not the responsibility of any
other handler to handle the line. It was doing this to rely on the
fall-through handlers determining whether to emit the line or skip it.
But this risks another handler handling it and is a violation of the
contract. It is much more appropriate to make the determination in the
handler itself, emit it if appropriate, and signal that it has been
handled.
|
|
|